-
Notifications
You must be signed in to change notification settings - Fork 809
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
How can I support P2SH-P2WPKH(BIP49) transaction in bcoin wallet? #606
Comments
bcoin also supports P2SH-P2WPKH, they're called |
@bucko13 I create a witness and pubkeyhash wallet with mnemonic. But the nested-address is different from the online creator https://iancoleman.io/bip39/ . And if I import a pubkey, bcoin doesn't support prefix 'ypub' Account key. |
Hi @kelvinkuo bcoin actually handles "nested" addresses with a branch value of 2, similar to how recieve and change are 0 and 1 respectively. So the bip39 (actually bip44) path bcoin uses is different from the website you reference. See And as you have already discovered, ypub is not yet supported in bcoin. |
@pinheadmz thanks,But many wallets use BIP49(`purpose 49) way to support P2SH-P2WPKH. I want know `change = 2, which BIP defined this path??? |
BIP49 is a proposal still in draft status. The document even mentions one strategy to nested witness P2SH addresses is to maintain a bip44 structure with a new "branch". This is the strategy implemented by bcoin for (what I presume) is two main reasons:
bcoin users can easily create nested addresses (or native bech32 addresses, or legacy addresses) with the library if desired. We can not always garuntee interoperability with every other wallet out there. If you want to fork the bcoin wallet module to derive nested addresses for all purposes on a bip49 path, I think that would be a great contribution! But it is unlikely to get merged to master. |
The total bytes for a nested witness into p2sh is overall larger than p2sh or p2pkh equivalent, and for that reason I think it's generally not recommended. |
@pinheadmz got it. I think I need hack some code to support BIP49. |
@kelvinkuo you should be able to try this out with @pinheadmz PR. Not sure what the chances of this getting merged to master but it has been tested and should work for watch-only trezor wallets! Will close this issue. |
I want create P2SH-P2WPKH wallet, But bcoin only support P2PKH/P2SH/P2WPKH.
Anyone has a solution?
The text was updated successfully, but these errors were encountered: