Skip to main content

Differences between Kakarot Starknet and Ethereum

Although Kakarot on Starknet is Ethereum-compatible and aims to support the latest features of Ethereum (e.g. Cancun new opcodes), it still has some edge case behaviors.

EVM opcodes

The below opcodes differ in behavior between Ethereum and Kakarot:

ItemEthereumKakarot
BLOCKHASHGet the hash of one of the 256 most recent complete blocksThe last 10 blocks are not available, and 0 is returned instead
BLOBBASEFEEGet the current data-blob base-feeReturn 1 as there are no blobs on Kakarot. Corresponds to MIN_BASE_FEE_PER_BLOB_GAS as per EIP-4844
BLOBHASHGet blob versioned hashes at indexReturn 0 as there are no blobs on Kakarot

EVM precompiles

The below precompiles differ in behavior between Ethereum and Kakarot:

ItemEthereumKakarot
ecPairingBilinear function on groups on the elliptic curve alt_bn128Not supported
ModexpArbitrary-precision exponentiation under moduloNot supported
Point evaluationVerify p(z) = y given commitment that corresponds to the polynomial p(x) and a KZG proof. Also verify that the provided commitment matches the provided versioned_hash.Not supported
P256 Verification (secp256r1 - RIP-7212)Not SupportedP256 is used in Apple’s Secure Enclave, Webauthn, Android Keychain. Enables many use cases such as cheap FaceID signature verification for smart wallets on Kakarot.

EVM State computation

The below state computation differs in behavior between Ethereum and Kakarot:

ItemEthereumKakarot
Block hash computationkeccak256(RLP.encode(Block Header))pedersen(Starknet Block Header)
State root computationRoot of state keccak-MPTposeidon(root of contract pedersen-MPT, root of contract class pedersen-MPT)
Transaction receiptTransaction receipt is available once a transaction is minedTransaction receipt is available once a transaction is processed and guaranteed to be mined. This means that blockhash field of the receipt is optional and will be non-null only once the transaction is mined.

Transaction reversion

In Ethereum, a transaction can be reverted if validation parameters are incorrect, if it runs out of gas or if it fails on the contract level. Since Kakarot is a layer 2 solution, additional revert reasons can occur during the transaction. We have currently identified the below issues which can cause some problems with the traditional EVM tooling:

  • Cairo VM out of steps: in Kakarot, we execute the EVM as a Cairo program, which can run out of execution steps. This causes the Cairo program itself (and not the EVM) to run out of "gas", causing a reversion of the transaction. This is a discrepancy with Ethereum's behavior, causing tooling such as cast run TRANSACTION_HASH to give a different result than the outcome on Kakarot.