Skip to main content

Difference between Morph and Ethereum

There are several technical differences between Ethereum’s EVM and Morph's optimistic zkEVM.

We’ve compiled a list to help you understand these distinctions better.

For most Solidity developers, these technical details won't significantly impact your development experience.

EVM Precompiles Difference

The RIPEMD-160 (address 0x3), blake2f (address 0x9), and point evaluation (address 0x0a) precompiles are currently unsupported. Calls to these unsupported precompiled contracts will result in a transaction revert.

The modexp precompile is supported, but it only accepts inputs that are 32 bytes or smaller (i.e., u256).

The ecPairing precompile is also supported; however, the maximum number of points (sets or pairs) is limited to 4, rather than 6.

All other EVM precompiles are fully supported: ecRecover, identity, ecAdd, and ecMul.

Certain Precompile Limits

There is a maximum limit on the number of calls that can be made to certain precompiles due to the bounded size of zkEVM circuits.

While these transactions won't be reverted, the sequencer will skip them if they exceed the circuit's capacity.

Precompile / OpcodeLimit
keccak2563157
ecRecover119
modexp23
ecAdd50
ecMul50
ecPairing2

EVM Opcodes Difference

OpcodeSolidity equivalentMorph Behavior
BLOCKHASHblock.blockhashReturns keccak(chain_id || block_number) for the last 256 blocks.
COINBASEblock.coinbaseReturns the pre-deployed fee vault contract address. See Contracts
DIFFICULTY / PREVRANDAOblock.difficultyReturns 0.
SELFDESTRUCTselfdestructDisabled. If the opcode is triggered, the transaction will be reverted.
BLOBHASHtx.blob_versioned_hashes[index]Not supported
BLOBBASEFEEblob_base_fee = BLOBBASEFEE()Not supported
Several opcode not available

BLOBHASH and BLOBBASEFEE are not supported on Morph yet.

EIP-4788 for accessing the Beacon Chain block root is not supported too.

State Account Structure Difference

Additional Fields

There are two additional fields in the existing StateAccount object: PoseidonCodehash and CodeSize.

type StateAccount struct {
Nonce uint64
Balance *big.Int
Root common.Hash // merkle root of the storage trie
KeccakCodeHash []byte // still the Keccak codehash
// added fields
PoseidonCodeHash []byte // the Poseidon codehash
CodeSize uint64
}

CodeHash

In this context, we keep two varieties of code hashes for each contract's bytecode: the Keccak hash and the Poseidon hash.

The KeccakCodeHash is preserved to ensure compatibility with EXTCODEHASH, while the PoseidonCodeHash is utilized for verifying the accuracy of bytecodes loaded in the zkEVM, as Poseidon hashing offers significantly greater efficiency.

Block Time Difference

Block Time Subject to Change

Blocks are produced every second, with an empty block generated if there are no transactions for 5 seconds. However, this frequency may change in the future.

To compare, Ethereum has a block time of ~12 seconds.

Reasons for Faster Block Time in Morph

User Experience:

  • A faster, consistent block time provides quicker feedback, enhancing the user experience.

  • Optimization: As we refine the zkEVM circuits in our testnets, we can achieve higher throughput than Ethereum, even with a smaller gas limit per block or batch.

Notice:

  • TIMESTAMP will return the timestamp of the block. It will update every second.
  • BLOCKNUMBER will return an actual block number. It will update every second. The one-to-one mapping between blocks and transactions will no longer apply.