Blockchain Developer Guide
The Elastos blockchain is one of four Elastos pillars (alongside PC2, Runtime, and Carrier). This section covers building on the blockchain.
Architecture: Three Chains
The Elastos blockchain is a multi-chain system with three layers:
The Main Chain (ELA) is the foundation. It uses a UTXO model (like Bitcoin), is secured by Bitcoin's mining power through merged mining (AuxPoW), and runs BPoS consensus with ~70 elected validators plus 12 Elastos Council nodes. It handles ELA transfers, staking, governance, and cross-chain coordination.
The Smart Chain (ESC) is an EVM-compatible sidechain for smart contracts. Standard Ethereum tooling works: Hardhat, ethers.js, MetaMask, Foundry, Remix. Chain ID 20.
The Identity Chain (EID) is a sidechain for decentralized identity. It hosts W3C DID documents through precompiled contracts. Also EVM-compatible, Chain ID 22.
Cryptography: The Dual-Curve Architecture
The main chain uses P-256 (secp256r1) — the NIST standard curve found in TLS, Apple Secure Enclave, and government systems. The sidechains (ESC and EID) use secp256k1 — the same curve as Ethereum and Bitcoin.
This is a deliberate design choice, not an oversight. It means:
- MetaMask, ethers.js, and web3.js work for ESC and EID but cannot sign main chain transactions.
- Main chain operations require the Elastos Wallet JS SDK or Essentials.
- A single BIP39 mnemonic can derive keys for all chains using different derivation paths (see below).
What You Can Build
| Goal | Chain | Tools |
|---|---|---|
| Deploy smart contracts, DeFi, NFTs | ESC | Hardhat, ethers.js, Solidity |
| Accept ELA payments | Main Chain or ESC | Main Chain SDK or standard EVM |
| Issue and verify decentralized identity | EID | DID SDK |
| Store user data in personal vaults | Hive | Hive SDK |
| Move ELA between chains | Bridge | Cross-Chain Development |
| Integrate exchange deposits/withdrawals | Main Chain | Exchange Integration |
| Connect to Essentials wallet | ESC | Connectivity SDK |
| Build P2P applications | Carrier | Carrier Developer Guide |
Key Management
HD Derivation Paths
From a single BIP39 mnemonic:
Main Chain (ELA): m/44'/0'/0' → P-256 (secp256r1) keys
DID Keys: m/44'/0'/0'/0/<idx> → P-256 (secp256r1) keys
ESC/EID: m/44'/60'/0'/0/<idx> → secp256k1 keys (standard Ethereum)
Address Formats
| Chain | Format | Prefix | Example |
|---|---|---|---|
| Main Chain (standard) | Base58Check, version byte 0x21 | Starts with 8 | 8VYXVxKKSAxkmRrfmGpQR2Kc66XhG6m3ta |
| Main Chain (multi-sig) | Base58Check, version byte 0x12 | Starts with 8 | 8ZNizBf4KhhPjeJRGpox6rPcHE5Np6tFx3 |
| Main Chain (cross-chain) | Base58Check, version byte 0x4B | Starts with X | XKUh4GLhFJiqAMTF6HyWQrV9pK9HcGUdfJ |
| ESC | Hex, EIP-55 checksum | 0x | 0x1234...abcd |
| EID | Hex, EIP-55 checksum | 0x | 0x1234...abcd |
Repository Map
| Repository | Purpose | Language |
|---|---|---|
elastos/Elastos.ELA | Main chain full node | Go |
elastos/Elastos.ELA.SideChain.ESC | ESC sidechain node | Go (geth fork) |
elastos/Elastos.ELA.SideChain.EID | EID sidechain node | Go (geth fork) |
elastos/Elastos.ELA.Arbiter | Cross-chain bridge | Go |
elastos/Elastos.DID.JS.SDK | DID operations | TypeScript |
elastos/Elastos.Hive.Node | Decentralized storage backend | Python/Flask |
elastos/Elastos.ELA.Wallet.JS.SDK | Main chain wallet operations | TypeScript |
CyberRepublic/Elastos.Essentials.App | Mobile super-wallet | TypeScript/Ionic |
elastos/Elastos.Connectivity.Client.JS.SDK | dApp-to-wallet connector | TypeScript |
Next Steps
- Deploy a smart contract on ESC — Create an ERC-20 Token
- Integrate with the main chain — Main Chain SDK
- Add decentralized identity — DID Integration
- Set up network access — Network Endpoints