Skip to main content
ALL CHAINS

Wire Protocols

ELA P2P Message Format

All P2P messages follow this header format:

┌────────────┬────────────┬────────────┬────────────┐
│ Magic (4) │ CMD (12) │ Length (4) │ Checksum(4)│
├────────────┴────────────┴────────────┴────────────┤
│ Payload (variable) │
└────────────────────────────────────────────────────┘
  • Magic: 4-byte network identifier (different per network: mainnet, testnet, regnet)
  • CMD: 12-byte null-padded ASCII command name
  • Length: 4-byte little-endian payload length
  • Checksum: First 4 bytes of double-SHA-256 of payload

Message Types

CMDDirectionPurpose
versionBothProtocol version handshake
verackBothVersion acknowledgment
pingBothLiveness check
pongBothLiveness response
getaddrRequestRequest peer addresses
addrResponseSend known peer addresses
invBothInventory announcement (blocks, txs)
getdataRequestRequest full block/tx data
getblocksRequestRequest block hashes (sync)
blockResponseFull block (DposBlock with optional Confirm)
txBothTransaction
notfoundResponseRequested item not found
mempoolRequestRequest mempool contents
filteraddRequestAdd to bloom filter
filterclearRequestClear bloom filter
filterloadRequestLoad bloom filter
merkleblockResponsePartial Merkle tree (for SPV)
rejectResponseReject notification

Handshake Sequence

Initiator                          Responder
│ │
├── version ──────────────────────>│
│ │
│<────────────────────── version ──┤
│ │
├── verack ───────────────────────>│
│ │
│<─────────────────────── verack ──┤
│ │
│ (connection established) │

The version message contains:

  • Protocol version
  • Services bitmask
  • Timestamp
  • Node height
  • Nonce (for self-connection detection)
  • User agent string
  • Relay flag

DPoS P2P Messages

The BPoS consensus subsystem uses encrypted communication on port 20339:

CMDPurpose
proposalBPoS block proposal from on-duty validator
voteBPoS proposal vote (accept/reject)
confirmAggregated confirmation (2/3+ votes)
viewchangeView change request (when on-duty arbiter fails)
nextturndposinfoNext turn validator set announcement
cipheraddrObfuscated validator address exchange

Arbiter P2P Messages

Validators communicate via the DPoS P2P network using two message types:

const (
DistributeItemCommand = "disitem" // Multi-sig / Schnorr proposals + feedback
SendSchnorrItemCommand = "senditem" // Schnorr phase 3 trigger
)

DistributedItem Wire Format

┌──────────────────┬────────────┬──────────────────┬──────────────┐
│ ContentType (1) │ TxType (1) │ SignedData (var) │ Feedback (var)│
└──────────────────┴────────────┴──────────────────┴──────────────┘

Content types:

CodeNamePurpose
0x00MultisigContentClassic multi-sig proposal
0x01IllegalContentIllegal evidence
0x02SchnorrMultisigContent2Schnorr Phase 2 (R request)
0x03SchnorrMultisigContent3Schnorr Phase 3 (S request)
0x10AnswerMultisigContentMulti-sig co-signature
0x11AnswerIllegalContentIllegal evidence response
0x12AnswerSchnorrMultisigContent2Schnorr R response
0x13AnswerSchnorrMultisigContent3Schnorr S response

Transaction types:

CodeName
0x00WithdrawTransaction
0x01ReturnDepositTransaction
0x02NFTDestroyTransaction

ESC/EID Wire Protocol

Standard Ethereum devp2p protocol:

  • RLPx transport encryption
  • ETH/66 sub-protocol for block/tx propagation
  • Snap protocol for fast sync (optional)
  • Custom pbft sub-protocol for PBFT consensus messages

Carrier v2 DHT Wire Format

All DHT messages use CBOR (Concise Binary Object Representation) encoding over UDP:

┌──────────┬────────────┬──────────────────┐
│ Type (1) │ TxID (4) │ CBOR Payload │
└──────────┴────────────┴──────────────────┘

Message types:

  • 0x01: Request (PING, FIND_NODE, FIND_VALUE, STORE)
  • 0x02: Response
  • 0x03: Error

Each message is encrypted using the recipient's X25519 public key via NaCl CryptoBox.

SPV Bloom Filter Protocol

SPV clients use BIP37-style bloom filter negotiation:

Client                             Full Node
│ │
├── filterload(filter) ───────────>│ Set bloom filter
│ │
├── getblocks(locator) ───────────>│ Request headers
│ │
│<──────────── merkleblock+tx ─────┤ Filtered blocks
│<──────────── merkleblock+tx ─────┤
│ │
├── filteradd(element) ───────────>│ Add watch address
│ │
├── filterclear ──────────────────>│ Remove filter
│ │

False Positive Rate: Tracked via EWMA (Exponentially Weighted Moving Average) in fprate/fprate.go. When the false positive rate exceeds the target, the bloom filter is rebuilt with a lower FP target.