Skip to main content

Implementation Documentation

This section provides detailed technical documentation for the Zelana codebase.

Overview

Zelana is a privacy-focused Layer 2 rollup prototype on Solana. The codebase currently includes:

  • Shielded transaction primitives (notes, nullifiers, encrypted outputs)
  • Threshold encryption building blocks for sequencer-blind ordering
  • Low-latency UDP transport (Zephyr)
  • ZK rollup settlement with Groth16 proofs (BN254)

Documentation Structure

Architecture Overview

High-level system architecture, component relationships, and design decisions.

State Machines

Detailed state machine analysis for each major component:

  • Sequencer - Transaction processing, batch lifecycle, session management
  • Bridge - L1↔L2 deposits and withdrawals
  • Prover - ZK proof generation and L1 settlement
  • Transaction Types - All transaction structures and flows

Zephyr Protocol

Low-latency UDP transport protocol for fast transaction submission.

Note: Pages under Drafts are design notes and may not match the current implementation.

Quick Reference

Key Concepts

ConceptDescription
BatchCollection of transactions being processed together
BlockFinalized batch with compact 96-byte header
NullifierUnique identifier preventing double-spends
CommitmentHash of a shielded note
State RootMerkle root of all L2 account states

Transaction Types

TypePrivacyFlow
TransferTransparentL2 → L2
DepositTransparentL1 → L2
WithdrawTransparentL2 → L1
ShieldedPrivateL2 → L2 (ZK)

Component Locations

ComponentPath
Sequencer Corecore/src/sequencer/
API Layercore/src/api/
Bridge Programonchain-programs/bridge/
Verifier Programonchain-programs/verifier/
Proverprover/src/
SDK Cratessdk/

Use these links to jump directly to key implementation entry points: