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
BTC Address : [Segwit ] Wrong #11
Comments
why does the privatekey_to_h160 function need addr_type |
if you do so : bip44_h160_c = secp256k1_lib.privatekey_to_h160(1, True, 0xe0353e2293a63769802b1e3d0d9affdedfda4d4486ed300428eadac4620427bf) but what does the address type have to do with hash160? |
Thanks in advance. |
Thanks @Noname400 For Legacy or bech32 address the hash160 is same so there is no difference in these 2. But for P2SH address situation is complicated as it needs double hash. (A hash160 of 0014+hash160.) That is the reason by decoding back p2sh address you can only go back 1 level up of hash160 and not the second level. Let me think about if i can reorganise my functions any different. Currently i just kept the same so that they are equivalent with address to avoid confusion. |
thx |
import secp256k1_lib
bip44_h160_c = secp256k1_lib.privatekey_to_h160(0, True, 0xe0353e2293a63769802b1e3d0d9affdedfda4d4486ed300428eadac4620427bf)
PVK1 BTC Address : [Segwit ] 33eYbdrqZcxSXvPb26fj8KBqW4xxofzRpC True
The text was updated successfully, but these errors were encountered: