æternity Documentation Hub
AeternityGitHub
  • æternity Hub
  • 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
        • 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
        • Node API reference
      • Middleware
      • Testing and Deployment
        • æproject
        • Testnets and Faucet
    • Token Standards
    • Aepps: Building apps on Aeternity
      • Boiler Plates
        • Angular Boiler Plate
        • React JS BoilerPlate
        • Vue BoilerPlate
    • Data and analytics
      • æScan
    • ÆRC Bridge
  • Hyperchains
    • Hyperchains Development Guide
    • Hyperchains Bridge
Powered by GitBook
On this page
  • The æternity Blockchain Stack
  • Level One: æternity Nodes
  • Level Two: FATE VM
  • Level Three: Smart Contracts
  • Level Four: æternity Client APIs
  • Level Five: End-User Applications
  • The Integrated Stack

Was this helpful?

Export as PDF
  1. æternity Developer tools
  2. Quick Start Guide

Æternity Stack

PreviousEssential Tools OverviewNextFirst Steps in Development

Last updated 13 days ago

Was this helpful?

The æternity Blockchain Stack

The æternity blockchain stack is a comprehensive ecosystem designed to support scalable and secure decentralized applications. Let's explore the architecture of the æternity stack from its foundation to the application layer.

Level One:

At the foundation of the æternity ecosystem are the nodes that form the network's infrastructure. These nodes are the backbone of the blockchain, responsible for maintaining consensus, processing transactions, and supporting all higher-level functionalities.

æternity nodes are implemented in Erlang, a programming language known for building highly concurrent and fault-tolerant systems. This implementation choice allows the network to handle significant loads while maintaining stability. The nodes employ the Bitcoin-NG consensus mechanism, which significantly improves throughput compared to traditional proof-of-work blockchains by separating leader election from transaction processing.

The node infrastructure supports several native features that distinguish æternity from other blockchains:

  • State channels for off-chain scaling

  • Built-in oracles for accessing external data

  • An integrated naming system (ÆNS)

  • Governance mechanisms for protocol evolution

Each node maintains the complete state of the blockchain and participates in validating new transactions and blocks, ensuring the network remains decentralized and secure.

Level Two:

Built on top of the node infrastructure is the Fast æternity Transaction Engine (FATE) virtual machine. The FATE VM is custom-designed for executing smart contracts on the æternity blockchain with optimal efficiency and security.

Unlike more general-purpose virtual machines, FATE is specifically optimized for blockchain operations. It features:

  • A strong type system that prevents many common smart contract vulnerabilities

  • Direct integration with blockchain primitives, making operations like oracle queries and state channel transactions more efficient

  • Support for unbounded integers, eliminating overflow vulnerabilities

  • Higher-level operations that reduce gas costs and contract size

The FATE VM executes bytecode compiled from the Sophia language, providing a secure runtime environment that maintains deterministic execution across all nodes in the network.

The smart contract layer provides the programming interface for developers to create decentralized applications. At the center of this layer is Sophia, æternity's native smart contract language.

Sophia is a functional programming language designed specifically for blockchain applications. Its functional paradigm helps developers write more predictable code with fewer side effects, which is crucial for financial applications. Key features include:

  • Strong static typing to catch errors at compile time

  • First-class support for blockchain-specific operations

  • Built-in types for oracles, state channels, and the naming system

  • Immutable data structures that align with blockchain principles

Smart contracts in æternity can interact with the blockchain's native features, such as the oracle system for accessing real-world data or the state channels for high-throughput applications. This tight integration allows developers to build more sophisticated applications with less complexity.

// Example Sophia contract with oracle integration
contract WeatherBet =
  record state = { oracle      : oracle(string, int),
                   bet_amount  : int,
                   temperature : option(int) }
                   
  entrypoint init(oracle_address : oracle(string, int), amount : int) = 
    { oracle = oracle_address, 
      bet_amount = amount,
      temperature = None }
      
  payable stateful entrypoint place_bet(city : string) =
    require(Call.value == state.bet_amount, "Wrong bet amount")
    let query = Oracle.query(state.oracle, city, 
                            state.bet_amount, RelativeTTL(10), RelativeTTL(10))
    put(state)

Level Four: æternity Client APIs

To bridge the gap between the blockchain infrastructure and application developers, æternity provides a comprehensive set of APIs and SDKs. These tools abstract away much of the complexity of blockchain interaction, allowing developers to focus on application logic.

The æternity ecosystem offers:

  • A REST API for direct node interaction

  • A WebSocket API for real-time updates and subscriptions

  • JavaScript, Java, and other language SDKs

  • Libraries for common operations like contract deployment and transaction signing

These APIs provide methods for all blockchain operations, from basic account management to complex smart contract interactions and state channel operations.

// SDK example: Deploying a smart contract
const { Node, Universal: Ae, MemoryAccount } = require('@aeternity/aepp-sdk')

const deploy = async () => {
  // Connect to a node
  const client = await Ae({
    nodes: [{ name: 'testnet', instance: await Node({ url: 'https://testnet.aeternity.io' }) }],
    compilerUrl: 'https://compiler.aepps.com',
    accounts: [MemoryAccount({ keypair: { secretKey: 'YOUR_PRIVATE_KEY', publicKey: 'YOUR_PUBLIC_KEY' } })]
  })
  
  // Contract source code
  const sourceCode = `
  contract SimpleStorage =
    record state = { value : int }
    entrypoint init() = { value = 0 }
    stateful entrypoint set(x : int) = put(state{value = x})
    entrypoint get() = state.value
  `
  
  // Deploy the contract
  const contract = await client.getContractInstance(sourceCode)
  const deployInfo = await contract.deploy([])
  
  console.log(`Contract deployed at: ${deployInfo.address}`)
}

Level Five: End-User Applications

At the top of the stack are the end-user applications, often called æpps. These applications leverage all the underlying layers to provide value to end users who may not even be aware they're interacting with a blockchain.

Applications built on æternity can take many forms:

  • Web-based decentralized applications (æpps)

  • Mobile applications with blockchain functionality

  • Integration layers for existing systems

  • Specialized applications utilizing state channels for high performance

æternity applications can benefit from the platform's unique features, such as scalable micropayments through state channels, trustless data from oracles, and human-readable addressing through the naming system.

Many applications focus on use cases where æternity's specific strengths provide advantages:

  • Decentralized prediction markets using the oracle system

  • High-frequency financial applications via state channels

  • Supply chain solutions with integrated oracle functionality

  • Governance and voting systems

The end-user application layer is where the technical capabilities of the æternity stack translate into tangible value for users, whether they're individuals, businesses, or other organizations.

The Integrated Stack

The æternity blockchain stack is designed as a cohesive ecosystem where each layer builds upon and enhances the capabilities of the layers below it. This integrated approach allows developers to create sophisticated applications while maintaining performance, security, and usability.

From the foundational nodes to the user-facing applications, the æternity stack represents a complete solution for building the next generation of decentralized systems, combining technical innovation with practical utility.

Level Three:

æternity Nodes
FATE VM
Smart Contracts