LearnBitcoin

Glossary

Input (Transaction Input)

A reference to a specific UTXO being spent, including a signature unlocking those funds.

A transaction input is a pointer to a UTXO being spent, plus the proof that the spender is allowed to spend it.

Each input references the UTXO by its source txid (the transaction that created it) and output index (which output of that transaction). It also carries unlocking data that satisfies the UTXO's locking script: a signature script (scriptSig) for legacy outputs, or witness data for SegWit outputs, which moved the signature and public key out of the scriptSig and into the witness. A third field, the sequence number, is normally left at its default but can encode a relative time lock.

A single transaction can have many inputs. Spending three UTXOs in one transaction means three inputs, each needing to satisfy its own locking script. If any one input fails to validate, the entire transaction is rejected by every node - inputs are atomic with the transaction containing them.

Once a transaction confirms, every input it referenced is permanently consumed. Trying to reuse an already-spent UTXO is what makes a double spend attempt; a node checks that every referenced output still exists and is unspent before it bothers verifying any signatures, and rejects the transaction if not.

The one exception to all of this is the coinbase transaction that starts each block. Its single input points at no previous output at all (an all-zero txid and an index of all ones), because the block subsidy and fees it pays out are created by the block itself rather than spent from the chain.

Key takeaways

  • Identifies which UTXO is being spent
  • Must contain valid signature/witness data
  • Multiple inputs can fund one transaction

Sources (6)

Related terms (7)

Published . Revised . No corrections logged for this page.

Edit this page on GitHub