From 555be41b2bab0ad88f45e1a0ea984df76b21a3d6 Mon Sep 17 00:00:00 2001 From: Ning Shang Date: Mon, 18 Jan 2021 19:59:41 -0800 Subject: [PATCH 1/2] ch07: 2-of-5 instead of 2-of-3 for Mohammed's example The example is a 2-of-5 multisig, according to the Pay-to-Script-Hash example description earlier, and the P2SH example a few lines below. --- ch07.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch07.asciidoc b/ch07.asciidoc index ebbc82f6..f029e293 100644 --- a/ch07.asciidoc +++ b/ch07.asciidoc @@ -761,7 +761,7 @@ The ((("use cases", "import/export", id="mohamappd")))second type of witness pro HASH160 54c557e07dde5bb6cb791c7a540e0a4796f5e97e EQUAL ---- -This P2SH script references the hash of a _redeem script_ that defines a 2-of-3 multisignature requirement to spend funds. To spend this output, Mohammed's company would present the redeem script (whose hash matches the script hash in the P2SH output) and the signatures necessary to satisfy that redeem script, all inside the transaction input: +This P2SH script references the hash of a _redeem script_ that defines a 2-of-5 multisignature requirement to spend funds. To spend this output, Mohammed's company would present the redeem script (whose hash matches the script hash in the P2SH output) and the signatures necessary to satisfy that redeem script, all inside the transaction input: .Decoded transaction showing a P2SH output being spent ---- From c942d694b695084e00719a62c7bf9d75ac159fe9 Mon Sep 17 00:00:00 2001 From: Ning Shang Date: Mon, 18 Jan 2021 20:34:10 -0800 Subject: [PATCH 2/2] ch07: Typo fixes Fix minor typos related to 'equal to' and 'less/greater than'. --- ch07.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch07.asciidoc b/ch07.asciidoc index f029e293..d7a76c4f 100644 --- a/ch07.asciidoc +++ b/ch07.asciidoc @@ -310,9 +310,9 @@ To lock it to a time, say 3 months from now, the transaction would be a P2SH tra where ++ is a block height or time value estimated 3 months from the time the transaction is mined: current block height {plus} 12,960 (blocks) or current Unix epoch time {plus} 7,760,000 (seconds). For now, don't worry about the +DROP+ opcode that follows +CHECKLOCKTIMEVERIFY+; it will be explained shortly. -When Bob tries to spend this UTXO, he constructs a transaction that references the UTXO as an input. He uses his signature and public key in the unlocking script of that input and sets the transaction +nLocktime+ to be equal or greater to the timelock in the +CHECKLOCKTIMEVERIFY+ Alice set. Bob then broadcasts the transaction on the bitcoin network. +When Bob tries to spend this UTXO, he constructs a transaction that references the UTXO as an input. He uses his signature and public key in the unlocking script of that input and sets the transaction +nLocktime+ to be equal to or greater than the timelock in the +CHECKLOCKTIMEVERIFY+ Alice set. Bob then broadcasts the transaction on the bitcoin network. -Bob's transaction is evaluated as follows. If the +CHECKLOCKTIMEVERIFY+ parameter Alice set is less than or equal the spending transaction's +nLocktime+, script execution continues (acts as if a “no operation” or NOP opcode was executed). Otherwise, script execution halts and the transaction is deemed invalid. +Bob's transaction is evaluated as follows. If the +CHECKLOCKTIMEVERIFY+ parameter Alice set is less than or equal to the spending transaction's +nLocktime+, script execution continues (acts as if a “no operation” or NOP opcode was executed). Otherwise, script execution halts and the transaction is deemed invalid. More precisely, +CHECKLOCKTIMEVERIFY+ fails and halts execution, marking the transaction invalid if (source: BIP-65):