Key concepts
State channels are a powerful tool for scaling blockchain networks, enabling fast, low-cost transactions by conducting interactions off-chain. This page breaks down the essential concepts of state channels, from capacity and liquidity to payment routing and atomic swaps, giving you a clear understanding of how they work and why they matter.
Capacity
The capacity of a state channel represents the total amount of funds available within the channel that can be exchanged between participants. It dictates the maximum value that can be transferred in either direction across the channel.
Outbound liquidity
Outbound liquidity, often referred to as “can send”, "sending capacity" or "spending balance," is the amount of funds a participant can currently send through the state channel. This can be increased by depositing additional funds into the channel.
Inbound liquidity
Inbound liquidity, also known as "can receive" or "receiving capacity," indicates the amount of funds a participant can currently receive through the state channel. This is directly tied to the counterparty's outbound liquidity. Since it cannot be increased by the participant themselves, they must employ other strategies, such as using on-demand services designed to increase their receiving capacity. Such services can include marketplaces like Lightning Pool, where users can purchase inbound liquidity, or using Pool In, where users send on-chain funds to receive inbound liquidity in their Lightning channels.
Payment routing
Payment routing is the process of forwarding payments across multiple interconnected state channels, allowing participants to send payments to a recipient with whom they do not share a direct channel. This routing leverages the network of state channels.
Atomic swaps
Atomic swaps, often referred to in the context of cross-chain transactions, allow the exchange of one cryptocurrency for another directly between two parties without the need for a centralized intermediary. The process is "atomic," meaning the swap either completes fully or not at all.
Hashed time-lock contract
A Hashed Time-Lock Contract (HTLC) is a type of contract used to secure payments. It involves two key elements: a cryptographic hash function and a time-lock. The recipient must provide the correct pre-image (the input to the hash function) within a specified time frame to claim the payment. If the correct pre-image isn't provided in time, the funds are returned to the sender, ensuring that payments are either completed successfully or refunded.
Watchtowers
Watchtowers are third-party services that monitor state channels on behalf of its user(s). They ensure that no fraudulent activity, such as publishing outdated or incorrect channel states, occurs when participants are offline or unable to monitor the channel themselves. If a violation is detected, the watchtower can act to enforce the correct state and protect the user's funds.
Force closure
Also known as “unilateral closure” or a “channel dispute”, force closure occurs when one participant decides to close a state channel without the cooperation of the other participant. This process involves broadcasting the most recent state of the channel to the blockchain, which triggers a dispute period. During this period, the other participant has the opportunity to contest the state if it is outdated or incorrect. If no dispute arises, the channel is closed, and the funds are distributed according to the last recorded state.