diff --git a/8_1_Understanding_the_Foundation_of_P2SH.md b/8_1_Understanding_the_Foundation_of_P2SH.md index 751bd0a..a81ae22 100644 --- a/8_1_Understanding_the_Foundation_of_P2SH.md +++ b/8_1_Understanding_the_Foundation_of_P2SH.md @@ -102,7 +102,21 @@ Here's what the individual parts mean: In other words, that `redeemScript` was a translation of of "2 0307fd375ed7cced0f50723e3e1a97bbe7ccff7318c815df4e99a59bc94dbcd819 0367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a28 2 OP_CHECKMULTISIG" -If you'd like a mechanical hand with this sort of translation in the future, take a look at the online [Chain Query](https://chainquery.com/bitcoin-api/decodescript), which translates from hexcode to opcode, or the Python [Transaction Script Compiler](https://github.com/Kefkius/txsc), which translates back and forth. +If you'd like a mechanical hand with this sort of translation in the future, you can use `bitcoin-cli decodescript`: +``` +$ bitcoin-cli -named decodescript hexstring=52210307fd375ed7cced0f50723e3e1a97bbe7ccff7318c815df4e99a59bc94dbcd819210367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a2852ae +{ + "asm": "2 0307fd375ed7cced0f50723e3e1a97bbe7ccff7318c815df4e99a59bc94dbcd819 0367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a28 2 OP_CHECKMULTISIG", + "reqSigs": 2, + "type": "multisig", + "addresses": [ + "mg7YqyvK8HUFvpgZ5iYTfZ5vjfaJWnNTd9", + "mfduLxpR6Bq1ARctV2TauhetWwqnqH1vYS" + ], + "p2sh": "2NAGfA4nW6nrZkD5je8tSiAcYB9xL2xYMCz" +} +``` +Also consider the Python [Transaction Script Compiler](https://github.com/Kefkius/txsc), which translates back and forth. _If this is intimidating, don't worry about it; as we said, this will usually be done with an API. As we lay bare the foundation of P2SH Scripting, we're mostly explaining what those APIs will do._