Main Chain Internals
The ELA main chain is a UTXO-based blockchain secured by Bitcoin merged mining (AuxPoW) with BPoS finality. This page covers its internal architecture — from block structure to consensus to the full transaction type catalog.
Consensus Evolution
Elastos consensus evolved through four phases:
| Phase | Height Range | Mechanism |
|---|---|---|
| 1. Pure AuxPoW | Genesis to 343,400 | Merged mining with Bitcoin only |
| 2. CRC-Only DPoS | 343,400 to 402,680 | 12 hardcoded Council arbiters provide finality |
| 3. Public DPoS | 402,680 to 1,405,000 | Full public validator election |
| 4. BPoS | 1,405,000+ | Time-locked staking with logarithmic weight |
AuxPoW (Merged Mining)
Every ELA block header contains an AuxPow structure proving that a Bitcoin miner committed to the ELA block hash:
- The ELA block hash is embedded in the Bitcoin coinbase's
scriptSigafter magic bytes0xfabe6d6d - Chain ID 1224 produces a deterministic expected index in the aux Merkle tree
- The block hash is computed from the header without the AuxPow field (
SerializeNoAux())
Block validation checks AuxPoW proof, PoW difficulty, timestamp bounds, Merkle root, and coinbase structure.
BPoS Confirmation
After BPoS activation, every block carries a Confirm — a collection of validator signatures proving BFT consensus:
- On-duty validator proposes a block via
DPOSProposal - Other validators validate and broadcast
DPOSProposalVote(accept/reject) - When 2/3+1 accept votes are collected, a
Confirmis formed - The confirmed block is final — no reorganization is possible
BFT Threshold: 2/3 supermajority of the active validator set.
PoW Fallback
If BPoS consensus stalls for 12 hours, the chain automatically reverts to pure PoW mode via a RevertToPOW transaction (type 0x41). Cross-chain transfers are blocked during PoW mode as a safety measure. Normal operation resumes via RevertToDPOS (type 0x42).
Block Structure
| Component | Description |
|---|---|
| Header | Version, previous hash, Merkle root, timestamp, difficulty bits, nonce, height, AuxPow proof |
| Block | Header + ordered list of transactions |
| DposBlock | Block + optional Confirm (validator signature collection) |
The header's Height field is explicit (unlike Bitcoin, which derives height from the chain).
Transaction Lifecycle
Every transaction passes through two validation stages:
Sanity Check (stateless):
- Valid size, serialization, type code, payload format, signature format
Context Check (stateful):
- All referenced UTXOs exist and are unspent
- Input values >= output values + fee
- Fee meets minimum threshold
- Per-type business logic rules
- No double-spend against mempool
Complete Transaction Type Reference
Base Transactions (0x00–0x08)
| Code | Name | Purpose |
|---|---|---|
0x00 | CoinBase | Block reward distribution |
0x01 | RegisterAsset | Register new asset type |
0x02 | TransferAsset | Standard ELA transfer |
0x03 | Record | Data recording on-chain |
0x04 | Deploy | Reserved (unused) |
0x05 | SideChainPow | Sidechain PoW proof submission |
0x06 | RechargeToSideChain | Deposit ELA to sidechain |
0x07 | WithdrawFromSideChain | Withdraw ELA from sidechain |
0x08 | TransferCrossChainAsset | Cross-chain transfer |
BPoS Validator Transactions (0x09–0x15)
| Code | Name | Purpose |
|---|---|---|
0x09 | RegisterProducer | Register as BPoS validator |
0x0a | CancelProducer | Cancel producer registration |
0x0b | UpdateProducer | Update producer info |
0x0c | ReturnDepositCoin | Retrieve staked deposit |
0x0d | ActivateProducer | Re-activate after inactivity |
0x0e | IllegalProposalEvidence | Report illegal DPoS proposal |
0x0f | IllegalVoteEvidence | Report illegal DPoS vote |
0x10 | IllegalBlockEvidence | Report illegal block production |
0x11 | IllegalSidechainEvidence | Report sidechain misbehavior |
0x12 | InactiveArbitrators | Mark arbiters as inactive |
0x13 | UpdateVersion | Protocol version update |
0x14 | NextTurnDPOSInfo | Announce next arbiter set |
0x15 | ProposalResult | Record proposal outcome |
DAO Transactions (0x21–0x31)
| Code | Name | Purpose |
|---|---|---|
0x21 | RegisterCR | Register as Council candidate |
0x22 | UnregisterCR | Unregister candidacy |
0x23 | UpdateCR | Update candidate info |
0x24 | ReturnCRDepositCoin | Return Council deposit |
0x25 | CRCProposal | Submit Council proposal |
0x26 | CRCProposalReview | Council member reviews proposal |
0x27 | CRCProposalTracking | Track proposal progress |
0x28 | CRCAppropriation | Appropriate funds from treasury |
0x29 | CRCProposalWithdraw | Withdraw proposal funds |
0x2a | CRCProposalRealWithdraw | Execute actual withdrawal |
0x2b | CRAssetsRectify | Rectify CR asset UTXOs |
0x2c | ReturnCrossChainDepositCoin | Return failed cross-chain deposits |
0x31 | CRCouncilMemberClaimNode | Council member claims DPoS node |
System Transitions (0x41–0x51)
| Code | Name | Purpose |
|---|---|---|
0x41 | RevertToPOW | Switch to pure PoW |
0x42 | RevertToDPOS | Restore DPoS consensus |
0x51 | ReturnSideChainDepositCoin | Return failed sidechain deposits |
BPoS Staking (0x60–0x66)
| Code | Name | Purpose |
|---|---|---|
0x60 | DposV2ClaimReward | Claim BPoS voter rewards |
0x61 | DposV2ClaimRewardRealWithdraw | Execute reward withdrawal |
0x62 | ExchangeVotes | Convert ELA to stake votes |
0x63 | Voting | Cast BPoS votes with lock time |
0x64 | ReturnVotes | Return staked votes |
0x65 | VotesRealWithdraw | Execute vote return |
0x66 | RecordSponsor | Record block confirm sponsor |
NFT Transactions (0x71–0x72)
| Code | Name | Purpose |
|---|---|---|
0x71 | CreateNFT | Create NFT from staking position |
0x72 | NFTDestroyFromSideChain | Destroy NFT returning from sidechain |
UTXO Model
ELA uses a UTXO model like Bitcoin. Each transaction consumes previous outputs (inputs) and creates new ones.
Output types:
| Code | Name | Purpose |
|---|---|---|
0 | OTNone | Standard transfer |
1 | OTVote | DPoS v1 voting |
2 | OTMapping | Mapping payload |
3 | OTCrossChain | Cross-chain transfer metadata |
4 | OTWithdrawFromSideChain | Sidechain withdrawal metadata |
5 | OTReturnSideChainDepositCoin | Failed deposit return |
6 | OTDposV2Vote | BPoS voting with lock time |
7 | OTStake | Staking/exchange votes |
The node maintains an in-memory LRU UTXO cache (100,000 entries). Cache misses fall through to the database.
Validator Election
Composition: ~70 community-elected validators + 12 Council validators (always active). See nodes.elastos.net for current counts.
BPoS weight formula:
weight = log10((LockTime - BlockHeight) / 7200 * 10)
effectiveVotes = stakedELA * weight
Producer states: Pending -> Active -> Inactive/Canceled/Illegal -> Returned
- Inactivity: 1,440 missed rounds (~2 days) triggers
Inactivestate - Illegal behavior: 200 ELA deducted from deposit; can re-register with a new deposit
Coinbase Distribution
Halving: Every 1,051,200 blocks (~4 years). Current reward: 0.761 ELA. See ELA Halving.
Fee Model
| Fee | Amount | ELA |
|---|---|---|
| Min transaction fee | 100 sela | 0.000001 |
| Min cross-chain fee | 10,000 sela | 0.0001 |
| Deposit return fee | 100 sela | 0.000001 |
| Proposal withdrawal fee | 10,000 sela | 0.0001 |
1 ELA = 100,000,000 sela. Transactions are prioritized by fee-per-KB for block inclusion.
Source Code
The main chain node is implemented in Go: Elastos.ELA
Key packages: blockchain/ (chain, store, validation), dpos/ (consensus), pow/ (mining), cr/state/ (DAO governance), core/types/ (block/tx structures), servers/ (RPC interfaces).