Skip to main content

Transaction | Bitcoin Glossary | Mapping Bitcoin

Transaction

Protocol

Also known as: tx, Bitcoin transaction

A signed data structure that transfers bitcoin from one or more inputs to one or more outputs. Transactions reference previous UTXOs, include scripts or witness data proving authorization, and are broadcast to the network for inclusion in a block.

Overview

A transaction is the fundamental mechanism for transferring value on the Bitcoin network. Every bitcoin movement — from simple payments to complex multi-party contracts — is expressed as a transaction. A transaction consumes one or more existing UTXOs as inputs and creates one or more new UTXOs as outputs, with the difference between total inputs and total outputs constituting the transaction fee.

Transaction Structure

Transaction
┌──────────────────────────────────────────┐
│ Version: 2                               │
├──────────────────────────────────────────┤
│ Inputs:                                  │
│  ┌────────────────────────────────────┐  │
│  │ Previous TXID + Output Index      │  │
│  │ ScriptSig / Witness (proof)       │  │
│  │ Sequence Number                   │  │
│  └────────────────────────────────────┘  │
│  (one or more inputs)                    │
├──────────────────────────────────────────┤
│ Outputs:                                 │
│  ┌────────────────────────────────────┐  │
│  │ Value (in satoshis)               │  │
│  │ ScriptPubKey (locking script)     │  │
│  └────────────────────────────────────┘  │
│  (one or more outputs)                   │
├──────────────────────────────────────────┤
│ Locktime                                 │
└──────────────────────────────────────────┘

Transaction Lifecycle

  1. Construction: The sender's wallet selects UTXOs to spend as inputs and defines outputs (recipient address and amount, plus change).
  2. Signing: The wallet signs each input with the appropriate private key, satisfying the spending conditions.
  3. Broadcasting: The signed transaction is sent to connected nodes on the peer-to-peer network.
  4. Mempool: Nodes validate the transaction and place it in their mempool, waiting for inclusion in a block.
  5. Confirmation: A miner includes the transaction in a block, and it receives its first confirmation.

Transaction Types

  • Standard (P2PKH, P2SH, P2WPKH, P2WSH, P2TR): Common payment formats recognized by default relay policies.
  • Coinbase: A special transaction in each block that creates new bitcoin as the block reward.
  • Sweep: Consolidates all UTXOs to a single output.
  • Batched: Combines multiple payments into a single transaction to save on fees.

Identification

Each transaction is identified by its Transaction ID (TXID), a unique 256-bit hash derived from the transaction data. In SegWit transactions, the TXID excludes witness data, solving the transaction malleability problem.