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
| Source | Target | Protocol | Port | Purpose |
|---|---|---|---|---|
| Bitcoin miners | ELA Node | AuxPoW submission | 20336 | Merged mining block submission |
| ELA Node | ELA Node | Custom P2P | 20338 | Block/tx propagation, peer discovery |
| BPoS Validator | BPoS Validator | DPoS P2P | 20339 | Proposal/vote/confirm messages |
| Arbiter | ELA Node | JSON-RPC | 20336 | Height queries, tx submission, arbiter info |
| Arbiter | ESC Node | JSON-RPC | 20636 | Deposit relay, withdraw scanning |
| Arbiter | EID Node | JSON-RPC | 20646 | Deposit relay, withdraw scanning |
| Arbiter | Arbiter | DPoS P2P | 20339 | Multi-sig/Schnorr proposal signing |
| ESC Node | ESC Node | devp2p | 20638 | Ethereum-style P2P |
| EID Node | EID Node | devp2p | 20648 | Ethereum-style P2P |
| SPV Client | ELA Node | Custom P2P | 20338 | Header download, bloom filter, Merkle proofs |
| DID SDK | EID Node | JSON-RPC | 20646 | DID publish/resolve |
| Hive SDK | Hive Node | HTTPS REST | 443/5000 | Vault operations |
| Hive Node | EID Node | JSON-RPC | 20646 | DID document verification |
| Hive Node | ESC Node | JSON-RPC | 20636 | Payment contract verification |
| Carrier Node | Carrier Node | UDP | 39001 | Kademlia DHT messages |
| Carrier Node | Carrier Node | TCP | 39002 | Active Proxy relay |
| Essentials | ELA/ESC/EID | JSON-RPC | various | Wallet operations |
| Essentials | Hive Node | HTTPS REST | 443 | Personal data vault |
| Essentials | Carrier | Native bridge | N/A | P2P 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
| Term | Definition |
|---|---|
| AuxPoW | Auxiliary Proof of Work: merged mining proof linking ELA blocks to Bitcoin blocks |
| Arbiter | A 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 |
| BFT | Byzantine Fault Tolerance: consensus mechanism tolerating malicious participants |
| BPoS | Bonded Proof of Stake: staking mechanism with lock-up periods |
| CR | Elastos DAO: the community governance DAO controlling the treasury |
| Elastos Council | Elastos DAO Council: the 12-member elected governing body |
| DID | Decentralized Identifier: self-sovereign digital identity (W3C standard) |
| DPoS | Delegated Proof of Stake: legacy name for the consensus mechanism, now called BPoS (Bonded Proof of Stake) |
| EID | Elastos Identity Chain: sidechain for DID document anchoring |
| ELA | Native token of the Elastos ecosystem |
| ESC | Elastos Smart Contract Chain: EVM-compatible sidechain |
| FFLDB | Flat File + LevelDB: hybrid storage engine for block data |
| Genesis Block Address | Main chain address derived from sidechain's genesis hash; serves as deposit address |
| Hive | Decentralized personal data vault system |
| On-Duty Arbiter | The arbiter currently responsible for proposing blocks / creating cross-chain txs |
| PBFT | Practical Byzantine Fault Tolerance: consensus used by sidechains |
| Sela | Smallest unit of ELA (1 ELA = 10^8 Sela, analogous to satoshi) |
| SPV | Simplified Payment Verification: light client using headers and Merkle proofs |
Appendix C: Repository Index
| Repository | Language | Purpose |
|---|---|---|
Elastos.ELA | Go | Main chain node |
Elastos.ELA.Arbiter | Go | Cross-chain bridge daemon |
Elastos.ELA.SPV | Go | SPV library (Go) |
Elastos.ELA.SPV.Cpp | C++ | SPV library + HD wallet (mobile) |
Elastos.ELA.SideChain | Go | Base sidechain framework |
Elastos.ELA.SideChain.ESC | Go | EVM sidechain (geth fork) |
Elastos.ELA.SideChain.EID | Go | Identity sidechain (geth fork) |
Elastos.ELA.StakeTicket.Solidity | Solidity | BPoS staking NFTs |
Elastos.ELink.Solidity | Solidity | Oracle bridge contracts |
Elastos.ELA.Wallet.JS.SDK | TypeScript | JavaScript wallet SDK |
Elastos.ELA.Utility | Go | Shared Go utilities |
Elastos.ELA.Utilities.Java | Java | Java utility library |
Elastos.ELA.Rosetta.API | Go | Exchange integration (scaffold) |
Elastos.ELA.MiscTools | Shell | Upgrade and maintenance tools |
Elastos.ELA.Monitor | Python | Node monitoring |
Elastos.Node | Shell | Deployment orchestrator |
btcpool | C++ | Merged mining pool |
Elastos.DID.JS.SDK | TypeScript | DID JavaScript SDK |
Elastos.DID.Java.SDK | Java | DID Java SDK |
Elastos.DID.Native.SDK | C | DID C core implementation |
Elastos.DID.Swift.SDK | Swift | DID iOS/macOS SDK |
Elastos.DID.Method | Docs | DID method specification |
Elastos.DID.Contexts | JSON | JSON-LD credential contexts |
Elastos.DID.App.KYC | TypeScript | KYC credential application |
Elastos.Hive.Node | Python | Hive storage backend |
Elastos.Hive.JS.SDK | TypeScript | Hive JavaScript client |
Elastos.Hive.Java.SDK | Java | Hive Java client |
Elastos.Hive.Swift.SDK | Swift | Hive iOS/macOS client |
Elastos.Carrier.Native | C++ | Carrier v2 DHT (native) |
Elastos.Carrier.Java | Java | Carrier v2 DHT (Java) |
Elastos.CarrierClassic.Native | C | Carrier v1 (deprecated) |
Elastos.Essentials.App | TypeScript | Essentials mobile super-wallet |
Elastos.Essentials | Shell | Essentials root repo |
Elastos.Essentials.API | TypeScript | Essentials backend API |
Elastos.Connectivity.Client.JS.SDK | TypeScript | Connectivity SDK |
Elastos.SDK.Keypair.C | C | Key generation (C) |
Elastos.SDK.Keypair.Javascript | JavaScript | Key generation (JS) |
Elastos.Service.Election | JavaScript | Election data API |
Elastos.ORG.API.Misc | Go | Blockchain indexer |
CyberRepublic | JavaScript | Elastos DAO governance web app |