Transaction Input Anatomy
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:
-
TXID: A 32-byte hash of the previous transaction.
-
VOUT: A 4-byte index identifying which specific output in that transaction is being spent.
-
ScriptSig: The "Unlocking Script" containing the digital signature and public key.
-
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.
-
Total Input Value: The sum of all UTXOs being unlocked.
-
Total Output Value: The sum of all new UTXOs being created.
-
The difference between the two is the Transaction Fee paid to the miner.
| 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.
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: