EVM Compatibility Layer
The EVM Compatibility Layer implements the Ethereum Virtual Machine specification to enable Solidity smart contracts to run on IBVM.
EVM Implementation
IBVM implements the full EVM instruction set as specified in the Ethereum Yellow Paper, with the following modifications:
Gas costs denominated in BTC (satoshis) instead of ETH
Block gas limit calibrated for Bitcoin block times
Modified precompiled contracts for Bitcoin-specific operations
Instruction Set Support
The EVM implementation supports all standard EVM opcodes including:
Stack manipulation (PUSH, POP, DUP, SWAP)
Arithmetic operations (ADD, MUL, SUB, DIV, etc.)
Bitwise operations (AND, OR, XOR, NOT)
Comparison operations (LT, GT, EQ, etc.)
Environmental information (CALLER, CALLVALUE, etc.)
Block information (BLOCKHASH, COINBASE, etc.)
Memory operations (MLOAD, MSTORE, etc.)
Storage operations (SLOAD, SSTORE)
Program control flow (JUMP, JUMPI, etc.)
System operations (CREATE, CALL, etc.)
Gas Computation
Gas cost in IBVM is calculated similarly to Ethereum but denominated in satoshis:
$gas_cost = \sum_{op \in tx} gas(op) \times gas_price$
Where:
$gas(op)$ is the base gas cost of each operation
$gas_price$ is the user-specified gas price in satoshis/gas unit
State Representation
The IBVM state is organized as a Merkle Patricia Trie, similar to Ethereum:
Account State: A mapping of addresses to account states
Each account has: nonce, balance, storageRoot, codeHash
$AccountState = (nonce, balance, storageRoot, codeHash)$
Storage Trie: For each account, a separate trie maps 256-bit keys to 256-bit values
$Storage: 2^{256} \rightarrow 2^{256}$
State Root: A 256-bit hash that uniquely identifies the entire state
$StateRoot = H(AccountState_1 || AccountState_2 || ... || AccountState_n)$
Account Representation
Each account in IBVM is represented as:
$Account = (nonce, balance, storageRoot, codeHash)$
Where:
$nonce$: Counter used to ensure each transaction is processed only once
$balance$: Amount of BTC held by the account (in satoshis)
$storageRoot$: Root hash of the storage trie
$codeHash$: Hash of the account's contract code (or 0 if not a contract)
Last updated