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?

2
  • By P2SH-P2WPKH transaction, you mean a transaction that has such an output, or has an input spending such an output? Apr 8 at 16:54
  • Thx, I modified the question to clarify that is a transaction with such an output Apr 8 at 19:21

1 Answer 1

-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

2
  • 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 at 2: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.
    – Luke Mlsna
    Apr 20 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.