From b2663d53dcf63ded83de7c25ed1c8cd8c7fe1022 Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Tue, 16 Jan 2018 18:55:13 +0100 Subject: [PATCH 1/7] add missing '$' --- 08_4_Scripting_a_Multisig.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/08_4_Scripting_a_Multisig.md b/08_4_Scripting_a_Multisig.md index 4477d2e..bf8b3c6 100644 --- a/08_4_Scripting_a_Multisig.md +++ b/08_4_Scripting_a_Multisig.md @@ -43,7 +43,7 @@ If this looks familiar, that's because it's the multisig that you deserialized i The `scriptSig` for a standard multisig address must then submit the missing operands for `OP_CHECKMULTISIG`: a `0` followed by "m" signatures. For example: ``` -0 $signature1 signature2 +0 $signature1 $signature2 ``` ### Run a Raw Multisig Script From f837bd79a1a07688908f7f551a4ea42814d90cf8 Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Tue, 16 Jan 2018 19:04:59 +0100 Subject: [PATCH 2/7] fix copy paste error --- 08_4_Scripting_a_Multisig.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/08_4_Scripting_a_Multisig.md b/08_4_Scripting_a_Multisig.md index bf8b3c6..9695e7b 100644 --- a/08_4_Scripting_a_Multisig.md +++ b/08_4_Scripting_a_Multisig.md @@ -109,7 +109,7 @@ To create a P2SH multisig, follow the standard steps for creating a P2SH locking 1. Serialize `2 $address1 $address2 2 OP_CHECKMULTISIG`. 1. `` = "52210307fd375ed7cced0f50723e3e1a97bbe7ccff7318c815df4e99a59bc94dbcd819210367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a2852ae" -2. Save `` for future reference as the redeemScript. +2. Save `` for future reference as the redeemScript. 1. `` = "52210307fd375ed7cced0f50723e3e1a97bbe7ccff7318c815df4e99a59bc94dbcd819210367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a2852ae" 3. SHA-256 and RIPEMD-160 hash the serialized script. 1. `` = "babf9063cee8ab6e9334f95f6d4e9148d0e551c2" From e9c0f9de5979227475cf920be8d673b542983132 Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Wed, 17 Jan 2018 10:13:41 +0100 Subject: [PATCH 3/7] fix typo 'OP_CHECKLOCKTIME VERIFY' --- 09_2_Using_CLTV_in_Scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/09_2_Using_CLTV_in_Scripts.md b/09_2_Using_CLTV_in_Scripts.md index a97d22c..e6c65ae 100644 --- a/09_2_Using_CLTV_in_Scripts.md +++ b/09_2_Using_CLTV_in_Scripts.md @@ -27,7 +27,7 @@ Because CLTV is just part of a script (and presumably part of a P2SH transaction This is how `OP_CHECKLOCKTIMEVERIFY` would be used to check against May 24, 2017: ``` -1495652013 OP_CHECKLOCKTIME VERIFY +1495652013 OP_CHECKLOCKTIMEVERIFY ``` But we'll usually depict this in an abstraction like this: ``` From b8a20f5864ccfaa3dc0957d72dd1122454e482b9 Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Wed, 17 Jan 2018 15:18:22 +0100 Subject: [PATCH 4/7] fix grammar --- 10_1_Using_Script_Conditionals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10_1_Using_Script_Conditionals.md b/10_1_Using_Script_Conditionals.md index 6d4e483..954d8d0 100644 --- a/10_1_Using_Script_Conditionals.md +++ b/10_1_Using_Script_Conditionals.md @@ -32,7 +32,7 @@ Of course, you might say, that's how Bitcoin Script works. Conditionals use reve Consider the following code: `IF OP_DUP OP_HASH160 ELSE OP_DUP OP_HASH160 ENDIF OP_EQUALVERIFY OP_CHECKSIG `. -Year of looking at conditionals in prefix notation might lead you to read this as: +Looking at conditionals in prefix notation might lead you to read this as: ``` IF (OP_DUP) THEN From 78a02e2db0c52e04599ac626c28526ab57ff507f Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Wed, 17 Jan 2018 15:19:10 +0100 Subject: [PATCH 5/7] fix variable name --- 10_1_Using_Script_Conditionals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10_1_Using_Script_Conditionals.md b/10_1_Using_Script_Conditionals.md index 954d8d0..4d495df 100644 --- a/10_1_Using_Script_Conditionals.md +++ b/10_1_Using_Script_Conditionals.md @@ -30,7 +30,7 @@ Second, the `IF` conditional tends to be in the locking script and what it's che Of course, you might say, that's how Bitcoin Script works. Conditionals use reverse Polish notation and they adopt the standard unlocking/locking paradigm, just like _everything else_ in Bitcoin Scripting. That's all true, but it also goes contrary to the standard way we read IF/ELSE conditionals in other programming languages; thus, it's easy to unconsciously read Bitcoin conditionals wrong. -Consider the following code: `IF OP_DUP OP_HASH160 ELSE OP_DUP OP_HASH160 ENDIF OP_EQUALVERIFY OP_CHECKSIG `. +Consider the following code: `IF OP_DUP OP_HASH160 ELSE OP_DUP OP_HASH160 ENDIF OP_EQUALVERIFY OP_CHECKSIG `. Looking at conditionals in prefix notation might lead you to read this as: ``` From 74fc60cf3b0a323395f39a9867a0419678306526 Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Wed, 17 Jan 2018 15:50:15 +0100 Subject: [PATCH 6/7] fix typo (of/or) --- 11_1_Writing_Puzzle_Scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11_1_Writing_Puzzle_Scripts.md b/11_1_Writing_Puzzle_Scripts.md index b611b97..cef5386 100644 --- a/11_1_Writing_Puzzle_Scripts.md +++ b/11_1_Writing_Puzzle_Scripts.md @@ -181,7 +181,7 @@ Here's where the security falls down: First, anyone can redeem them without knowing much of a secret. They do have to have the `redeemScript`, which offers some protection, but once they do, that's probably the only secret that's necessary — unless your puzzle is _really_ tough, such as a computational puzzle. -Second, the actual redemption isn't secure. Normally, a Bitcoin transction is protected by the signature. Because the signature covers the transaction, no one on the network can rewrite that transaction to instead send to their address without invalidating the signature (and thus the transaction). That isn't true with a transactions whose inputs are just numbers. Anyone could grab the transaction and rewrite it to allow them to steal the funds. If they can get their transaction into a block before yours, they win, and you don't get the puzzle money. There are solutions for this, but they involve mining the block yourself of having a trusted pool mine it, and neither of those options is rational for an average Bitcoin user. +Second, the actual redemption isn't secure. Normally, a Bitcoin transction is protected by the signature. Because the signature covers the transaction, no one on the network can rewrite that transaction to instead send to their address without invalidating the signature (and thus the transaction). That isn't true with a transactions whose inputs are just numbers. Anyone could grab the transaction and rewrite it to allow them to steal the funds. If they can get their transaction into a block before yours, they win, and you don't get the puzzle money. There are solutions for this, but they involve mining the block yourself or having a trusted pool mine it, and neither of those options is rational for an average Bitcoin user. Yet, Peter Todd's cryptographic bounties prove that puzzle scripts do have some real-world application. From 87ea4ae643dcac1c9a7c33ea024d1a60667519c2 Mon Sep 17 00:00:00 2001 From: Justus Kandzi Date: Wed, 17 Jan 2018 15:52:12 +0100 Subject: [PATCH 7/7] fix typo (presmably) --- 11_1_Writing_Puzzle_Scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11_1_Writing_Puzzle_Scripts.md b/11_1_Writing_Puzzle_Scripts.md index cef5386..0aa3a6e 100644 --- a/11_1_Writing_Puzzle_Scripts.md +++ b/11_1_Writing_Puzzle_Scripts.md @@ -189,7 +189,7 @@ Yet, Peter Todd's cryptographic bounties prove that puzzle scripts do have some Puzzles scripts are a great introduction to more realistic and complex Bitcoin Scripts. They demonstrate the power of the mathematical and stack functions in Bitcoin Script and how they can be carefully combined to create questions that require very specific answers. However, their real-world usage is also limited by the security issues inherent in non-signed Bitcoin transactions. -_What is the power of puzzle script?_ Despite their limitations, puzzles scripts have been used in the real world as the prizes for computational bounties. Anyone who can figure out a complex puzzle, whose solution presmably has some real-world impact, can win the bounty. Whether they get to actually keep it is another question. +_What is the power of puzzle script?_ Despite their limitations, puzzles scripts have been used in the real world as the prizes for computational bounties. Anyone who can figure out a complex puzzle, whose solution presumably has some real-world impact, can win the bounty. Whether they get to actually keep it is another question. ## What's Next?