From a20cbd53f2f073104512ef530dcce01bca4ca172 Mon Sep 17 00:00:00 2001 From: Abu Shifrah <35174370+muaawiyahtucker@users.noreply.github.com> Date: Wed, 23 Apr 2025 23:06:14 +0300 Subject: [PATCH] Corrections p2sh-exercise-2.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original redeem script had some errors in it. Check it on ‘LearnMeABitcoin’. I’ve put a working one. Also, the address for the redeem script is not a valid one, its just one that your demo-ripemd160 gives --- decoding/p2sh-exercise-2.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decoding/p2sh-exercise-2.mdx b/decoding/p2sh-exercise-2.mdx index f1877b2..5269ed3 100644 --- a/decoding/p2sh-exercise-2.mdx +++ b/decoding/p2sh-exercise-2.mdx @@ -177,12 +177,12 @@ Your task is to implement the `generateP2SHAddress` and `hexToASM` functions in - For push data operations, extract the correct number of bytes as a hex string. - Join the parsed elements with spaces. -Test your implementation with this redeem script: `5221031e71524a170c87855f7e9bd3b212a0a3e28e3c91c19f24a9a0d9e251e5ffe1321031e71524a170c87855f7e9bd3b212a0a3e28e3c91c19f24a9a0d9e251e5ffe1352ae` +Test your implementation with this redeem script: `5121022afc20bf379bc96a2f4e9e63ffceb8652b2b6a097f63fbee6ecec2a49a48010e2103a767c7221e9f15f870f1ad9311f5ab937d79fcaeee15bb2c722bca515581b4c052ae` Expected results: -- P2SH Address: `3PRx8wvqghQB1S8xGpFBmcVjN5fxGvpjLE` -- ASM: `OP_2 031e71524a170c87855f7e9bd3b212a0a3e28e3c91c19f24a9a0d9e251e5ffe13 031e71524a170c87855f7e9bd3b212a0a3e28e3c91c19f24a9a0d9e251e5ffe13 OP_2 OP_CHECKMULTISIG` +- P2SH Address: `3QwJXQQu82a9jErSkTJxX3a1TABmvCqbae` +- ASM: `OP_1 OP_PUSHBYTES_33 022afc20bf379bc96a2f4e9e63ffceb8652b2b6a097f63fbee6ecec2a49a48010e OP_PUSHBYTES_33 03a767c7221e9f15f870f1ad9311f5ab937d79fcaeee15bb2c722bca515581b4c0 OP_2 OP_CHECKMULTISIG` This script represents a 2-of-2 multisig P2SH address.