æternity Documentation Hub
AeternityGitHub
  • æternity Hub
  • Developer Documentation
  • Welcome to æternity documentation
  • Getting Started
    • What is æternity?
    • How to Use Aeternity
  • æternity core concepts
    • Introduction
    • æternity Protocol
      • æternity Coin
      • Fast Æternity Transaction Engine (FATE VM)
      • æternity Nodes
        • Node architecture
        • Node types
        • Node Roles
      • Transactions
        • Types of transactions
        • Transaction Lifecycle
        • Transaction Fees
        • Meta-transactions and Generalized Accounts
        • State Channel Transactions
      • Networks
      • Consensus Mechanisms
        • Next Generation Nakamoto Consensus (Bitcoin-NG)
        • Cuckoo Cycle Proof of Work
        • Hyperchains and Delegated Proof of Stake
        • Governance and Weighted Coin Voting
      • State Channels
      • Oracles
      • Aeternity Naming System (AENS)
    • Hyperchains
      • Hyperchains Whitepaper
    • Aeternity Governance
    • Aeternity Foundation
  • aeternity user tools and services
    • Introduction
    • Run an æternity node
    • Hyperchains web app
    • Hyperchains Bridge app
    • Mine aeternity coin
    • Superhero DEX
    • Superhero Wallet
    • ærc Bridge
    • Make an NFT
    • aepps: decentralized applications on æternity
    • æScan: æternity blockchain explorer
  • æternity Developer tools
    • Quick Start Guide
      • Development Environment Setup
      • Essential Tools Overview
      • Æternity Stack
      • First Steps in Development
    • Protocol
      • Core Protocol Components
        • æternity Consensus Protocol
        • Generalized Accounts
        • Smart Contracts
          • FATE VM
          • Smart contract languages
            • æternity Sophia Language
              • In-Depth Overview
              • Sophia Compiler
              • Sophia Visual Studio
              • Sophia http
              • æREPL
            • Solidity
          • Contract Transactions
        • State Channels
        • Oracles
      • Network Layer
        • Nodes
          • Node Documentation
          • Node API Reference
        • Sync
        • Gossip
        • Stratum
      • Utility Features
        • æternity Naming System (AENS)
        • Seralization Formats
    • æternity Sophia Language
      • In-Depth Overview
      • Sophia Compiler
      • Sophia Visual Studio
      • Sophia http
      • æREPL
    • Development Infrastructure
      • CLIs
      • SDKs and APIs
        • Javascript/Typescript SDK
        • Java SDK
        • Outdated SDKs
        • APIs
          • Node API reference
      • Middleware
      • Testing and Deployment
        • æproject
        • Testnet
          • Localnet
          • Faucet
        • Testnets and Faucet
    • Token Standards
      • æternity token standards
        • AEXs: Aeternity Expansions
        • AEX-1
        • AEX-9
        • AEX-141
    • Aepps: Building apps on Aeternity
      • Boiler Plates
        • Angular Boiler Plate
        • React JS BoilerPlate
        • Vue BoilerPlate
      • Æpp architecture
      • Implementation Guidelines
      • Reference æpps
        • Case Studies
        • Code Examples
        • Aeternity Graffiti
    • Data and analytics
      • æScan
    • ÆRC Bridge
  • Hyperchains
    • Hyperchains Development Guide
    • Hyperchains Bridge
Powered by GitBook
On this page
  • Understanding State Channels
  • Benefits and Use Cases
  • How State Channels Work
  • Security and Dispute Resolution
  • Integration with Smart Contracts
  • Getting Started

Was this helpful?

Export as PDF
  1. æternity core concepts
  2. æternity Protocol

State Channels

PreviousGovernance and Weighted Coin VotingNextOracles

Last updated 2 days ago

Was this helpful?

State channels are one of æternity's core scaling solutions, enabling millions of transactions per second between parties while maintaining the security guarantees of the blockchain. Unlike other blockchain platforms where state channels are an add-on feature, æternity was built with state channels as a fundamental component, integrating them deeply into the protocol level.

Understanding State Channels

Think of a state channel as a private conversation between two parties who agree to keep track of their interactions off the main blockchain. Much like how you might keep a running tab at your local coffee shop and settle up at the end of the month, state channels allow participants to conduct numerous transactions quickly and privately, only recording the final result on the blockchain.

What makes æternity's implementation special is its native support for state channels at the protocol level. This means that common operations like opening channels, executing state updates, and dispute resolution are built directly into the blockchain's architecture, making them more efficient and secure than add-on implementations found in other platforms.

Benefits and Use Cases

State channels in æternity provide several key advantages. First, they offer near-instant transaction finality between participants, as there's no need to wait for block confirmations for each interaction. Second, they significantly reduce transaction costs since only the channel opening and closing operations need to be recorded on-chain. Third, they provide enhanced privacy as the intermediate states are only known to the channel participants.

These characteristics make state channels particularly valuable for applications requiring frequent interactions between parties. Online gaming platforms can use them to handle rapid in-game transactions, streaming services can process micropayments in real-time, and IoT devices can efficiently record state changes without overwhelming the main chain. Payment channels, a simpler form of state channels, are perfect for recurring transactions between parties, such as subscription services or regular business relationships.

How State Channels Work

State channels operate in three main phases: opening, operation, and closing. To open a channel, participants must first agree to collaborate and post a mutually authenticated channel creation transaction on-chain. This transaction specifies the involved parties and the amount of coins they want to lock in the channel.

During operation, participants exchange mutually authenticated transactions off-chain through encrypted peer-to-peer communication. Each state update must be signed by both parties, creating a verifiable sequence of changes. These updates can include simple balance transfers or complex smart contract interactions, all happening privately between the participants.

Closing a channel can happen in two ways. In the optimistic case, both parties agree on the final state and post a closing transaction on-chain. However, if there's a dispute, æternity's protocol includes built-in mechanisms for resolution. Participants can post their latest valid state on-chain, and the protocol enforces a challenge period during which any fraud can be proven and punished.

Security and Dispute Resolution

æternity's state channel implementation includes robust security measures to protect participants. The protocol maintains a "lock period" after a solo closing attempt, during which the other party can contest the closure by presenting more recent valid states. This prevents malicious actors from trying to close a channel with an outdated state that benefits them.

If a dispute arises over smart contract execution within a channel, participants can use the "force progress" feature to move the contract state forward on-chain. This ensures that no party can prevent the natural progression of a contract by refusing to cooperate, while still maintaining the efficiency benefits of off-chain execution for cooperative scenarios.

Integration with Smart Contracts

One of æternity's unique features is the seamless integration between state channels and smart contracts written in Sophia. The same contract code can run both on-chain and within state channels, with the protocol automatically handling the transition between these contexts when necessary. This makes it easier for developers to build applications that can scale through state channels without requiring separate implementations for on-chain and off-chain operations.

State channels in æternity can also interact with other blockchain features like oracles, allowing for complex applications that combine off-chain scaling with access to external data. This integration enables sophisticated use cases while maintaining the performance benefits of off-chain execution.

Getting Started

For users interested in interacting with state channels, detailed guides are available in the User Guides section of this documentation. Developers looking to implement state channels in their applications can find comprehensive technical documentation, including code examples and best practices, in the Developer Tools section. The æternity team continues to develop tools and frameworks to make state channels more accessible and easier to implement in real-world applications.

Development Tools

State Channels Demo Game

Cover

State Channels Demo Game

Building on State Channels

Cover

State Channels Developer Documentation