Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
notmandatory opened this issue Nov 14, 2023 · 3 comments
Closed
Labels
documentation Improvements or additions to documentation module-descriptor
Milestone

Comments

@notmandatory
Copy link
Member

          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 #1028 (comment)

@notmandatory notmandatory added the documentation Improvements or additions to documentation label Nov 14, 2023
@notmandatory notmandatory added this to BDK Nov 14, 2023
@notmandatory notmandatory moved this to Todo in BDK Nov 14, 2023
@notmandatory notmandatory added this to the 1.0.0-beta.0 milestone Nov 14, 2023
@ValuedMammal
Copy link
Contributor

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.

// define external and internal derivation key path
let external_path = DerivationPath::from_str("m/86h/0h/0h/0").unwrap();
let internal_path = DerivationPath::from_str("m/86h/0h/0h/1").unwrap();

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

@notmandatory
Copy link
Member Author

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

@ValuedMammal
Copy link
Contributor

From what I can tell, all of our documented examples use a derivation path that makes sense for the network, in particular using coin type 1 for testnet. Also addressed by #1286, #1378

@github-project-automation github-project-automation bot moved this from Todo to Done in BDK Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation module-descriptor
Projects
Archived in project
Development

No branches or pull requests

2 participants