Post
Topic
Board Development & Technical Discussion
Re: Bitcoin Test Suite (creating a transaction which spends MAX_MONEY)
by
Chicago
on 27/07/2017, 20:27:11 UTC
Hi arubi,

    Thanks again for your support.

    Now I understand how the redeemScript is made.
    Basically, I used wif-to-public from libbitcoin-explorer on the WIF private key you provided and then derived the EC public key from the WIF private key.

Code:
./bx-linux-x64-qrcode wif-to-public cTtH93A1spUmeMV2QdPXtET8KT2w98YxDjkQJNbZbYBgKAxsTbsr
036622cf5134172ee134ea77a181aad2d544d3e084af105423779c94545f96508e

    Next, I used script-encode from libbitcoin-explorer to Base16 encode the P2PK script and came up with the same redeemScript value you provided.

Code:
./bx-linux-x64-qrcode script-encode '[036622cf5134172ee134ea77a181aad2d544d3e084af105423779c94545f96508e] checksig'
21036622cf5134172ee134ea77a181aad2d544d3e084af105423779c94545f96508eac

    How did you create the P2SH script?
wrapped that in a "pay to script hash" (p2sh) script, which is A9148F121357DC6D9130F3A19B3EDD965998B6B23E5687

    How would I turn the redeemScript into the scriptPubKey?
    Which tools did you use to wrap the redeemScript in a P2SH script?

    I was looking at the libbitcoin-explorer usage but didn't stumble on the answer by myself.

Best Regards,
-Chicago