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

Index xpub index for cosigners. #42

Open
nodech opened this issue Feb 12, 2019 · 2 comments
Open

Index xpub index for cosigners. #42

nodech opened this issue Feb 12, 2019 · 2 comments

Comments

@nodech
Copy link
Member

nodech commented Feb 12, 2019

Even though we have path entry in database for cosigners it is not automatically used to figure out XPUB.index, but will be convenient to expose xpub.index to the users and simplify API usage.

Related bcoin-org/bcoin#689 - This tries to solve XPUB issue for bcoin xpub Only wallets.

@tynes
Copy link
Member

tynes commented Feb 15, 2019

This would greatly increase user experience, and we can use the xpub prefix bytes to make a good guess at the first few parts of the path. Right now to save some user experience, I pull the account index from each xpub returned from the api and then ledger.getPublicKey.xpubkey(network) until a match is found, then I know which account index to use when signing. This makes it so that the user doesn't need to enter their account index or path when signing, but there are cases when this will not work, like using a ypub/zpub, because bcoin doesn't support those yet, so its still possible to specify a path

@tynes
Copy link
Member

tynes commented Feb 18, 2019

If we had this bcoin-org/bcoin#616 merged into bcoin, it would make it much easier to infer the path based on the xpub

  • we always know that it will be m/
  • can use the xpub prefix to determine the purpose
    • this isn't 100% but people that are that custom probably write their own tools anyways
    • can account for xpub, ypub, zpub, tpub
  • coin type could be derived from bcoin/lib/protocol/networks.[network].coinType
  • account can be parsed from xpub
  • branch + index are in the database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants