Skip to main content
ALL CHAINS

System Architecture Overview

Component Map

Elastos is a multi-chain blockchain platform composed of seven distinct subsystems, each implemented as one or more independent repositories:

                          BITCOIN NETWORK
(SHA-256 PoW)

Merged Mining
AuxPoW Chain ID 1224

┌──────────────────────────┴──────────────────────────┐
│ ELA MAIN CHAIN │
│ Repo: Elastos.ELA | Language: Go │
│ Model: UTXO | Curve: NIST P-256 (secp256r1) │
│ Consensus: AuxPoW + BPoS │
│ 40+ tx types | BPoS validators (~70) + 12 Council │
│ Block interval: ~120s | Max block: 8MB │
│ Coinbase: 35% miner / 35% BPoS / 30% Elastos DAO treasury │
│ │
│ Ports: P2P 20338 | DPoS 20339 | RPC 20336 │
│ REST 20334 | WS 20335 | Info 20333 │
└──────┬──────────────────┬──────────────────┬────────┘
│ │ │
SPV + Arbiter SPV + Arbiter SPV + Arbiter
Deposit/Withdraw Deposit/Withdraw Deposit/Withdraw
│ │ │
┌──────┴──────┐ ┌──────┴──────┐ ┌──────┴──────┐
│ ESC │ │ EID │ │ Legacy │
│ Chain ID 20│ │ Chain ID 22│ │ ID/Token/ │
│ geth fork │ │ geth fork │ │ NeoVM │
│ 10 precomp.│ │ 3 DID │ │ (inactive) │
│ PBFT+BPoS │ │ precomp. │ └─────────────┘
│ EVM compat │ │ PBFT+BPoS │
│ secp256k1 │ │ secp256k1 │
│ │ │ │
│ P2P 20638 │ │ P2P 20648 │
│ RPC 20636 │ │ RPC 20646 │
│ WS 20632 │ │ WS 20642 │
└──────┬──────┘ └──────┬──────┘
│ │
┌──────┴──────┐ ┌──────┴──────┐
│ StakeTicket │ │ DID SDKs │
│ ELink Bridge│ │ JS/Java/C/ │
│ (Solidity) │ │ Swift │
└─────────────┘ └──────┬──────┘

┌──────┴──────┐
│ Hive Node │
│ Python/ │
│ Flask │
│ MongoDB + │
│ IPFS │
└──────┬──────┘

┌──────┴──────┐
│ Carrier │
│ v2: C++/ │
│ Java DHT │
│ Ed25519 │
└──────┬──────┘

┌─────────┴─────────┐
│ Elastos Essentials│
│ Ionic 6 / Angular │
│ 22+ networks │
│ dApp browser │
│ 4 injected │
│ providers │
└───────────────────┘

Repository Dependency Graph

Elastos.ELA (root — no Elastos dependencies)

├── Elastos.ELA.SPV (imports ELA core types, crypto, P2P)
│ │
│ ├── Elastos.ELA.Arbiter (imports ELA + SPV)
│ │ │
│ │ ├── Uses SPV to watch main chain
│ │ ├── RPC calls to ESC/EID for deposit relay
│ │ └── P2P signing network among arbiters
│ │
│ └── Used by ESC/EID for embedded SPV verification

├── Elastos.ELA.SideChain (base framework, imports ELA types)
│ │
│ ├── Elastos.ELA.SideChain.ESC (geth fork + SideChain framework)
│ │ └── 10 custom precompiled contracts
│ │
│ └── Elastos.ELA.SideChain.EID (geth fork + SideChain framework)
│ └── 3 DID-specific precompiled contracts

├── Elastos.ELA.SPV.Cpp (C++ SPV, independent implementation)
│ └── Used by Essentials via JNI for mobile HD wallets

└── Elastos.ELA.Utility (shared Go utility types)

External Dependencies:
ELA: btcsuite/btcd, syndtr/goleveldb, urfave/cli, gorilla/websocket
ESC/EID: go-ethereum (forked), syndtr/goleveldb
Arbiter: ELA, SPV, mattn/go-sqlite3
Hive: Flask, pymongo, ipfshttpclient, web3.py, PyJWT
Carrier: libsodium, nlohmann-json, spdlog, libuv

Inter-Component Communication Matrix

SourceTargetProtocolPortPurpose
Bitcoin minersELA NodeAuxPoW submission20336Merged mining block submission
ELA NodeELA NodeCustom P2P20338Block/tx propagation, peer discovery
BPoS ValidatorBPoS ValidatorDPoS P2P20339Proposal/vote/confirm messages
ArbiterELA NodeJSON-RPC20336Height queries, tx submission, arbiter info
ArbiterESC NodeJSON-RPC20636Deposit relay, withdraw scanning
ArbiterEID NodeJSON-RPC20646Deposit relay, withdraw scanning
ArbiterArbiterDPoS P2P20339Multi-sig/Schnorr proposal signing
ESC NodeESC Nodedevp2p20638Ethereum-style P2P
EID NodeEID Nodedevp2p20648Ethereum-style P2P
SPV ClientELA NodeCustom P2P20338Header download, bloom filter, Merkle proofs
DID SDKEID NodeJSON-RPC20646DID publish/resolve
Hive SDKHive NodeHTTPS REST443/5000Vault operations
Hive NodeEID NodeJSON-RPC20646DID document verification
Hive NodeESC NodeJSON-RPC20636Payment contract verification
Carrier NodeCarrier NodeUDP39001Kademlia DHT messages
Carrier NodeCarrier NodeTCP39002Active Proxy relay
EssentialsELA/ESC/EIDJSON-RPCvariousWallet operations
EssentialsHive NodeHTTPS REST443Personal data vault
EssentialsCarrierNative bridgeN/AP2P communication

Data Flow Summary

User Action: "Send 10 ELA from Main Chain to ESC"

1. Essentials App
└─> Constructs TransferCrossChainAsset tx (type 0x08)
└─> Signs with P-256 private key
└─> Submits via JSON-RPC to ELA node (port 20336)

2. ELA Main Chain
└─> Validates tx (sanity + context checks)
└─> Includes in block, BPoS confirmation (2/3+1 signatures)
└─> ELA locked at ESC genesis block address

3. Arbiter SPV Module
└─> Bloom filter matches ESC genesis address
└─> Downloads Merkle proof for the tx
└─> Stores in MainChainTxs SQLite table

4. On-Duty Arbiter
└─> Calls ESC RPC: sendrechargetransaction(txHash)

5. ESC Node
└─> Fetches tx + Merkle proof from main chain
└─> SPV verification: tx exists in confirmed block
└─> Mints 10 ELA to user's ESC address (secp256k1)
└─> PBFT consensus confirms the deposit

6. User
└─> Sees 10 ELA balance on ESC

Appendix A: Key Code Paths

Block Production Flow

pow.Service.GenerateBlock()
→ CreateCoinbaseTx() Create coinbase with reward outputs
→ txMemPool.GetTxsInPool() Get pending transactions
→ sort by priority/fee High-priority system txs first
→ CheckTransactionContext() Validate each tx against current state
→ AssignCoinbaseTxRewards() Split rewards 30/35/35
→ crypto.ComputeRoot() Calculate Merkle root
→ CalcNextRequiredDifficulty() Set difficulty target

Transaction Processing Flow

SendRawTransaction (RPC)
→ txn.Deserialize()
→ CheckTransactionSanity() Stateless checks
→ CheckTransactionContext() Stateful checks (UTXO, balances)
→ txMemPool.AppendToTxPool() Add to mempool
→ BroadcastMessage(tx) Relay to peers

Block Acceptance Flow

SyncManager.handleBlockMsg()
→ blockchain.ProcessBlock()
→ CheckBlockSanity() PoW, AuxPoW, structure
→ CheckBlockContext() Contextual validation
→ connectBlock() Update UTXO set, state machines
→ Arbiters.ProcessBlock() Update arbiter state
→ Committee.ProcessBlock() Update Elastos DAO state
→ SaveBlock() Persist to database
→ events.Notify() Notify subscribers

Arbiter Election Flow

Arbiters.IncreaseChainHeight()
→ updateNextArbitrators()
→ snapshotVotesStates() Save vote snapshot
→ sortProducers() Rank by votes
→ Top NormalArbitratorsCount (~70 on mainnet) → nextArbitrators
→ Remaining → nextCandidates
→ On round boundary: swap current ↔ next

Cross-Chain Deposit Flow

User sends TransferCrossChainAsset (0x08)
→ Main chain includes in block + BPoS confirm
→ Arbiter SPV detects via bloom filter
→ DepositListener.Notify() stores in SQLite
→ On-duty arbiter calls sendrechargetransaction RPC
→ ESC verifies SPV proof, mints ELA

Cross-Chain Withdrawal Flow

User sends ELA to ESC cross-chain contract
→ Contract burns ELA, emits PayloadReceived
→ Arbiter SideChainAccountMonitor detects (6 confirmations)
→ On-duty arbiter constructs WithdrawFromSideChain (0x07)
→ Broadcasts DistributedItem proposal to all arbiters
→ Collects 2/3+1 validator signatures (classic multi-sig) or Schnorr aggregate
→ Submits signed tx to main chain
→ Main chain validates, releases ELA

DID Creation Flow

Generate mnemonic → HD derivation m/44'/0'/0'/0/0 (P-256)
→ Derive DID address (0x67 prefix, Base58Check)
→ Create DID document JSON
→ Sign IDChainRequest with P-256 key
→ Submit EVM tx to EID precompile at address 0x16
→ PBFT confirmation → DID resolvable

Appendix B: Glossary

TermDefinition
AuxPoWAuxiliary Proof of Work: merged mining proof linking ELA blocks to Bitcoin blocks
ArbiterA validator responsible for block consensus and cross-chain operations; the arbiter software is run by the 12 Elastos Council members as part of the full supernode stack
BFTByzantine Fault Tolerance: consensus mechanism tolerating malicious participants
BPoSBonded Proof of Stake: staking mechanism with lock-up periods
CRElastos DAO: the community governance DAO controlling the treasury
Elastos CouncilElastos DAO Council: the 12-member elected governing body
DIDDecentralized Identifier: self-sovereign digital identity (W3C standard)
DPoSDelegated Proof of Stake: legacy name for the consensus mechanism, now called BPoS (Bonded Proof of Stake)
EIDElastos Identity Chain: sidechain for DID document anchoring
ELANative token of the Elastos ecosystem
ESCElastos Smart Contract Chain: EVM-compatible sidechain
FFLDBFlat File + LevelDB: hybrid storage engine for block data
Genesis Block AddressMain chain address derived from sidechain's genesis hash; serves as deposit address
HiveDecentralized personal data vault system
On-Duty ArbiterThe arbiter currently responsible for proposing blocks / creating cross-chain txs
PBFTPractical Byzantine Fault Tolerance: consensus used by sidechains
SelaSmallest unit of ELA (1 ELA = 10^8 Sela, analogous to satoshi)
SPVSimplified Payment Verification: light client using headers and Merkle proofs

Appendix C: Repository Index

RepositoryLanguagePurpose
Elastos.ELAGoMain chain node
Elastos.ELA.ArbiterGoCross-chain bridge daemon
Elastos.ELA.SPVGoSPV library (Go)
Elastos.ELA.SPV.CppC++SPV library + HD wallet (mobile)
Elastos.ELA.SideChainGoBase sidechain framework
Elastos.ELA.SideChain.ESCGoEVM sidechain (geth fork)
Elastos.ELA.SideChain.EIDGoIdentity sidechain (geth fork)
Elastos.ELA.StakeTicket.SoliditySolidityBPoS staking NFTs
Elastos.ELink.SoliditySolidityOracle bridge contracts
Elastos.ELA.Wallet.JS.SDKTypeScriptJavaScript wallet SDK
Elastos.ELA.UtilityGoShared Go utilities
Elastos.ELA.Utilities.JavaJavaJava utility library
Elastos.ELA.Rosetta.APIGoExchange integration (scaffold)
Elastos.ELA.MiscToolsShellUpgrade and maintenance tools
Elastos.ELA.MonitorPythonNode monitoring
Elastos.NodeShellDeployment orchestrator
btcpoolC++Merged mining pool
Elastos.DID.JS.SDKTypeScriptDID JavaScript SDK
Elastos.DID.Java.SDKJavaDID Java SDK
Elastos.DID.Native.SDKCDID C core implementation
Elastos.DID.Swift.SDKSwiftDID iOS/macOS SDK
Elastos.DID.MethodDocsDID method specification
Elastos.DID.ContextsJSONJSON-LD credential contexts
Elastos.DID.App.KYCTypeScriptKYC credential application
Elastos.Hive.NodePythonHive storage backend
Elastos.Hive.JS.SDKTypeScriptHive JavaScript client
Elastos.Hive.Java.SDKJavaHive Java client
Elastos.Hive.Swift.SDKSwiftHive iOS/macOS client
Elastos.Carrier.NativeC++Carrier v2 DHT (native)
Elastos.Carrier.JavaJavaCarrier v2 DHT (Java)
Elastos.CarrierClassic.NativeCCarrier v1 (deprecated)
Elastos.Essentials.AppTypeScriptEssentials mobile super-wallet
Elastos.EssentialsShellEssentials root repo
Elastos.Essentials.APITypeScriptEssentials backend API
Elastos.Connectivity.Client.JS.SDKTypeScriptConnectivity SDK
Elastos.SDK.Keypair.CCKey generation (C)
Elastos.SDK.Keypair.JavascriptJavaScriptKey generation (JS)
Elastos.Service.ElectionJavaScriptElection data API
Elastos.ORG.API.MiscGoBlockchain indexer
CyberRepublicJavaScriptElastos DAO governance web app