Glossary

Breach Remedy Transaction

A breach remedy transaction penalizes a cheating Lightning channel peer by sweeping all channel funds to the honest party.

Key Takeaways

  • A breach remedy transaction (also called a justice transaction or penalty transaction) lets an honest Lightning channel participant sweep the entire channel balance when their counterparty broadcasts a revoked commitment transaction.
  • The mechanism relies on revocation keys exchanged during each channel state update: when a peer publishes an old state, the counterparty uses the corresponding revocation secret to construct a transaction that claims all outputs before the cheater can spend them.
  • Because detecting a breach requires monitoring the blockchain, users who go offline delegate this responsibility to watchtowers that can broadcast the breach remedy transaction on their behalf.

What Is a Breach Remedy Transaction?

A breach remedy transaction is the enforcement mechanism that keeps Lightning channels honest. Every time two parties update their channel balance, they exchange revocation secrets for the previous state. If one party later attempts to cheat by broadcasting that old, revoked state to the Bitcoin blockchain, the counterparty can use those secrets to construct a breach remedy transaction that sweeps every output in the channel to themselves.

The penalty is deliberately severe: the cheater loses their entire channel balance, not just the amount they tried to steal. This all-or-nothing design creates a strong economic disincentive against broadcasting outdated states, even when the potential gain from cheating would be small. From the Bitcoin network's perspective, a breach remedy transaction is a standard transaction: there is no special transaction type for penalties at the protocol level.

The concept originates from the Poon-Dryja channel construction described in the original Lightning Network whitepaper. It is specified in BOLT 5, which defines how nodes handle on-chain resolution of channel states.

How It Works

Understanding breach remedy transactions requires knowing how Lightning commitment transactions are structured and revoked.

Commitment Transaction Asymmetry

Each party in a Lightning channel holds their own version of the current commitment transaction. These versions are asymmetric by design:

  • The to_local output pays the broadcaster their own balance, but it is locked behind a timelock (to_self_delay, typically 144 to 2016 blocks). This output also contains a revocation path that the counterparty can spend immediately if they possess the revocation key.
  • The to_remote output pays the counterparty their balance and is spendable immediately with no delay.
  • Any pending HTLC outputs also include revocation paths.

This asymmetry is the foundation of the penalty mechanism. The broadcaster must wait before claiming their own funds, giving the counterparty a window to detect the breach and respond.

The Revocation Exchange

Each time the channel state advances (a payment is made, forwarded, or settled), the following steps occur:

  1. Both parties sign a new commitment transaction reflecting the updated balances
  2. Each party sends a revoke_and_ack message containing the per-commitment secret for the now-outdated previous state
  3. The counterparty combines this secret with their own key material to derive the revocation key for that old commitment
  4. Both parties store the accumulated revocation secrets (one per revoked state) for the lifetime of the channel

After this exchange, publishing the old commitment is dangerous: the counterparty now holds the key to sweep everything.

Constructing the Breach Remedy

When the honest party detects a revoked commitment on-chain, they construct a breach remedy transaction that spends all outputs using the revocation paths:

  1. Identify the revoked commitment transaction by matching its structure against stored revocation data
  2. Derive the revocation private key from the per-commitment secret and the counterparty's base point
  3. Create a transaction spending the to_local output via the revocation branch (bypassing the timelock)
  4. Spend any HTLC outputs using their revocation paths
  5. Broadcast this sweep transaction before the cheater's timelock expires

The to_local Script

The to_local output uses a script with two spending paths. The revocation branch allows immediate spending by the counterparty, while the delayed branch enforces the timelock for the broadcaster:

OP_IF
    <revocationpubkey>
OP_ELSE
    <to_self_delay>
    OP_CHECKSEQUENCEVERIFY
    OP_DROP
    <local_delayedpubkey>
OP_ENDIF
OP_CHECKSIG

In a breach scenario, the honest party takes the OP_IF branch, signing with the derived revocation key to claim the output immediately. The cheater cannot take the OP_ELSE branch until the CSV delay expires, giving the honest party a comfortable window to act.

Role of Watchtowers

The breach remedy mechanism has a critical dependency: the honest party must be online to detect the revoked commitment and respond before the timelock expires. For mobile wallet users or nodes with intermittent connectivity, this creates a vulnerability.

Watchtowers solve this by monitoring the blockchain on behalf of offline users. The typical watchtower flow works as follows:

  1. After each state update, the client sends the watchtower a hint (a partial transaction hash) and an encrypted blob containing the pre-signed justice transaction data
  2. The watchtower watches the blockchain for transactions matching the hint
  3. If a match appears, the watchtower derives the decryption key from the full commitment transaction hash, decrypts the justice data, and broadcasts the breach remedy transaction
  4. The watchtower typically earns a small reward from the swept funds for its service

This design preserves privacy: the watchtower cannot read the encrypted data until a breach actually occurs. The protocol for watchtower communication is described in BOLT 13 (draft). For a deeper look at how watchtowers protect channels, see the Lightning watchtowers explainer.

Use Cases

Deterrence Against Cheating

The primary purpose of breach remedy transactions is deterrence. By making the penalty so severe (loss of the entire channel balance), the protocol ensures that rational actors never attempt to broadcast an old state. Research by BitMEX identified approximately 241 potential breach attempts between November 2017 and June 2019, with roughly 2.22 BTC (~$24,000 at the time) claimed through justice transactions across the network. The low number of breaches relative to total channel volume suggests the deterrent works.

Channel Security for Offline Nodes

Combined with watchtowers, breach remedy transactions enable users to safely go offline without risking channel theft. This is essential for mobile Lightning wallets and low-uptime nodes that cannot monitor the blockchain around the clock.

Routing Node Protection

Routing nodes that forward payments across the Lightning Network maintain many channels simultaneously. The breach remedy mechanism protects them against any individual channel partner attempting to settle at an outdated balance. Because routing nodes process many state updates, they accumulate large sets of revocation secrets and must store them reliably.

Risks and Considerations

Storage Burden

Every revoked state requires the honest party to store the corresponding revocation secret indefinitely. A channel with thousands of state updates accumulates thousands of secrets. While each secret is small (32 bytes), the obligation to retain them for the lifetime of the channel adds operational complexity. Losing this data means losing the ability to punish a future breach.

Time Sensitivity

The honest party must broadcast the breach remedy transaction before the cheater's timelock expires. If the to_self_delay is set to 144 blocks (approximately 24 hours) and the honest party fails to respond in time, the cheater can claim their output and the penalty opportunity is lost. High on-chain fee environments can make timely broadcast more expensive and uncertain.

Fee Considerations

The breach remedy transaction must pay sufficient on-chain fees to confirm before the timelock expires. With anchor outputs, the honest party can fee-bump the justice transaction using CPFP. Without anchors, the pre-signed justice transaction may have an inadequate fee rate if network conditions have changed since it was constructed.

Toxic Waste Problem

Old channel states are sometimes called "toxic waste" because accidentally restoring a node from an old backup could cause it to broadcast a revoked commitment, triggering a penalty against itself. This makes Lightning channel backups fundamentally different from typical database backups: restoring stale state can result in total loss of channel funds. Static channel backups (SCBs) address this by storing only the information needed for a force close from the latest state rather than replaying old states.

LN-Symmetry as an Alternative

The LN-Symmetry (eltoo) proposal offers a fundamentally different approach. Instead of punishing old states, it allows any later state to replace an earlier one on-chain without a penalty. This eliminates the toxic waste problem, removes the need to store every revocation secret, and simplifies multi-party channel constructions like channel factories. However, LN-Symmetry requires a Bitcoin consensus change (BIP 118, SIGHASH_ANYPREVOUT) that has not been activated on mainnet. Development continues on the Inquisition signet, but the penalty-based model remains the only production mechanism for channel enforcement.

Breach Remedies and Layer 2 Design

The breach remedy model highlights a core tradeoff in Layer 2 protocol design: security through punishment versus security through state replacement. Lightning's penalty approach provides strong deterrence but requires constant vigilance, reliable storage, and timely on-chain responses. Alternative Layer 2 designs, such as Spark, avoid this tradeoff entirely by using statechain transfers that do not rely on broadcasting old states or monitoring for breaches.

This 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.