5

How can I use tx-extra to store something in it?

For example with simplewallet.

Any help with this would be Greatly appreciated!

Thanks in advance!

0

Well, payment id is stored in the TX extra field, so the easiest way would be to encode something in hex and put it as a payment id. See these two posts for a little more information:

How are the various tx-extra types/formats used?

Why is the payment ID specified on a per TX basis?

It looks like you are unable to put arbitrary data in there (TX won't validate in your wallet, peers won't propagate it, miners won't mine it), unless you modify the source code and mine the block yourself I think. See here:

As a miner how would I put data in the 'extra' field?

I'm not 100% about that though, so you could just try putting arbitrary data or even just a much longer hex string as your payment id and see if the TX goes through.

  • 1
    As long as the user pays a high enough fee, transactions with arbitrary tx_extra data will be mined by other miners. You do not need to mine the transaction yourself. – sgp Jan 27 at 18:13
1

How can I use tx-extra to store something in it?

You can store whatever you like in it.

For example with simplewallet.

You can use simplewallet by setting the data as the payment ID parameter. It's down to the wallet implementation how much data you can set in this field however.

Ultimately, any data can be set, of any format and size, in the tx_extra field. The transaction however will only be mined if the fee covers the overall block weight (assuming all other tx validation is passed).

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.