Closed loupiote closed 3 years ago
@loupiote It works correctly. For BIP49 implementation the address is also P2WPKH nested in P2SH not P2SH.
P2WPKH_IN_P2SH -> 3Jdnbtqg3f8YberUzEirLLAumsp7RYt4Kw P2SH -> 3K7n6sivDyYPgkkmBcQMWhLxJvH2AuaHVy
You can use hdwallet.BIP49HDWallet class. Thanks :)
This is the code i'm using. Can you correct it to show me the code that provides the correct address? thanks in advance!!
from hdwallet import HDWallet
wallet = HDWallet(symbol=BTC) wallet.from_mnemonic(mnemonic="all all all all all all all all all all all all") path = "m/49'/0'/0'/1/0" wallet.from_path(path) addr = wallet.p2sh_address()
wallet = HDWallet(symbol=BTC) wallet.from_mnemonic(mnemonic="all all all all all all all all all all all all") path = "m/49'/0'/0'/1/0" wallet.from_path(path) addr = wallet.p2wpkh_in_p2sh_address()
Thanks!
How do you get a BIP-84 native segwit address that start with "bc1q" ? (e.g. path = "m/84'/0'/0'/1/0")
mnemonic: "all all all all all all all all all all all all" no passphrase
derivation path: "m/49'/0'/0'/1/0 correct address: 3Jdnbtqg3f8YberUzEirLLAumsp7RYt4Kw
incorrect address returned by HDWallet: 3K7n6sivDyYPgkkmBcQMWhLxJvH2AuaHVy
Note: I confirmed the correct address also with bip_utils
Also, i think that wallet.address() should still be defined as an alias to wallet.p2pkh_address(), to keep old scripts compatible (and also the example of this page still uses address() )