Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Transaction Output (TxOut)

A Transaction Output (TxOut) is a component of a blockchain transaction in the UTXO model that creates a new spendable output, specifying an amount of cryptocurrency and a locking script (ScriptPubKey) that defines the conditions for spending it.
Chainscore © 2026
definition
BLOCKCHAIN DATA STRUCTURE

What is Transaction Output (TxOut)?

A Transaction Output (TxOut) is a fundamental data structure in a blockchain transaction that specifies the destination and amount of value being transferred.

A Transaction Output (TxOut) is a data structure within a blockchain transaction that defines the recipient and quantity of a cryptocurrency transfer. It contains two primary fields: a value (the amount of the native asset, e.g., satoshis in Bitcoin) and a locking script (often called scriptPubKey), which is a set of conditions that must be met to spend the value in the future. Conceptually, a TxOut creates an unspent output, which can later serve as an input to a new transaction. The complete set of all unspent transaction outputs across the network is known as the UTXO set, which represents the total spendable state of the blockchain.

The locking script within a TxOut is crucial for security and programmability. In Bitcoin, this script is typically a Pay-to-Public-Key-Hash (P2PKH) or Pay-to-Script-Hash (P2SH) construct that encumbers the funds with a cryptographic puzzle. To spend the output, a future transaction must provide a corresponding unlocking script (or scriptSig) that satisfies the conditions—most commonly by proving ownership of the private key associated with the public key hash. This model, where transactions chain together by consuming previous outputs, is the basis of the UTXO model, used by Bitcoin, Litecoin, and many others.

Transaction outputs are inherently discrete and immutable. Once created in a confirmed block, a TxOut cannot be altered. It exists as a single, indivisible unit; if a user wishes to spend only a portion of its value, the entire output must be consumed, and new outputs must be created for both the payment and any change returned to the sender. This is a key difference from the account-based model (used by Ethereum), where balances are stored as mutable state variables. The UTXO model offers advantages in parallel transaction verification and enhanced privacy through coin selection algorithms.

From a developer's perspective, analyzing TxOut data is essential for wallet balance calculation, constructing new transactions, and auditing the blockchain. A wallet scans the UTXO set to find outputs locked to addresses it controls, sums their values to determine the spendable balance, and selects specific outputs as inputs for a new payment. This process, known as coin selection, can optimize for fees, privacy, or efficiency. Understanding TxOuts is therefore fundamental to building applications that interact with UTXO-based blockchains.

how-it-works
BLOCKCHAIN MECHANICS

How a Transaction Output (TxOut) Works

A Transaction Output (TxOut) is a fundamental data structure in blockchain transactions that defines the destination and amount of a cryptocurrency transfer, acting as a spendable 'check' or 'voucher' for future use.

A Transaction Output (TxOut) is a data structure within a blockchain transaction that specifies the recipient and the amount of cryptocurrency being sent. It consists of two primary components: a value field denoting the amount in satoshis (for Bitcoin) or wei (for Ethereum), and a locking script (often called scriptPubKey). This locking script defines the conditions that must be met to spend the funds in the future, typically requiring a cryptographic signature from the holder of the corresponding private key. In essence, a TxOut creates a new, unspent chunk of value on the blockchain, waiting to be claimed.

The locking script within a TxOut is crucial for security and functionality. In Bitcoin, this is most commonly a Pay-to-Public-Key-Hash (P2PKH) script, which locks funds to a specific Bitcoin address. More advanced scripts enable complex conditions, such as multi-signature requirements (multisig), timelocks, or custom logic as seen in smart contracts. A TxOut is considered an Unspent Transaction Output (UTXO) until it is referenced as an input in a subsequent transaction. The UTXO model, used by Bitcoin and others, treats these outputs as discrete, immutable objects that are either fully spent or completely unspent.

To spend a TxOut, a later transaction must reference it as a Transaction Input (TxIn). This input provides an unlocking script (or scriptSig) that satisfies the conditions set by the original TxOut's locking script. For a standard P2PKH output, this means providing a digital signature and the corresponding public key. The network's nodes validate this by executing the combined scripts. If the result is TRUE, the output is considered spent, and new TxOuts are created for the payment and any change. This chain of linked inputs and outputs forms the entire history of fund movement on a UTXO-based blockchain.

key-features
BITCOIN & UTXO BLOCKCHAINS

Key Features of a Transaction Output

A Transaction Output (TxOut) is a fundamental data structure that defines a spending condition and a value. It represents the 'to' part of a transaction, specifying where value is sent and how it can be spent in the future.

01

Value (Amount)

The value field specifies the amount of the native cryptocurrency (e.g., satoshis in Bitcoin) locked in the output. This is the fundamental unit of account transferred. The sum of all input values must equal or exceed the sum of all output values, with the difference being the transaction fee paid to miners.

  • Example: An output with a value of 100,000,000 satoshis represents 1 Bitcoin.
02

Locking Script (scriptPubKey)

The locking script, also called scriptPubKey, is a set of cryptographic conditions that must be satisfied to spend the output. It defines the 'who' and 'how' of future spending. Common types include:

  • Pay-to-Public-Key-Hash (P2PKH): Locks funds to a Bitcoin address.
  • Pay-to-Script-Hash (P2SH): Locks funds to the hash of a redeem script, enabling multisig.
  • Pay-to-Witness-Public-Key-Hash (P2WPKH): The SegWit version of P2PKH.
03

Unspent Transaction Output (UTXO)

When a TxOut is created and not yet referenced as an input in a subsequent transaction, it becomes an Unspent Transaction Output (UTXO). The set of all UTXOs across the network represents the total spendable supply of the cryptocurrency. A node's UTXO set is a critical database it must maintain to validate new transactions, checking that inputs reference valid, unspent outputs.

04

Spending (as a Transaction Input)

To spend the value in a TxOut, a later transaction must reference it as an input. The input provides a unlocking script (scriptSig or witness data) that, when combined with the output's locking script, executes successfully. This process proves ownership and authorization. Once spent, the original TxOut is removed from the UTXO set and cannot be spent again, preventing double-spending.

05

Change Output

A change output is a special TxOut sent back to the spender. Because UTXOs are indivisible, a transaction often uses inputs whose total value exceeds the desired payment amount. The leftover value (minus the fee) is sent to a new output controlled by the sender. This is not a 'refund' but a fundamental mechanic of the UTXO model for managing wallet balances.

06

Data Carrying (OP_RETURN)

Outputs can be used to embed arbitrary data on-chain using OP_RETURN. These are provably unspendable outputs, meaning their value (often zero) is permanently burned. They serve as a consensus-safe method for timestamping or anchoring data (e.g., document hashes, asset metadata) without bloating the UTXO set. Their data payload is typically limited (e.g., 80 bytes in Bitcoin).

anatomy
BLOCKCHAIN FUNDAMENTALS

Anatomy of a TxOut

A detailed breakdown of the Transaction Output, the fundamental data structure that defines ownership and spending conditions for digital assets in a blockchain transaction.

A Transaction Output (TxOut) is a data structure within a blockchain transaction that specifies the recipient and conditions for spending a specific amount of cryptocurrency. It is a core component of the Unspent Transaction Output (UTXO) model, acting as a discrete, indivisible packet of value. Each TxOut contains two primary fields: a value (the amount of the native asset, e.g., satoshis) and a locking script (often called scriptPubKey), which defines the cryptographic conditions that must be met to spend this output in a future transaction.

The locking script is the critical security and programmability element of a TxOut. In Bitcoin, this is a script written in a stack-based language that typically requires a digital signature corresponding to a public key hash (P2PKH) or a script hash (P2SH, P2WSH). In Ethereum and other account-based chains, the analogous concept is the recipient's account address. This script acts as a cryptographically-secured lockbox; only a subsequent transaction that provides a valid unlocking script (scriptSig or witness data) satisfying these conditions can reference this TxOut as an input, thereby "unlocking" and spending its value.

When a transaction is confirmed, its outputs become new UTXOs, added to the global set of spendable funds. A key rule is that a UTXO must be spent in its entirety. If the value of a TxOut is greater than needed, the transaction must create a second output, often sending the "change" back to the spender's own wallet. This model provides strong transactional privacy and parallelism but differs fundamentally from the account/balance model used by platforms like Ethereum, where state is maintained in continuously updated account balances.

ecosystem-usage
TRANSACTION OUTPUT (TXOUT)

Ecosystem Usage: UTXO Blockchains

A Transaction Output (TxOut) is a fundamental data structure in UTXO-based blockchains that defines a spendable amount of cryptocurrency and the conditions required to unlock it. This section explores its practical applications and role in the ecosystem.

01

Core Data Structure

A TxOut is a record within a transaction containing two primary fields:

  • Value: The amount of the native cryptocurrency (e.g., satoshis) assigned to the output.
  • Locking Script (scriptPubKey): A script, typically containing a public key hash or other conditions, that defines the cryptographic proof required to spend this output in the future.

Every unspent transaction output (UTXO) in the network's state is, by definition, a TxOut waiting to be referenced as an input.

02

Unspent Transaction Output (UTXO)

The UTXO model represents a blockchain's state as a set of all unspent TxOuts. When a user's "balance" is calculated, a wallet doesn't store a number; it scans the blockchain for all UTXOs locked to the user's keys and sums their values.

Key characteristics:

  • Atomic: Each UTXO is spent in its entirety; creating "change" requires a new TxOut.
  • Immutable History: A UTXO's entire provenance chain, from coinbase generation to current holder, is cryptographically verifiable.
03

Scripting & Smart Contracts

The locking script enables basic smart contract functionality. Beyond simple Pay-to-Public-Key-Hash (P2PKH), complex conditions can be encoded, such as:

  • Multisignature (Multisig): Requiring M-of-N signatures.
  • Timelocks: Using OP_CHECKLOCKTIMEVERIFY to prevent spending until a future time or block.
  • Pay-to-Script-Hash (P2SH): The locking script commits to a redeem script's hash, allowing for more complex, reusable conditions.

These scripts define the spending logic for the associated value.

04

Transaction Lifecycle

A TxOut's lifecycle drives transaction construction:

  1. Creation: A transaction creates new TxOuts as payments and change.
  2. Propagation: The transaction is broadcast, and nodes validate it, ensuring referenced inputs are valid UTXOs.
  3. Confirmation: Miners include the transaction in a block, marking its inputs as spent and its outputs as new UTXOs.
  4. Spending: A future transaction references this new UTXO's transaction ID (txid) and output index (vout) as an input, providing a valid unlocking script.
05

Privacy & Analysis

The UTXO model has distinct privacy and analysis implications:

  • CoinJoin: Multiple users combine transactions, creating outputs that are difficult to cluster to a single entity.
  • UTXO Management: Wallets use strategies like Coin Control to select specific UTXOs, affecting privacy and fee optimization.
  • Chain Analysis: Firms track the graph of linked UTXOs to infer ownership, a process complicated by techniques that break the common-input-ownership heuristic.
06

Comparison to Account Model

Contrasting UTXO (Bitcoin, Cardano) with the Account Model (Ethereum, Solana):

AspectUTXO ModelAccount Model
StateSet of independent coins (UTXOs)Global ledger of account balances & storage
ParallelismHigh - independent UTXOs can be processed concurrentlyLower - transactions often modify shared state
Complex StateChallenging; requires auxiliary layersNative via contract storage
Light Client ProofsEfficient via Merkle proofs for specific UTXOsMore complex, requiring state proofs
BLOCKCHAIN STATE MODELS

TxOut/UTXO Model vs. Account-Based Model

A comparison of the two primary models for tracking ownership and state in blockchain systems.

FeatureUTXO Model (e.g., Bitcoin)Account-Based Model (e.g., Ethereum)

Fundamental Unit

Unspent Transaction Output (UTXO)

Account Balance

State Tracking

Set of all unspent outputs (UTXO set)

Global state of account balances & smart contract storage

Transaction Logic

Specifies which previous outputs are spent and creates new outputs

Specifies sender, recipient, value, and triggers state transitions

Parallelizability

High (independent UTXOs can be processed concurrently)

Lower (sequential execution often required for account nonce & state)

Privacy (Native)

Pseudonymous; can use new addresses per output

Pseudonymous; address reuse is common

State Bloat Mitigation

Pruning of spent TXOs is straightforward

Requires state expiry or archival schemes

Transaction Proof

Proof of inclusion for a specific UTXO

Proof of current account state (e.g., via a state root)

Smart Contract Complexity

Limited; logic is typically in the spending conditions (Script)

Native; stateful logic is executed directly by the VM

BLOCKCHAIN FUNDAMENTALS

Technical Details & Mechanics

This section details the core components that make up a blockchain transaction, focusing on the structure and function of transaction outputs (TxOut).

A Transaction Output (TxOut) is a data structure in a blockchain transaction that defines the amount of cryptocurrency being sent and the conditions that must be met to spend it in the future. It is one of the two fundamental components of a transaction, the other being the Transaction Input (TxIn). Each TxOut specifies a value (e.g., 0.05 BTC) and a locking script, often called a scriptPubKey, which encumbers the funds with a cryptographic puzzle. Only a subsequent transaction that provides a valid unlocking script (scriptSig) solving this puzzle can reference this output as an input, thereby spending the funds. Unspent Transaction Outputs (UTXOs) collectively represent the entire spendable balance on a UTXO-based blockchain like Bitcoin.

TRANSACTION OUTPUT (TXOUT)

Common Misconceptions

Transaction Outputs (TxOuts) are fundamental data structures in UTXO-based blockchains like Bitcoin, yet they are often misunderstood. This section clarifies the most frequent points of confusion regarding their purpose, mechanics, and relationship to wallet balances.

A Transaction Output (TxOut) is not a coin in the physical sense, but a discrete, cryptographically locked unit of value on a blockchain. It is a data structure that specifies an amount of the native asset (e.g., satoshis) and the conditions (a locking script or scriptPubKey) that must be met to spend it. Unlike an account balance, a TxOut is an immutable, individual "chunk" of value created in a transaction and only consumed once by a subsequent transaction's input. The analogy of a "coin" is helpful but can obscure its true nature as a script-locked data record.

TRANSACTION OUTPUT

Frequently Asked Questions (FAQ)

A Transaction Output (TxOut) is a fundamental data structure that defines where value is sent and the conditions for spending it. These questions address its core mechanics and role in blockchain systems.

A Transaction Output (TxOut) is a data structure within a transaction that specifies an amount of cryptocurrency to be sent and the cryptographic condition, or locking script, that must be satisfied to spend it in the future. It is one of the two primary components of a transaction, the other being the Transaction Input (TxIn). An output essentially creates an unspent chunk of value, known as an Unspent Transaction Output (UTXO), which can later be referenced as an input in a new transaction. This model is central to the UTXO-based accounting used by protocols like Bitcoin, Litecoin, and Cardano. Each output is immutable once recorded on the blockchain.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Transaction Output (TxOut) - Blockchain Glossary | ChainScore Glossary