Scaling & Layer 2

state channel

A state channel is a private side-conversation between two (or a few) parties that touches the blockchain only twice: once to open and once to close. Imagine two friends running a bar tab. Instead of paying for every drink at the register, they keep a running tally on a napkin, each initialling the latest total; only when they leave do they settle the final number with the cashier. The blockchain is the cashier — slow and public — and the napkin is the channel, where they can update the balance thousands of times for free and instantly.

Concretely, the parties lock funds into a multisignature contract on-chain (the open). Then they exchange signed messages off-chain, each representing a new agreed state — a balance split, a chess position, anything the contract can adjudicate. Every update carries a strictly increasing version number and the signatures of all participants, so only the newest mutually-signed state is valid. To close cooperatively, either party submits the latest signed state and the contract pays everyone out. The cost and latency of the intermediate updates are essentially zero because they never hit the chain.

The hard part is enforcement against cheating. If your counterparty disappears or tries to submit an old, more favourable state, the contract opens a challenge window during which the other party can post a newer signed state to override it; some designs add a penalty that awards the cheater's whole balance to the honest party. This means participants (or a watchtower service acting for them) must stay online to defend their funds. State channels give the lowest possible latency and cost for repeated interaction between a fixed set of participants, but they do not help with one-off payments to strangers and they lock capital for the channel's lifetime.

Generalized state channels extend the idea beyond payments to arbitrary application state via an on-chain adjudicator and counterfactual instantiation, where a sub-application contract is deployed only if a dispute actually occurs. In practice payment channels and the Lightning Network are the only large-scale deployments; fully generalized state channels proved complex enough that rollups became the dominant scaling path.

on-chain transactions = 2 (open + close), regardless of N off-chain updates

A channel does not 'store' its balance on-chain between updates — the chain only ever sees the opening lock and the final state. Everything in between exists solely as signed messages the parties hold, which is why staying online (or hiring a watchtower) matters.

Also called
generalized state channel通用狀態通道