5
4
What is the process of decoding the P2SH address?
We have this information so far.
Let's run through an example tx bea1e7ae7ecdc502215717f30d62a12085bb2866d8db730dfb626b60c337534c
The hex script (for the first output) is: 514104398184a2cef0d7b73ed7a3a1d4ad16296c3c6986bed0bd72775060aae9891979eaea1efb28d7eb1da3304ec38a98b42086e3be2ceba82b0e932128ec422a6fc2210250504b2d4245544120506565722d506565722d6e6574776f726b2062657461212102553432353135362e31323234202020202020202020202020202020202020202053ae
script decode gives:
{
"asm" : "1 04398184a2cef0d7b73ed7a3a1d4ad16296c3c6986bed0bd72775060aae9891979eaea1efb28d7eb1da3304ec38a98b42086e3be2ceba82b0e932128ec422a6fc2 0250504b2d4245544120506565722d506565722d6e6574776f726b206265746121 02553432353135362e313232342020202020202020202020202020202020202020 3 OP_CHECKMULTISIG",
"reqSigs" : 1,
"type" : "multisig",
"addresses" : [
"1TestLVFK8DsRYFQkDDwvfsPHqUqWPBe7",
"1H16KgZg3wHgApvHvZkSocxN6ibzNT9Cc7",
"1N31mRc4tiGumXdRmb1Bzk9BoG4Bc7Ctbi"
],
"p2sh" : "3KQYMMqMBTv8254UqwmaLzW5NDT879KzK8"
}
Can we break this script down?
I don't believe you can "decode" a script hash. You just have to provide a matching script which when hashed equals the hash provided. – Snowman – 2016-09-03T01:01:15.157
can we derive the p2sh address from the script? I can do it using pybitcointools, but i want to know the steps involved – Albert s – 2016-09-03T02:32:35.713
p2sh address = Base58Check(SHA256(RIPEMD160(script))) – Snowman – 2016-09-03T02:40:44.457