From 16771fa164e87696e9e9ba2b79fb9b87e183524e Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Tue, 23 May 2017 15:24:38 -0700 Subject: [PATCH] Update 8_1_Understanding_the_Foundation_of_P2SH.md --- 8_1_Understanding_the_Foundation_of_P2SH.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/8_1_Understanding_the_Foundation_of_P2SH.md b/8_1_Understanding_the_Foundation_of_P2SH.md index b1bb54f..751bd0a 100644 --- a/8_1_Understanding_the_Foundation_of_P2SH.md +++ b/8_1_Understanding_the_Foundation_of_P2SH.md @@ -84,7 +84,7 @@ It may be easier to understand this by taking an existing hexcode and translatin ``` 52210307fd375ed7cced0f50723e3e1a97bbe7ccff7318c815df4e99a59bc94dbcd819210367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a2852ae ``` -You can translate this back to Script by hand using either that [Bitcoin Wiki Script page](https://en.bitcoin.it/wiki/Script) or else the handy tool at [Chain Query](https://chainquery.com/bitcoin-api/decodescript). Just look at one byte (two hex characters) of data at a time, unless you're told to look at more by an OP_PUSHDATA command (0x01 to 0x4e). +You can translate this back to Script by hand using the [Bitcoin Wiki Script page](https://en.bitcoin.it/wiki/Script) as a reference. Just look at one byte (two hex characters) of data at a time, unless you're told to look at more by an OP_PUSHDATA command (0x01 to 0x4e). The whole Script will break apart as follows: ``` @@ -102,6 +102,8 @@ 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 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._ #### Transform the Hex to Binary