Previous Section
Introduction

🔄 Channel Lifecycle: Open, Update, Close

Understand the three phases of state channel operation

Enable instant off-chain transactions

Channel Lifecycle: Open, Transact, Close

Understand the complete lifecycle of a state channel from opening to closing, and how funds flow through each stage.

🎮 Lifecycle Stage Simulator

Step through the four stages of a state channel lifecycle. Navigate at your own pace to understand how funds move through the system.

🏦

Channel Opening

Step 1/4

Both parties deposit funds into smart contract

💡 Navigate at your own pace

💰 Balance Transfer Simulator

Try transferring funds between Alice and Bob within the channel. Notice how balances update instantly without blockchain transactions.

👩 Alice$100
👨 Bob$100
Channel Capacity:$200
Transactions Made:Unlimited (off-chain)
Transaction Fee:$0.00

🔄 The Four Lifecycle Stages

1️⃣

Opening

Participants deploy a multisig contract and deposit funds. This requires one on-chain transaction per party (~$2-5 gas fee each).

2️⃣

Transacting

Parties exchange unlimited signed state updates off-chain. Each update represents a new balance distribution and is instantly verified.

3️⃣

Updating

Each transaction creates a new signed state with sequence numbers. Only the latest valid state with both signatures matters.

4️⃣

Closing

Either party submits the final state to the contract, which verifies signatures and distributes funds accordingly after a challenge period.

⚙️ Technical Details

🔢

Sequence Numbers

Each state update includes an incrementing nonce to prevent replay attacks and ensure the latest state is recognized.

✍️

Digital Signatures

Both parties must sign each state update with their private keys, creating cryptographic proof of agreement on the balance distribution.

⏱️

Challenge Period

When closing, there's typically a 24-hour window where the other party can challenge with a newer state if someone tries to submit an old one.

💎

Locked Liquidity

Funds are locked in the channel for its duration. You can't use that capital elsewhere until the channel closes, which is the main trade-off.

Introduction