bitcoindevkit / bdk

A modern, lightweight, descriptor-based wallet library written in Rust!
Other
838 stars 300 forks source link

Make sure all docs and example derivation paths correspond to the network #1209

Open notmandatory opened 10 months ago

notmandatory commented 10 months ago
          unrelated to this PR, but the derivation path should correspond to the network, e.g. `m/86h/1h/0h/0`

_Originally posted by @ValuedMammal in https://github.com/bitcoindevkit/bdk/pull/1028#discussion_r1391637131_

ValuedMammal commented 9 months ago

This is the only place I noticed where Network::Testnet is used but the derivation path starts with m/86h/0h. I guess nothing prevents you from using any deriv path you like (the network is checked against the xpub?), but for consistency and as a general best practice, testnet examples should also use the testnet coin type as described in BIP44, for example m/86h/1h.

https://github.com/bitcoindevkit/bdk/blob/46d39beb2caa759f19bcf3e6397de3029b1aab6a/crates/bdk/examples/mnemonic_to_descriptors.rs#L35-L37

If others agree, this could probably get lumped in with #1223

notmandatory commented 9 months ago

Thanks for checking @ValuedMammal, @realeinherjar can you fix this in your #1223?