Commitment Transaction
The pre-signed transaction encoding a Lightning channel's current balances, replaceable until the channel closes.
Basically
You and your Lightning channel partner each hold a signed Bitcoin transaction showing your current balances. It lets either of you close the channel and protects your share of the funds.
Key Takeaways
- A commitment transaction is a pre-signed Bitcoin transaction held by each party in a Lightning channel. It records the current balance split, and either party can broadcast their version at any time to settle on-chain.
- Each side holds a different version with deliberate asymmetry. The broadcaster's own output is timelocked, while the counterparty's output is immediately spendable, enabling the revocation key penalty mechanism that punishes cheaters.
- Both parties update their commitment transactions with every payment by exchanging new signatures and revoking old states. With anchor outputs, either party can use CPFP to fee-bump the transaction after broadcast.
What Is a Commitment Transaction?
A commitment transaction is a Bitcoin transaction that spends the funding output of a Lightning Network payment channel. It encodes the current balance between two channel partners. Each partner holds their own version, pre-signed by the other party, so either side can unilaterally close the channel and settle on-chain at any time.
A commitment transaction works like a signed cheque that either party keeps in their pocket. You never need to cash it while both parties cooperate, but you always can. Every time a payment moves through the channel, both parties tear up the old cheques and write new ones reflecting the updated balances.
Commitment transactions make the Lightning Network trustless. You do not need to trust your channel partner because you always hold a valid, broadcastable Bitcoin transaction that pays you your correct share of the channel funds.
How It Works
Two parties opening a Lightning channel create a 2-of-2 multisig funding transaction on the Bitcoin blockchain. The funding output can only be spent with both parties' signatures. Commitment transactions spend this funding output and distribute the channel balance back to each party.
Asymmetric Structure
Each party holds a slightly different version of the commitment transaction. Alice's commitment transaction shows how this asymmetry works:
Bob's commitment transaction is the exact mirror. His output is timelocked and revocable by Alice, while Alice's output is immediately spendable. The broadcaster always faces a delay on their own funds, while the counterparty can claim theirs right away.
The BOLT 3 specification defines the to_local script. The script encodes both the timelock and the revocation path:
The script gives two spending paths. The local party can spend after waiting to_self_delay blocks using their delayed key, or the remote party can spend immediately using the revocation key if the commitment has been revoked.
The Update Protocol
Both parties must update their commitment transactions every time a payment moves through the channel. BOLT 2 defines the strict sequence that the protocol follows:
Both parties hold new commitment transactions reflecting the updated balance after this exchange, and the old commitments are revoked. A channel can update millions of times over its lifetime. Lightning handles this efficiently with shachain, a compact hash-based tree that stores all previous revocation secrets using only about 48 values, regardless of how many updates have occurred.
Transaction Structure
A commitment transaction follows a specific format defined in BOLT 3. The transaction uses version 2, with the locktime and sequence fields encoding an obscured commitment number. This hides the number of channel updates from on-chain observers while still allowing channel partners to identify revoked states.
A commitment transaction can contain up to six types of outputs. BOLT 3 defines these output types:
Outputs below the dust_limit_satoshis threshold are trimmed entirely, with their value added to the miner fee. The channel funder pays the commitment transaction fee, which is deducted from their output.
Why Asymmetry Matters: The Penalty Mechanism
Asymmetry solves a fundamental problem: what stops someone from broadcasting an old commitment transaction where they had a higher balance? The penalty mechanism, enforced through justice transactions, provides the answer.
A revoking party reveals a per-commitment secret when a commitment transaction is revoked. This secret, combined with the counterparty's revocation base point, allows the counterparty to derive the full revocation private key. If the revoking party later broadcasts that old commitment, the counterparty can use the revocation key to immediately sweep the cheater's timelocked output before the timelock expires.
The penalty is total: the cheater loses their entire channel balance, not just the disputed amount. This disproportionate punishment creates a strong economic disincentive against fraud. The to_self_delay parameter typically scales with channel capacity, giving larger channels longer detection windows.
Watchtowers can monitor the blockchain on behalf of offline users, detecting and responding to revoked commitment broadcasts automatically. The penalty mechanism therefore works even when a channel partner is not online. For a deeper exploration, see the watchtower deep dive.
Anchor Outputs and Fee Management
Commitment transactions are signed in advance but may be broadcast much later, when on-chain fee conditions have changed significantly. A commitment signed during low fees may be unconfirmable during a fee spike. One signed during high fees wastes money if fees drop.
Anchor outputs solve this problem by adding small outputs of 330 satoshis each. Either party can spend an anchor to attach a child-pays-for-parent fee bump. Each party gets their own anchor locked to their funding key, and after 16 blocks anyone can sweep unclaimed anchors to prevent permanent UTXO bloat.
Anchor outputs became the default for new channels across major implementations, including LND, Core Lightning and Eclair, starting in 2021. All other outputs in anchor-style channels carry a 1-block CSV lock to prevent transaction pinning attacks.
Version 3 (v3) transactions offer a newer approach that removes the need for per-party anchors entirely by using zero-fee commitment transactions with a single shared Pay-to-Anchor output instead of dual anchors. They also remove the update_fee message, which has historically caused force closes during fee spikes. The design relies on package relay and ephemeral dust support in Bitcoin Core.
HTLC Handling in Commitment Transactions
Commitment transactions include HTLC outputs when payments are in flight through a channel. These outputs represent pending payments, and each HTLC output has three spending paths:
The two-stage design ensures that HTLC resolution does not extend the required timelock across the network. The second-stage transactions also carry the same revocation mechanism, preventing cheaters from profiting through HTLC manipulation. For more on how payments route through these structures, see the payment channels deep dive.
Why It Matters
Commitment transactions are the foundation of the Lightning Network's security model. Without them, off-chain payments would require trusting your channel partner to honestly report the current balance. Your ability to unilaterally broadcast a commitment transaction at any time means you never depend on your counterparty's cooperation to recover your funds.
The design pattern extends beyond Lightning. Layer 2 protocols like Spark build on similar principles of pre-signed transactions and cryptographic enforcement to enable off-chain Bitcoin transfers with on-chain settlement guarantees. Knowledge of commitment transactions gives you a foundation for evaluating any layer 2 scaling solution.
Stale State Broadcast
A node can lose data and accidentally broadcast an old commitment transaction. The penalty applies just as if the node had cheated intentionally. Reliable backups and the option_data_loss_protect or option_static_remotekey features can mitigate this risk.
Monitoring Requirements
The penalty mechanism only works if the cheated party detects the revoked broadcast before the timelock expires. Detection requires either staying online or using a watchtower service. Users who are offline for extended periods risk losing funds to an undetected fraudulent close.
On-Chain Footprint
A broadcast commitment transaction consumes on-chain block space during a force close. Each pending HTLC in the commitment requires a separate second-stage transaction to resolve, further increasing the on-chain cost. Force closes with many pending HTLCs can be expensive during periods of high fees, so proper channel management helps minimise unnecessary force closes.
Complexity of Key Derivation
Commitment transactions use a sophisticated key derivation scheme: each state has unique keys derived from per-commitment points and base points. The scheme provides strong security guarantees but adds implementation complexity. Bugs in key derivation or secret storage can make channel closure impossible or cause missed penalty opportunities.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.