EVM Compatibility
Mersennet implements an EVM-compatible execution environment, allowing developers to deploy and run existing Ethereum smart contracts with minimal or no modification. This document describes the EVM implementation, supported features, and differences from Ethereum mainnet.
Overviewβ
| Aspect | Mersennet |
|---|---|
| EVM Version | Shanghai |
| Chain ID | 7919 |
| Token | PRIM (18 decimals) |
| Block Time | ~1 second |
Shanghai EVMβ
Mersennet targets the Shanghai EVM specification, which includes:
- All pre-Shanghai opcodes and semantics
- PUSH0 (EIP-3855) β Push constant 0 onto the stack
- EVM Object Format (EOF) support for future contract upgrades
This ensures compatibility with the vast majority of Solidity contracts and tooling (Hardhat, Foundry, Remix, and standard wallets).
Supported Opcodesβ
Mersennet supports the standard Ethereum opcodes defined in the Shanghai spec, including:
- Arithmetic: ADD, SUB, MUL, DIV, MOD, etc.
- Comparison: LT, GT, SLT, SGT, EQ, etc.
- Bitwise: AND, OR, XOR, NOT, SHL, SHR, SAR
- Crypto: KECCAK256, ECRE cover, ECRECOVER
- Memory/Storage: MSTORE, MLOAD, SLOAD, SSTORE
- Control flow: JUMP, JUMPI, PC, JUMPDEST
- System: CALL, DELEGATECALL, STATICCALL, CREATE, CREATE2
- Block/Context: BLOCKHASH, TIMESTAMP, NUMBER, etc.
Precompilesβ
Standard Ethereum Precompilesβ
Mersennet supports all standard Ethereum precompiles:
| Address | Precompile | Description |
|---|---|---|
| 0x01 | ecRecover | ECDSA signature recovery |
| 0x02 | SHA256 | SHA-256 hash |
| 0x03 | RIPEMD160 | RIPEMD-160 hash |
| 0x04 | identity | Identity (copy input to output) |
| 0x05 | modexp | Modular exponentiation |
| 0x06 | ecAdd | Elliptic curve point addition |
| 0x07 | ecMul | Elliptic curve scalar multiplication |
| 0x08 | ecPairing | BN254 pairing |
Mersennet Extension: PrimeOrdersβ
Mersennet adds a custom precompile for the native order matching engine:
| Address | Precompile | Description |
|---|---|---|
| 0x0100 | PrimeOrders | Native on-chain CLOB |
See PrimeOrders (On-chain CLOB) for full documentation.
Gas Meteringβ
Mersennet uses gas metering consistent with Ethereum:
- Each opcode has a cost (e.g. ADD = 3, SSTORE = 20,000 for cold)
- Transactions specify a
gasLimit; execution stops if gas is exhausted - Gas is paid in PRIM (converted at the current gas price)
Gas costs align with Ethereum's Shanghai spec for predictable behavior when porting contracts.
Differences from Ethereum Mainnetβ
Transaction Formatβ
Mersennet may use a custom transaction format that differs from Ethereum's legacy or EIP-1559 formats. Key points:
- Transactions still include:
from,to,value,data,gasLimit,gasPrice(or equivalent) - EIP-1559 (dynamic base fee + priority fee) may not be fully implemented yetβcheck the current network configuration
- Chain ID 7919 is used for replay protection
No EIP-1559 Dynamic Fees (Yet)β
As of the current implementation, Mersennet may not support EIP-1559's dynamic base fee:
- Ethereum: Base fee adjusts per block based on target utilization
- Mersennet: May use a fixed or simpler fee model
Validators earn primarily from block rewards, not transaction fees. Fee market parameters can be updated via governance.
Block Structureβ
Mersennet blocks include additional fields beyond standard Ethereum:
- Rewards: Per-validator block reward distribution
- PrimeOrders events: Order submissions, trades, liquidations (if applicable)
The RPC and block structure expose these for explorers and indexers.
Native Tokenβ
- Ethereum: ETH (18 decimals)
- Mersennet: PRIM (18 decimals)
Same decimal precision, so contract logic that assumes 18 decimals works unchanged.
Summaryβ
| Feature | Status |
|---|---|
| Shanghai EVM | β Supported |
| Standard opcodes | β Supported |
| Standard precompiles | β Supported |
| PrimeOrders precompile (0x0100) | β Supported |
| Custom tx format | β οΈ May differ |
| EIP-1559 | β οΈ Check network config |
| Gas metering | β Ethereum-compatible |
Mersennet is designed for EVM ecosystem compatibilityβdeploy your contracts, use your tools, and leverage the native PrimeOrders precompile for advanced DeFi strategies.