1

Can you give a simple step-by-step example on how to create a transaction with an output of P2SH-P2WPKH using bitcoin-cli on Regtest?

Bitcoin_1o1
  • 343
  • 1
  • 12

1 Answers1

-1

For this example, we will use a transaction that spends two outputs from a previous transaction. The first output (1N2) is paid to the pubkey script "P2SH-P2WPKH" and the second output (1N3) is paid to the pubkey script "P2SH".

  1. Create the first transaction that spends the two outputs from a previous transaction. In this example, the first output (1N2) is paid to the pubkey script "P2SH-P2WPKH" and the second output (1N3) is paid to the pubkey script "P2SH".

bitcoin-cli sendtoaddress 1N2 P2SH-P2WPKH bitcoin-cli sendtoaddress 1N3 P2SH

  1. Get the hex encoded transaction data for the first transaction.

bitcoin-cli gettransaction 1N2

akaBTC
  • 1
  • you might want to use markup and/or example values or otherwise somehow make it more clear what strings in your answer are variables, flags, commands, etc – Luke Mlsna Apr 20 '22 at 02:01
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Luke Mlsna Apr 20 '22 at 02:02