Well, first I generated a random private key
cTtH93A1spUmeMV2QdPXtET8KT2w98YxDjkQJNbZbYBgKAxsTbsr, then got the public key from it which is
036622CF5134172EE134EA77A181AAD2D544D3E084AF105423779C94545F96508E.
I created a "pay to pubkey" (p2pk) script using it, which is
21036622CF5134172EE134EA77A181AAD2D544D3E084AF105423779C94545F96508EAC, and wrapped that in a "pay to script hash" (p2sh) script, which is
A9148F121357DC6D9130F3A19B3EDD965998B6B23E5687.
The p2pk script is then the redeemscript and money (the 21 million btc) is sent to that p2sh script, which is the scriptpubkey.
The txid for the input transaction, the one that paid 21 million btc to the p2sh script, is chosen to be
0000000000000000000000000000000000000000000000000000000000000100 . In reality, you can't choose value that but for this test this is what is used.
To redeem that input, I need to provide the redeemscript for the p2sh scriptpubkey, and since that redeemscript is actually a p2pk script, I also need to provide the private key for signage.
To read about scripts like p2pk, p2sh and more, this might be a good reference:
https://bitcoin.org/en/developer-guide#term-output .
You could use Core to generate everything from the private key to the p2sh script by using commands like
getnewaddress,
dumpprivkey,
importaddress...
I recommend using testnet or regtest locally to play around with it
* For example, you could run:
bitcoin-cli -testnet decodescript 21036622CF5134172EE134EA77A181AAD2D544D3E084AF105423779C94545F96508EACAnd see what that script actually says, which is just "do a checksig operation with this pubkey".