Closed impowski closed 6 years ago
So I figured this:
def p2sh_address(pub_key_1, pub_key_2):
pub_key_hash_1 = pub_key_1.hash()
pub_key_hash_2 = pub_key_2.hash()
multisig_script = MultisigScript(2, pub_key_1, pub_key_2, 2)
multisig_script_hash = multisig_script.p2wsh_hash()
p2wsh_script = P2wshV0Script(multisig_script_hash)
p2sh_address = P2shScript(p2wsh_script).address()
return (multisig_script, p2sh_address)
And I got this address (exactly which I needed):
2N2qWuN9rpfw4DvPqjJ3SD1adNnmZdeM5NU
Here is the address which I need
2N2qWuN9rpfw4DvPqjJ3SD1adNnmZdeM5NU
(testnet)Here is what I do to get it:
Here is the redeem script hex which I got:
5221020d2036fea368d0400acabe96e975b6f4e24c6f40f2e45db4264c2f117702c1e72102d0b84f4a3d4890b2fdde4dc74db4328fb3504e0247187d8286311c75b3b6bdeb52ae
It's the same as on the block.ioHere is the address which I got from
from_script
:2N7tpkpBJPmv2BD37eTXDUJJzhpXEoyyNU9
Am I doing something wrong or it should be like that?