How it works
A Starknet contract in this registry makes a narrow, checkable claim: it is the Ethereum contract's source, compiled by hyperdrive. Here is what backs that claim, and where it stops.
Same code
reproducibleThe source comes from Sourcify, which matched it to the bytecode on Ethereum. hyperdrive compiles it deterministically: the same source, compiler settings, hyperdrive version and hyperdrive.toml always give the same Starknet class hashes. If they equal the hashes deployed on Starknet, the deployment is that source.
Ethereum bytecode
Start from the contract deployed on Ethereum, by address.
Sourcify source
Fetch the source that Sourcify matched to that bytecode, with the exact compiler settings.
Deterministic build
hyperdrive compiles that source. The same inputs always give the same Starknet class hashes.
Starknet, attested
The class hashes must equal the deployed ones. The match is recorded in an on-chain registry.
hyperdrive verify <ethereum address> --starknet <starknet address> --network sepoliaAn attestation registry on Starknet records who checked and what they got. Anyone running verify can add an attestation; you do not need to trust the first attester.
Proved
Lean 4Checked by Lean, with no sorry and only standard axioms (hyperdrive prove):
- The lowering. Every execution of a Yul statement, function or program is matched by its Cairo lowering, for any meaning of the builtins.
- Word arithmetic. The runtime's 256-bit arithmetic equals the Yellow Paper's definitions.
- Memory.
mload,mstore,mstore8and the byte copies read and write exactly the EVM's bytes. - Storage and hashing. keccak256 hashes exactly the memory bytes; storage behaves as the EVM's word map (assuming Poseidon is collision resistant).
- Calls. Calldata, returndata, revert data and event data cross a Starknet call unchanged; call frames, rollback, CREATE and CREATE2 addresses and nonces behave as on the EVM.
Tested
revmNot proved, but compared call by call with a reference EVM (revm): the remaining runtime builtins (precompiles, value transfers), every example contract and the OpenZeppelin tests. On a contract page, "Tested against the EVM" lists the calls that were run for that contract and whether Cairo and the EVM agreed on return data, reverts, events, storage and balances.
Assumed
per contractEach build lists the assumptions it relies on in its certificate, shown on the contract page. The common ones:
- A-STORAGE-HASH. hyperdrive's Poseidon hashes have no collisions on the inputs a contract can reach (storage slots and hash caches).
- A-ALIAS. Contracts are registered with the alias registry, and an unregistered account's low 160 bits are not a registered alias. Two registered addresses never share an alias (that part is proved).
- A-SLOT-HASH. When mapping slots use Poseidon instead of keccak256, neither hash collides on reachable slots and constant slots stay clear of hashed ones. Off-chain tools that compute a mapping's slot number must use hyperdrive's slot function.
- A-SLOT-MODE. Code built with Poseidon slots and code built with keccak256 slots never share storage; an upgrade must keep the slot mode.
- A-SPLIT. A contract split into several classes runs each part with the main contract's storage, caller and address, and the part classes on the network are the ones whose hashes are embedded.
- Mapped findings and acknowledged divergences. Each mapped behaviour (for example,
msg.senderis the caller's 160-bit alias) and each divergence the builder accepted, with their stated reason.
Trusted
not checked hereSome components are trusted rather than proved or tested by hyperdrive:
- solc, which turns Solidity into Yul. hyperdrive starts from solc's Yul, so a solc bug affects both chains alike.
- The Yul parser and the Cairo printer in hyperdrive, and the Cairo compiler and Sierra-to-CASM compiler.
- The Starknet OS, which runs the classes.
- Sourcify, for the match between the source and the Ethereum bytecode. You can check that match yourself with any Solidity verifier.
Same code, not same state
A Starknet deployment starts with empty storage. Balances, positions, owners and settings on Ethereum do not carry over, and the deployment is not run by the Ethereum protocol's team unless the registry says so. Equivalence here is about behaviour: the same calls on the same state give the same results.
Starknet also differs in ways no compiler can hide: block times, gas units and account contracts. Those show up as findings, below.
Tiers
Every finding has a tier. Divergent findings must be acknowledged with a reason before a build counts; blocked ones stop the build.
proved equivalent, no assumption.
equivalent under a recorded assumption.
behaves differently on Starknet.
cannot be preserved; the source must change.
Diagnostic codes
Generated by hyperdrive explain --markdown. hyperdrive explain HD0151 explains one code in the terminal.
| Code | Tier | Meaning | What to do |
|---|---|---|---|
| HD0101 | mapped | msg.sender is the caller's 160-bit alias | no action needed; Ethereum-key accounts keep their Ethereum address |
| HD0102 | mapped | address(this) is this contract's 160-bit alias | no action needed |
| HD0103 | mapped | tx.origin is the alias of the transaction's account contract | avoid tx.origin for authorization; it is mapped but rarely what you want |
| HD0110 | mapped | msg.value is an amount of the network's value token | no action needed; the registry admin sets the value token (ETH or STRK) once per network |
| HD0111 | mapped | balance reads the value token balance | no action needed |
| HD0120 | exact | storage slot mapped through the hyperdrive storage hash | |
| HD0121 | mapped | transient storage is scoped by transaction hash | no action needed |
| HD0122 | exact | immutable stored in a reserved storage slot | |
| HD0130 | mapped | EVM log emitted as a Starknet event | indexers read topics from event keys and data from event data |
| HD0140 | mapped | code size check means 'is deployed' on Starknet | every Starknet account is a contract: code-length checks on users are always true |
| HD0141 | divergent | extcodehash returns a Starknet class hash | acknowledge if you only compare against zero |
| HD0142 | blocked | extcodecopy cannot read EVM bytecode on Starknet | remove bytecode introspection |
| HD0143 | divergent | code-length check on a user address: every Starknet account is a contract | replace msg.sender.code.length == 0 style checks with an allowlist or an ERC165 check |
| HD0150 | divergent | gasleft() uses Starknet gas units | acknowledge, or remove logic that depends on exact gas amounts |
| HD0151 | divergent | block.timestamp / block.number follow Starknet block cadence | acknowledge if your logic uses wall-clock windows, not block counts |
| HD0152 | mapped | block.chainid is the Starknet chain id | no action needed; EIP-712 domains will use the Starknet chain id |
| HD0153 | divergent | blockhash uses Starknet block hashes, unavailable for the last 10 blocks | acknowledge, or avoid blockhash |
| HD0154 | divergent | fee and coinbase values have no Starknet equivalent | acknowledge; these return fixed values |
| HD0155 | blocked | block.prevrandao / difficulty has no Starknet equivalent | use an oracle (for example a VRF) instead |
| HD0160 | mapped | external call routed through the alias registry | target addresses resolve through aliases or link symbols in hyperdrive.toml |
| HD0161 | mapped | a failing external call returns false with its revert data (Starknet v0.13.4 or later) | no action needed; deploy to a network running Starknet v0.13.4 or later |
| HD0162 | mapped | delegatecall runs the target's class on this contract's storage (library call) | no action needed |
| HD0163 | mapped | new Contract deploys the child's class declared in the alias registry | declare each child class once per network: registry.declare(selector(name), class_hash) |
| HD0164 | mapped | selfdestruct sends the balance and stops (EIP-6780) | no action needed, unless the contract self-destructs in the transaction that created it |
| HD0166 | mapped | new Contract{salt: s} deploys at the EVM's CREATE2 address | declare each child class once per network, as for create |
| HD0167 | blocked | callcode is deprecated and not supported | use delegatecall |
| HD0168 | blocked | this precompile is not supported | every precompile of the Osaka EVM (0x01..0x11, 0x100) is supported; this one is from a later fork |
| HD0170 | mapped | hardcoded address resolved through a link | the [links] entry in hyperdrive.toml says what the address is on Starknet |
| HD0171 | mapped | linked library address resolved through the alias registry | deploy the library first; its alias is registered under the library name |
| HD0172 | blocked | hardcoded address with no link | add it to hyperdrive.toml: [links] NAME = { evm = "0x...", translate = "Contract" } |
| HD0180 | blocked | runtime code introspection (codecopy/codesize/data*) is not supported | move constant data into storage or calldata |
| HD0181 | blocked | verbatim bytecode cannot be translated | replace inline bytecode with Yul |