Skip to content

Commit

Permalink
ch07: Update script example to account for bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wbnns committed Mar 10, 2021
1 parent db678d1 commit 6661b9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ch07.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ P2SH was developed to resolve these practical difficulties and to make the use o
.Complex script without P2SH
|=======
| Locking Script | 2 PubKey1 PubKey2 PubKey3 PubKey4 PubKey5 5 CHECKMULTISIG
| Unlocking Script | Sig1 Sig2
| Unlocking Script | 0 Sig1 Sig2
|=======

[[with_p2sh]]
.Complex script as P2SH
|=======
| Redeem Script | 2 PubKey1 PubKey2 PubKey3 PubKey4 PubKey5 5 CHECKMULTISIG
| Locking Script | HASH160 <20-byte hash of redeem script> EQUAL
| Unlocking Script | Sig1 Sig2 <redeem script>
| Unlocking Script | 0 Sig1 Sig2 <redeem script>
|=======

As you can see from the tables, with P2SH the complex script that details the conditions for spending the output (redeem script) is not presented in the locking script. Instead, only a hash of it is in the locking script and the redeem script itself is presented later, as part of the unlocking script when the output is spent. This shifts the burden in fees and complexity from the sender (who creates the transaction) to the recipient (who unlocks and spends the transaction).
Expand Down

0 comments on commit 6661b9c

Please sign in to comment.