How to create the data parameter for a PSBT?

0

I am sure this is a dumb question but if using:

bitcoin-cli walletcreatefundedpsbt "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]"

How do you create the data parameter? Where does it come from?

\"00010203\"

Edit:

I should have read the BIP first, it looks like it is an unsigned tx. So in order to create a PSBT you need to first create an unsigned tx? And include the hex as an argument.

Fontaine

Posted 2019-05-28T09:19:58.583

Reputation: 158

Answers

0

A PSBT contains an unsigned transaction that has all of the inputs and output that you want. The other data PSBT allows for are put in around that unsigned transaction.

Here, data just means that the unsigned transaction will have an output that has an OP_RETURN followed by whatever data you want. This directly reflects what createrawtransaction. data is not specific to PSBT nor is it necessary.

Andrew Chow

Posted 2019-05-28T09:19:58.583

Reputation: 40 910

Thanks again Andrew, and thanks for your great contributions.Fontaine 2019-05-28T16:58:47.727