Skip to main content
Version: 0.5.x

Challenge-Response & Disputes

In this guide, you will learn how Yellow Network resolves disputes and ensures your funds are always recoverable.

Goal: Understand the security guarantees that make off-chain transactions safe.


Why Challenge-Response Matters​

In any off-chain system, a critical question arises: What if someone tries to cheat?

State channels solve this with a challenge-response mechanism:

  1. Anyone can submit a state to the blockchain
  2. Counterparties have time to respond with a newer state
  3. The newest valid state always wins
  4. Funds are distributed according to that state

The Trust Model​

State channels are trustless because:

GuaranteeHow It's Achieved
Fund custodySmart contract holds funds, not Clearnode
State validityOnly signed states are accepted
Dispute resolutionOn-chain fallback if disagreement
RecoveryYou can always get your funds back

Channel Dispute Flow​

Scenario: Clearnode Becomes Unresponsive​

You have a channel with 100 USDC. The Clearnode stops responding.

Your options:

  1. Wait for Clearnode to recover
  2. Force settlement on-chain via challenge

The Process​

  1. Initiate Challenge: Submit your latest signed state to the blockchain
  2. Challenge Period: Contract sets a timer (e.g., 24 hours)
  3. Response Window: Counterparty can submit a newer state
  4. Resolution: After timeout, challenged state becomes final

Why This Works​

States Are Ordered​

Every state has a version number. A newer (higher version) state always supersedes older states.

States Are Signed​

With the default SimpleConsensus adjudicator, both parties must sign every state. If someone signed a state, they can't later claim they didn't agree.

:::note Other Adjudicators Different adjudicators may have different signing requirements. For example, a Remittance adjudicator may only require the sender's signature. The signing rules are defined by the channel's adjudicator contract. :::

Challenge Period Provides Fairness​

The waiting window ensures honest parties have time to respond. Network delays don't cause losses.

On-Chain Contract is Neutral​

The smart contract accepts any valid signed state, picks the highest version, and distributes funds exactly as specified.


Challenge Period Selection​

DurationTrade-offs
1 hourFast resolution, tight response window
24 hoursBalanced (recommended)
7 daysMaximum safety, slow settlement

The Custody Contract enforces a minimum of 1 hour.


Checkpoint vs Challenge​

OperationPurposeChannel Status
checkpoint()Record state without disputeStays ACTIVE
challenge()Force dispute resolutionChanges to DISPUTE

Use checkpoint for safety snapshots. Use challenge when you need to force settlement.


What Happens If...​

ScenarioOutcome
Clearnode goes offlineChallenge with latest state, withdraw after timeout
You lose state historyChallenge with old state; counterparty submits newer if they have it
Counterparty submits wrong stateSubmit your newer state via checkpoint
Block reorg occursReplay events from last confirmed block

Key Takeaways​

ConceptRemember
ChallengeForce on-chain dispute resolution
ResponseSubmit newer state to defeat challenge
TimeoutAfter period, challenged state becomes final
CheckpointRecord state without dispute

:::success Security Guarantee You can always recover your funds according to the latest mutually signed state, regardless of counterparty behavior. :::


Deep Dive​

For technical implementation details: