I'm learning about bitcoin, and I keep seeing arbitrary witness data and I'm confused what it really means. Like what do they mean about arbitrary, does that just mean the data can be anything you choose? I also saw this sentence somewhere: "It is arbitrary because it’s not a function of unspent transaction output." And I'm confused what they mean by UTXO? I'm still a beginner so any help would be appreciated!


1 Answer 1


What is arbitrary witness data and unspent transaction output? [...] I'm confused what they mean by UTXO


Arbitrary means what you think it does - "the data can be anything you choose". It has to be packaged in an acceptable way and there are limits on size. Part of a Bitcoin transaction input is an unlocking script, these scripts are created by the transaction creator who is spending money. There are various ways they can insert extra data into scripts that have no effect on script execution.

Witness Data

An improvement to Bitcoin called Segwit allowed some parts of transactions to be separated (segregated) into a new part called a transaction witness. This allowed the block size in Bitcoin to be increased without affecting older software and prepared for other improvements. The witness data can include scripts and those scripts can contain arbitrary data chosen by the transaction creator. This includes data that has no effect on the Bitcoin transaction itself, other than increasing its size. Some people use this to embed foreign data into the Bitcoin blockchain. This is controversial.


Bitcoin transactions have inputs and outputs, inputs are references to outputs of earlier transactions. Inputs are thus spending older outputs. An unspent transaction output is abbreviated UTXO.

These UTXOs represent units of spendable money, like coins. When you spend a UTXO it becomes a spent TXO and is no longer an unspent TXO. So every transaction effectively destroys the UTXOs in its inputs and creates new UTXOs in its outputs. The total value of outputs cannot exceed total value of inputs. Bitcoin nodes keep track of the set of all UTXOs so that they cant be spent twice.

  • Thank you that makes a lot of sense. I still don't properly understand what this sentence means: "That data is arbitrary because it is not a function of the UTXO (unspent transaction output) set. So bitcoin nodes don’t need to store it." I just don't understand where the arbitrary data is then stored.
    – mark
    Commented Jan 8 at 1:32
  • The arbitrary data is stored inside an unlocking script for an input, as a series of data-push opcodes (pushing data onto a data-stack) that can never be executed because they are inside an if false { ... } endif statement. So these unexecuted pushes never alter the stack and never affect the end-result of the script. A script which evaluates to true means the transaction succeeds and UTXOs are consumed and created. So to normal nodes, script effect is identical to a normal/standard script which lacks the if false { ... } endif. The embedded data can't affect the result & so not UTXOs. Commented Jan 8 at 14:33
  • If it isn't obvious, think of if false {...} endif as if (2+2 == 5) { ... } endif Commented Jan 8 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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