2

Assume that I want to store some arbitrary data on the Bitcoin blockchain via a single transaction.

Question: Is there any upper bound on the size of data I want to send via a single transaction?

--

Edit: I need to know how much "arbitrary data" I can store in the blockchain via a single transaction. Is there any upper bound on the field of the transaction that allows "some arbitrary data" to be stored in it?

user153465
  • 291
  • 1
  • 10
  • @RaghavSood Thanks for the link provided. The main difference, here is that I need to know how much "arbitrary data" in the transaction data field I can send to the blockchain. – user153465 Oct 05 '18 at 11:51
  • 1
    @user153465 https://bitcoin.stackexchange.com/q/78572/60443 – JBaczuk Oct 05 '18 at 12:13
  • https://bitcoin.stackexchange.com/questions/29554/explanation-of-what-an-op-return-transaction-looks-like – user153465 Oct 05 '18 at 12:29
  • as comment, cause answer section is already closed... I think it is only a duplicate, if within the idea of "OP_RETURN". But the original post didn't ask explicitly for OP_RETURN. Just how to put arbitrary data into the blockchain. One could think of creating a P2SH transaction, which has a script limit of 520 Bytes, and the tx would have many inputs/outputs, up to tx maxsize (https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages). – pebwindkraft Oct 07 '18 at 18:13

1 Answers1

1

Typically people will store arbitrary data in a separate output in a transaction beginning with OP_RETURN.

Any output with this OP code will be considered invalid or provably unspendable, but will still exist as part of the blockchain.

As mentioned in this thread Bitcoin-core options will allow for up to 80 bytes of arbitrary data by default. It is worth noting that 80 bytes is simply a default value. Nodes can change the -datacarriersize parameter to manually adjust the limit for the acceptance of larger or smaller amounts of data. For example, this transaction is 1155 bytes with 983 bytes of arbitrary data and has still been validated into the network.

The history of the default value is actually quite interesting and has been switched around a few times throughout Bitcoin's existance.

Mason Ticehurst
  • 1,014
  • 1
  • 10
  • 24