Sidechain Framework
Elastos sidechains share a common Go framework that provides cross-chain verification, merged mining linkage, and transaction types. On top of this base, two production sidechains run as Geth forks with custom precompiled contracts.
Base Sidechain Transaction Types
| Code | Name | Purpose |
|---|---|---|
0x00 | CoinBase | Block reward |
0x01 | RegisterAsset | Asset registration (ELA token) |
0x02 | TransferAsset | Standard ELA transfer |
0x05 | SideChainPow | Links sidechain block to main chain mining |
0x06 | RechargeToSideChain | Deposit: main chain ELA to sidechain |
0x07 | WithdrawFromSideChain | Withdraw: sidechain ELA to main chain |
0x08 | TransferCrossChainAsset | Cross-chain transfer payload |
Cross-Chain Safety Valve
Cross-chain transfers are automatically rejected when the main chain's consensus is in PoW-only mode. This prevents exploits during consensus transitions.
ESC: Elastos Smart Chain
| Property | Value |
|---|---|
| Chain ID | 20 |
| Base | go-ethereum (Geth) fork |
| Consensus | PBFT with BPoS validators |
| Signing curve | secp256k1 (standard Ethereum) |
| P2P port | 20638 |
| JSON-RPC port | 20636 |
| WebSocket port | 20632 |
10 Custom Precompiled Contracts
ESC extends the standard EVM with custom precompiles at addresses 1000–1009:
| Address | Name | Purpose |
|---|---|---|
| 1000 | GetProducers | BPoS producer info at a given block height |
| 1001 | GetArbiters | Current arbiter set at a given block height |
| 1002 | pbkVerifySignature | secp256k1 signature verification |
| 1003 | pledgeBillVerify | Pledge bill multi-sig verification |
| 1004 | GetStakeInfo | BPoS staking info for an address |
| 1005 | GetCandidateVotes | Candidate vote tallies at a given height |
| 1006 | GetAllStakeInfo | Network-wide staking data |
| 1007 | GetHashByHeight | Block hash at a given height |
| 1008 | P256Verify | NIST P-256 (secp256r1) signature verification |
| 1009 | GetHeaderInfo | Block header data at a given height |
P256Verify (1008) is particularly important — it bridges the main chain's P-256 curve into the secp256k1 EVM environment, enabling contracts to verify arbiter signatures.
Cross-Chain Processing
Deposits: When the arbiter calls sendrechargetransaction, the ESC node fetches the tx and Merkle proof from the main chain, verifies via its SPV light client, deduplicates, and mints ELA.
Withdrawals: User sends ELA to the cross-chain contract. The contract burns it and emits a PayloadReceived event. The arbiter detects this via getwithdrawtransactionsbyheight and creates a withdrawal on the main chain.
EID: Elastos Identity Chain
| Property | Value |
|---|---|
| Chain ID | 22 |
| Base | go-ethereum (Geth) fork |
| Consensus | PBFT with BPoS validators |
| P2P port | 20648 |
| JSON-RPC port | 20646 |
| WebSocket port | 20642 |
3 DID Precompiled Contracts
| Address | Name | Purpose |
|---|---|---|
22 (0x16) | operationDID | Create, update, or deactivate DID documents |
23 (0x17) | resolveDID | Resolve a DID string to its current document |
2007 (0x7D7) | kyc | Custom DID identity operations |
DID documents are stored as transaction payloads. The precompiled contracts index these by DID and replay operations chronologically during resolution.
PBFT Consensus
Both ESC and EID use PBFT (Practical Byzantine Fault Tolerance) with the 12 Council members as consensus validators.
| Property | Value |
|---|---|
| Finality | Instant — no block reorganizations |
| BFT threshold | 2/3 supermajority |
| Fault tolerance | Up to 1/3 malicious validators |
| Safety valve | Cross-chain blocked if main chain falls to PoW |
| Arbiter sync | Validator set synced from main chain via SPV |