Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Varlakov <[email protected]>
  • Loading branch information
survived committed Nov 25, 2024
1 parent 7ccea27 commit 36a4130
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let child_key_pair = slip10::derive_child_key_pair_with_path(

`HdWallet` trait generalizes HD derivation algorithm, you can use it with generics:
```rust
use hd_wallet::{Slip10Like, curves::Secp256r1};
use hd_wallet::{Slip10, curves::Secp256r1};

fn derive_using_generic_algo<E: generic_ec::Curve, Hd: hd_wallet::HdWallet<E>>(
master_key: hd_wallet::ExtendedKeyPair<E>,
Expand All @@ -47,7 +47,7 @@ fn derive_using_generic_algo<E: generic_ec::Curve, Hd: hd_wallet::HdWallet<E>>(
let seed = b"16-64 bytes of high entropy".as_slice();
let master_key = hd_wallet::slip10::derive_master_key(seed)?;
let master_key_pair = hd_wallet::ExtendedKeyPair::from(master_key);
let child_key = derive_using_generic_algo::<Secp256r1, Slip10Like>(master_key_pair);
let child_key = derive_using_generic_algo::<Secp256r1, Slip10>(master_key_pair);

```

Expand Down

0 comments on commit 36a4130

Please sign in to comment.