xhavic.com
GitHub (Coming Soon) Whitepaper
Docs / How Xhavic Works

Execution Layer

How Xhavic's EVM-compatible execution layer processes transactions with full Ethereum opcode support.

Xhavicโ€™s execution layer is the first layer of the modular stack. It processes every transaction, updates state, and produces execution traces used by the fraud proof system.

EVM Compatibility

Xhavic runs a fully EVM-equivalent execution environment. Every Ethereum opcode is supported with identical semantics:

ParameterValue
Word size256-bit
Stack depth1024
Hashing algorithmKeccak-256
Address format20-byte Ethereum addresses
EIP supportUp to Shanghai (EIP-4895)

Any smart contract deployed on Ethereum can be deployed on Xhavic without modification. Solidity, Vyper, and Huff contracts all work as-is.

How Execution Works

  1. Transaction arrives โ€” Users submit transactions to the sequencerโ€™s mempool via JSON-RPC
  2. Ordering โ€” The sequencer orders transactions with MEV-protection (threshold encryption)
  3. State transition โ€” The EVM processes each transaction, updating account balances, storage slots, and contract state
  4. Receipt generation โ€” Execution receipts include gas used, logs emitted, and status
  5. State root โ€” A Merkle-Patricia trie root is computed from the new global state

Execution Differences from Ethereum

While opcodes behave identically, there are minor environmental differences:

FeatureEthereumXhavic
block.timestamp~12s granularity~2s granularity
block.basefeeEIP-1559 dynamicFixed low base fee
COINBASEValidator addressSequencer address
DIFFICULTY / PREVRANDAOBeacon chain valueDeterministic pseudo-random
L1 block numberblock.numberAvailable via L1Block predeploy

For full compatibility details, see Differences from Ethereum โ†’.

Predeploy Contracts

Xhavic includes system-level predeploy contracts at reserved addresses:

AddressContractPurpose
0x42...00L1BlockExposes L1 block data on L2
0x42...10GasPriceOracleL1 data fee estimation
0x42...20L2ToL1MessagePasserCross-chain message queue
0x00...F0โ€“FFOracle PrecompilesNative price feed access

Gas Metering

Gas costs on Xhavic are significantly lower than Ethereum but follow the same metering model. The L2 execution fee is denominated in XHAV and calculated as:

L2 Fee = gasUsed ร— l2BaseFee

See Fees & Gas โ†’ for the full cost model and comparison tables.