Ethereum & DogeOS Differences

A number of technical details differ between Ethereum mainnet’s EVM and DogeOS’s modified design for a zkEVM. Below you can see those differences as they exist on DogeOS and DogeOS Testnet.

For open-source contributors and infrastructure builders, please contact our team for additional support.

EVM Opcodes

OpcodeSolidity equivalentDogeOS Behavior
BLOCKHASHblock.blockhashReturns keccak(chain_id || block_number) for the last 256 blocks.
COINBASEblock.coinbaseReturns the pre-deployed fee vault contract address.
DIFFICULTY / PREVRANDAOblock.difficultyReturns 0.
SELFDESTRUCTselfdestructDisabled. If the opcode is encountered, the transaction will be reverted.1

We support the cancun EVM target and the latest Solidity version 0.8.26.

EVM Precompiles

The RIPEMD-160 (address 0x3) blake2f (address 0x9), and point evaluation (address 0x0a) precompiles are currently not supported. Calls to unsupported precompiled contracts will revert. We plan to enable these precompiles in future hard forks.

The modexp precompile is supported but only supports inputs of size less than or equal to 32 bytes (i.e. u256).

The ecPairing precompile is supported, but the number of points(sets, pairs) is limited to 4, instead of 6.

The other EVM precompiles are all supported: ecRecover, identity, ecAdd, ecMul.

Precompile Limits

Because of a bounded size of the zkEVM circuits, there is an upper limit on the number of calls that can be made for some precompiles. These transactions will not revert, but simply be skipped by the sequencer if they cannot fit into the space of the circuit.

Precompile / OpcodeLimit
keccak2563157
ecRecover119
modexp23
ecAdd50
ecMul50
ecPairing2

State Account

Additional Fields

We added two fields in the current 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

Related to this, we maintain two types of codehash for each contract bytecode: Keccak hash and Poseidon hash.

KeccakCodeHash is kept to maintain compatibility for EXTCODEHASH. PoseidonCodeHash is used for verifying the correctness of bytecodes loaded in the zkEVM, where Poseidon hashing is far more efficient.

CodeSize

When verifying EXTCODESIZE, it is expensive to load the whole contract data into the zkEVM. Instead, we store the contract size in storage during contract creation. This way, we do not need to load the code — a storage proof is sufficient to verify this opcode.

Transaction Ordering

Similarly to Ethereum, the DogeOS sequencer aims to prioritize executable transactions based on their “tip” (priority fee). In most cases, transactions will be included in the next block in decreasing order of their tips.

However, just like in Ethereum, this ordering is not guaranteed by the protocol, and some blocks might diverge from it. In particular, during periods of low mempool congestion, the sequencer will process transactions on a first-come-first-served basis, so some transactions might precede others with higher tip in the same block.

Transaction Fees

The fee charged to DogeOS transactions:

  • L2 gas fee: similar to L1, the amount of L2 execution fee equals to L2_gas_price * L2_gas_used, covering the following costs:
    • L2 sequencer execution & storage cost
    • Validity proof verification and finalization cost on L1
    • Prover cost

For more information, see Transaction Fees on DogeOS.


Footnotes

  1. Will change to adopt Ethereum’s solution in the future. ↩

What's Next