From 22ef1a460ad080e09c2dbd8c9b26d317b0ffdb5a Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Wed, 15 Jul 2020 15:29:06 -1000 Subject: [PATCH] Update 10_3_Running_a_Bitcoin_Script_with_P2SH.md --- 10_3_Running_a_Bitcoin_Script_with_P2SH.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/10_3_Running_a_Bitcoin_Script_with_P2SH.md b/10_3_Running_a_Bitcoin_Script_with_P2SH.md index 172335f..48f4c0f 100644 --- a/10_3_Running_a_Bitcoin_Script_with_P2SH.md +++ b/10_3_Running_a_Bitcoin_Script_with_P2SH.md @@ -1,8 +1,8 @@ -# 8.3: Running a Bitcoin Script with P2SH +# 10.3: Running a Bitcoin Script with P2SH > :information_source: **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning. -Now that you know the theory and practice behind P2SH addresses, you're ready to turn a non-standard Bitcoin Script into an actual transaction. We'll be reusing the simple locking script from [§7.2: Running a Bitcoin Script](07_2_Running_a_Bitcoin_Script.md), `OP_ADD 99 OP_EQUAL`. +Now that you know the theory and practice behind P2SH addresses, you're ready to turn a non-standard Bitcoin Script into an actual transaction. We'll be reusing the simple locking script from [§9.2: Running a Bitcoin Script](09_2_Running_a_Bitcoin_Script.md), `OP_ADD 99 OP_EQUAL`. ## Create a P2SH Transaction @@ -14,6 +14,12 @@ To lock a transaction with this Script, do the following: * No worries about endian conversion because it's only one byte 3. OP_EQUAL = 0x87 — a simple opcode translation 4. `` = "93016387" + +``` +$ btcc OP_ADD 99 OP_EQUAL +93016387 +``` + 2. Save `` for future reference as the `redeemScript`. 1. `` = "93016387" 3. SHA-256 and RIPEMD-160 hash the serialized script.