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?
Asked
Active
Viewed 136 times
1
-
By P2SH-P2WPKH transaction, you mean a transaction that has such an output, or has an input spending such an output? – Pieter Wuille Apr 08 '22 at 16:54
-
Thx, I modified the question to clarify that is a transaction with such an output – Bitcoin_1o1 Apr 08 '22 at 19:21
1 Answers
-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".
- 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
- 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