---
title: "Justice Transaction — definition | Nuri Glossary"
description: "A transaction that takes everything from a peer who broadcast an old channel state, which is how Lightning discourages cheating."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/justice-transaction"
---

# Justice Transaction

A transaction that takes everything from a peer who broadcast an old channel state, which is how Lightning discourages cheating.

## Basically

A justice transaction takes all the money from a Lightning channel if your channel partner tries to cheat. It punishes cheating and helps keep your funds safe.

## Key Takeaways

- Justice transactions punish cheating. If someone broadcasts an old, revoked channel state to steal funds, the honest party can use a justice transaction to claim the entire channel balance as a penalty.
- They make channel security trustless. The risk of losing all funds deters rational actors from fraud, and this game-theoretic mechanism lets Lightning channels operate without trusted intermediaries.
- Watchtowers can act for you. Justice transactions require blockchain monitoring, so you can delegate this task to watchtowers that detect fraud and broadcast justice transactions automatically.

## What Is a Justice Transaction?

A justice transaction is a Bitcoin transaction that takes all funds from a Lightning channel when one party tries to cheat by broadcasting a revoked commitment transaction. It is the final enforcement mechanism in Lightning's security model. It turns attempted theft into a total loss for the attacker.
The name "justice" reflects its punitive purpose: it does not just stop fraud, but gives the fraudster's entire channel balance to the victim. The penalty is deliberate. The threat of losing everything creates a strong economic reason not to cheat, even when the possible gain is small.
Justice transactions are also called penalty transactions, breach remedy transactions, or revocation transactions. Each term describes the same mechanism: using a revocation secret to claim funds from a cheating counterparty's outdated commitment transaction.

## Why Justice Transactions Exist

Lightning Network channels use signed commitment transactions that either party can broadcast at any time to close the channel. Each payment through the channel leads both parties to create new commitment transactions with updated balances and revoke the previous ones.
Old commitment transactions remain valid Bitcoin transactions. A malicious party could broadcast an old state in which they had more funds. If Alice and Bob opened a channel with 0.5 BTC each, and Alice then paid Bob 0.3 BTC, Alice could try to broadcast the original 50/50 state instead of the current 20/80 split.
Lightning would need trust or constant online monitoring without a penalty mechanism. Justice transactions make fraud unprofitable. When parties revoke old states, they exchange revocation secrets, which let the other party construct a justice transaction and claim everything if a revoked state is broadcast.
The game theory is simple: trying to steal 0.3 BTC risks losing 0.2 BTC. No rational actor takes that bet. The existence of justice transactions prevents most fraud attempts before they happen.

## How It Works

Justice transactions rely on the structure of Lightning commitment transactions. Each commitment transaction has asymmetric outputs that allow penalty enforcement.

## Commitment Transaction Structure

Alice and Bob each hold a slightly different version of the current commitment transaction for their channel. Alice's version gives Bob his funds immediately but makes Alice wait through a timelock, typically 144-2016 blocks. Bob's version mirrors this arrangement: Alice gets immediate access while Bob waits.
The delayed output uses a special script. It allows the output to be spent in two ways.
The dual-path script forms the foundation of justice transactions. The delayed path lets honest parties close channels normally, while the revocation path enables punishment.

## The Revocation Process

Each channel state update starts a new revocation step. Both parties create a new commitment transaction and revoke the previous state.
The revocation secret is part of a private key. Revealing it lets the counterparty derive the full revocation key, and the revelation cannot be undone. Once shared, the old state is permanently revoked because the counterparty can use the punishment path.

## Executing Justice

A cheating party may broadcast a revoked commitment transaction. The honest party can then use the revealed revocation secret to claim all the channel funds with a justice transaction.
The timelock on the cheater's output gives the honest party time to react. Once the timelock expires, the cheater could spend their output and the chance to execute justice is lost.

## Watchtowers and Delegated Justice

Justice transactions require someone to monitor the blockchain and react to fraud attempts. You would otherwise need to stay online, watch every block, and be ready to broadcast a justice transaction within the timelock window.
Watchtowers provide outsourced monitoring. You share encrypted justice transaction data with them, and they monitor the chain for you. If a watchtower detects a breach, it decrypts and broadcasts the justice transaction, taking a small fee from the swept funds.
The watchtower model uses cryptography to preserve privacy. You share blob data that a watchtower can decrypt only if it sees a specific transaction on-chain. Watchtowers therefore learn nothing about channels that never experience breaches.

## Technical Implementation

Justice transactions use specific Bitcoin Script constructions defined in BOLT 3. These scripts create the two spending paths that make penalties possible.

## Revocable Output Script

The to_local output in a commitment transaction uses a script with two spending paths. One path applies the normal delay, while the other allows spending through revocation.
The revocation pubkey is constructed from both parties' keys. The counterparty can derive the full private key needed to spend through the revocation path only after the revocation secret is revealed.

## LND Implementation

LND handles justice transactions automatically through its breach arbiter subsystem. The breach arbiter acts when LND detects a broadcast of a revoked commitment.

## HTLC Outputs

Justice transactions must also sweep any pending HTLCs on the revoked commitment. Each HTLC output has its own revocation path. The honest party can claim these funds whether they originally belonged to the local or remote side.

## Timing Requirements

Justice transactions must confirm before the cheater's timelock expires. High on-chain fees or network congestion make sufficient fee priority vital. A justice transaction that arrives too late is worthless.
Most implementations use aggressive fee estimation for justice transactions and often pay premium rates. The entire channel balance is at stake, so overpaying fees is rational.

## Offline Risk

Funds can be stolen if both you and your watchtower or watchtowers are offline during a breach and throughout the timelock period. Lightning has a fundamental liveness requirement: someone must be watching. A longer timelock gives you more time to react, but also keeps funds locked for longer during legitimate closes.

## Data Loss Scenarios

Justice transactions require the revocation secrets from all previous states. Losing this data through a corrupted database or failed backup also removes the ability to punish old states. Reliable backups are essential for Lightning node operators.

## Toxic Waste Problem

Every channel state generates revocation data that must be stored forever while the channel is open. Long-lived, high-activity channels accumulate significant storage requirements. This "toxic waste" must be managed carefully to prevent data loss that could allow fraud to go unpunished.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
