TeachMeBitcoin

Transaction Input Anatomy

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

The Anatomy of a Transaction Input

In the Bitcoin network, you don't "send" money from a balance. Instead, you unlock existing chunks of bitcoin and assign them to new owners. These unlocked chunks are called Inputs.

1. What is a Transaction Input?

A transaction input is a data structure that points to a specific Unspent Transaction Output (UTXO) and provides the cryptographic proof (the signature) required to spend it.

2. Input Components

Every transaction input consists of four primary fields:

  1. TXID: A 32-byte hash of the previous transaction.

  2. VOUT: A 4-byte index identifying which specific output in that transaction is being spent.

  3. ScriptSig: The "Unlocking Script" containing the digital signature and public key.

  4. Sequence: A 4-byte field used for timelocks and Replace-By-Fee (RBF).

3. The Unlocking Mechanism

Think of an input as a key. The previous transaction placed a "lock" (the ScriptPubKey) on some bitcoin. Your input provides the "key" (the ScriptSig) that matches that lock. If the math checks out, the bitcoin is released to be spent in the new transaction's outputs.

4. Inputs vs. Outputs

A transaction can have many inputs and many outputs.

Field Size Purpose
Previous TXID 32 Bytes Pointer to the source transaction.
VOUT Index 4 Bytes Pointer to the specific output.
ScriptSig VarLen The cryptographic proof.
Sequence 4 Bytes Consensus features (Locktime/RBF).

In the next section, we will look closer at the OutPoint—the combination of TXID and VOUT.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!