rsk.zone An independent Rootstock reference

EVM compatibility

Rootstock runs an EVM, and a contract compiled for Ethereum will usually deploy and run on it unchanged. "Usually" is doing a great deal of work in that sentence. This is where the consensus rules actually differ — not a list of features, but the rules a node must follow to stay on the network.

The rule that generates the others

Rootstock adopts EVM changes one RSKIP at a time, never by importing an Ethereum fork. Almost every difference below follows from that.

An Ethereum hard fork is a bundle: a set of EIPs that activate together. Rootstock takes individual items out of those bundles, at heights of its own, and leaves the rest. Gas costs in particular are fork-independent constants — they do not change when a network upgrade activates unless an RSKIP says so.

The consequence for anyone writing a node, a tool or an analyser: you cannot map a Rootstock upgrade onto an Ethereum specification and inherit its behaviour. Every such mapping is an approximation, and the places it is wrong are consensus failures. The table below says which opcodes exist. It says nothing about what they cost.

Opcode availability by upgrade — not a statement about gas
UpgradeMainnet blockNearest Ethereum specWhat Rootstock actually took
genesis0ByzantiumREVERT, STATICCALL, RETURNDATASIZE
orchid729,000ByzantiumRootstock-specific only
wasabi1001,591,000ByzantiumRSKIP125 created-contract nonce
twoToThree2,018,000ByzantiumRSKIP150 (call depth 400)
papyrus2002,392,700PetersburgSHL/SHR/SAR, CREATE2, CHAINID, SELFBALANCE
iris3003,614,800PetersburgRSKIP171, RSKIP197
hop4004,598,500PetersburgRootstock-specific only
fingerroot5005,468,000PetersburgRootstock-specific only
arrowhead6006,223,700IstanbulEIP-2028 only
arrowhead6316,549,300IstanbulRootstock-specific only
lovell7007,338,024ShanghaiPUSH0, initcode metering, TLOAD/TSTORE/MCOPY
reed8008,052,200ShanghaiRootstock-specific only
vetiver9008,804,200ShanghaiRootstock-specific only
Cross-checked

These activation heights were checked against the upgrade data this site collects separately from rskj's releases and its own activation config. Every upgrade the two have in common agrees exactly. The history page dates each one by the timestamp of its own activation block.

rskj — ActivationConfig.java

rskj — ConsensusRule.java

Chain parameters

The differences an integrator meets first.

Chain-level parameters
RootstockEthereum mainnet
Block interval~30 seconds~12 seconds
Block gas limit6,800,000~30,000,000
Native currencyRBTC, pegged 1:1 to BTCether
Total supply21,000,000 RBTC, preminedno fixed cap
Chain ID30 mainnet, 31 testnet1
Consensusmerge-mined with Bitcoinproof of stake since the Merge; proof of work before it
Address checksumEIP-1191, salted with the chain IDEIP-55
BIP-44 coin type137' mainnet, 37310' testnet60'

The minimum gas price is a consensus field, voted by miners. Every block header carries a minimumGasPrice, and a miner may move it by at most 1% per block away from its parent's. A transaction priced below the block's minimum is not valid in that block. Ethereum has no equivalent — EIP-1559's base fee is algorithmic rather than negotiated, and Rootstock did not adopt EIP-1559 at all.

Addresses are the same twenty bytes, but the checksum is not. Rootstock implements EIP-1191, which salts the checksum with the chain ID, so the same twenty bytes checksum differently on Rootstock mainnet, Rootstock testnet and Ethereum. A validator that assumes EIP-55 will reject valid Rootstock addresses. That is the single most common integration failure in this list.

RSKIP09 — minimum gas price

Rootstock docs — account-based addresses

The gas schedule that never moved

Ethereum has repriced its I/O-heavy opcodes repeatedly — EIP-150, EIP-1884, EIP-2200, EIP-2929 — to keep gas tracking real cost. Rootstock adopted none of them. The constants are fixed at every height.

Gas costs that differ, and the Ethereum change that made them differ
OperationRootstockEthereum, after repricingWhich EIP Rootstock declined
SLOAD200800EIP-1884
BALANCE400700EIP-1884
EXTCODEHASH400700EIP-1884
EXTCODECOPY base700100 + cold surchargeEIP-2929
SELFDESTRUCT5,000 flatvaries—
SELFDESTRUCT refund24,000, still0EIP-3529
New-account surcharge25,00025,000, only when value > 0EIP-161

SSTORE keeps Petersburg metering, permanently. No EIP-2200, no EIP-3529:

old == none && new != 0   ->  20,000
old != none && new == 0   ->   5,000  + 15,000 refund
otherwise                 ->   5,000

There is no gasleft <= 2300 reentrancy sentry, and the refund cap is Petersburg's rather than London's gas_used / 5.

EIP-150's 63/64 gas retention was never adopted either, and that one has visible consequences. A caller may hand a callee all of its remaining gas. On Ethereum a caller always keeps a sixty-fourth, which is why Ethereum's call depth is an emergent consequence of the gas limit rather than a number. On Rootstock there is nothing to exhaust, so the depth had to be stated outright — it is a fixed 400.

The same absence makes gas estimation exact. Ethereum's estimators binary-search the limit, executing a transaction around two dozen times, because the 63/64 rule makes the outcome non-monotonic in the limit. Rootstock can detect the all-gas-forwarded case directly and answer after a single run.

The one Istanbul gas change Rootstock took is EIP-2028 at arrowhead600 (block 6,223,700): non-zero calldata fell from 68 to 16 gas per byte. Nothing else from Istanbul came with it.

Why not reprice

The stated reason for declining the repricing EIPs is that Rootstock intends to charge storage rent at the cell level instead, which addresses the resource-exhaustion problem the repricings were patching. The costs also genuinely differ: operations that are slow on an Ethereum node can be fast on Rootstock, so inherited prices would not have matched real costs anyway. Whether rent arrives is a separate question — see RSKIP113, which was withdrawn.

rskj — GasCost.java

rskj — VM.java, doSSTORE

Account existence, and the absence of EIP-161

Rootstock has no EIP-158 or EIP-161. Existence in the state trie is the only test, and emptiness is not a concept.

This is the most consequential difference on the page, because it changes what several opcodes mean rather than what they cost.

That last pair explains a number on the state page: most accounts in the Unitrie hold no balance and have never sent a transaction. They exist because something once referred to them, and nothing removes them.

Self-destructed accounts are deleted at the end of the destroying transaction, not the end of the block. A later transaction in the same block sees the address as nonexistent — and by the rules above can re-create it as a fresh empty account.

Contract nonce. From wasabi100 (block 1,591,000) a contract created by the CREATE or CREATE2 opcode starts at nonce 1. A contract created by a top-level creation transaction is unaffected and starts at 0.

rskj — MutableRepository.java, isExist

RSKIP125 — created-contract nonce

RSKIP169 — EXTCODEHASH semantics

Call semantics

The call-stack limit is 400, not 1024, from twoToThree (block 2,018,000). On exceeding it the call pushes 0, refunds the requested child gas, and returns.

Return-data buffer semantics changed at iris300 (block 3,614,800) — a genuine rule change rather than a fix. Before it, a call-family instruction that resolved without running anything (empty-code callee, depth limit, insufficient endowment) left the previous call's return data in the buffer; EIP-211 clears on every call-family instruction and Rootstock did not. From iris300 such a call clears it.

A nested constructor's gas refund is discarded. A CALL merges its child frame's refund into the parent; a CREATE does not. Refunds earned inside a constructor invoked by the create opcode are simply lost.

A failing precompile call also changed at iris300. Before, the exception propagated out of the calling frame: the caller halted exceptionally, consumed all remaining gas, and pushed nothing. After, the failure is handled — 0 is pushed and surplus gas refunded.

COINBASE is not the fee recipient. It returns the block header's miner address, but transaction fees go to the REMASC contract, which distributes them later with delayed maturity. The two roles were separated deliberately, and a node that conflates them forks the first time any contract reads block.coinbase.

CHAINID and SELFBALANCE exist from papyrus200 (block 2,392,700) at their canonical tiers of 2 and 5 gas, with none of Istanbul's repricing. Before that height both are invalid opcodes and consume the frame's entire gas.

Transient storage and MCOPY exist from lovell700 (block 7,338,024): TLOAD, TSTORE, MCOPY. These are Ethereum Cancun opcodes sitting in an otherwise Shanghai-era feature set — the per-RSKIP rule in its purest form.

rskj — Program.java, getMaxDepth and createContract

RSKIP171 — return-data buffer

RSKIP197 — precompile failure handling

RSKIP446 — transient storage (EIP-1153)

The first thirteen fields are identical to Ethereum's: parentHash, unclesHash, coinbase, stateRoot, txTrieRoot, receiptTrieRoot, logsBloom, difficulty, number, gasLimit, gasUsed, timestamp and extraData. They are identical in name and position; difficulty is the exception in meaning, since Ethereum fixed it at zero at the Merge while Rootstock still uses it for difficulty. After the thirteenth field the two diverge completely.

Header fields from 14 onward. Position numbers are Rootstock's; Ethereum's own field order diverged at the Merge and again at Shanghai and Cancun
#Ethereum, pre-MergeEthereum today (proof of stake)RootstockWhat Rootstock holds there
14mixHashprevRandao — the beacon chain's randomness (EIP-4399)paidFeesTotal fees paid by the block's transactions, in wei
15noncepresent, required to be zerominimumGasPriceThe miner-voted floor for this block
16—baseFee (EIP-1559)uncleCountNumber of siblings included
17—withdrawalsRoot (Shanghai)ummRootRoot of a tree referencing other merge-mined chains
18—blobGasUsed, excessBlobGas, parentBeaconBlockRoot (Cancun)bitcoinMergedMiningHeaderThe 80-byte Bitcoin header carrying the proof of work
19——bitcoinMergedMiningMerkleProofInclusion proof for the Bitcoin coinbase
20——bitcoinMergedMiningCoinbaseTransactionThe coinbase tail carrying the RSKBLOCK: tag

mixHash and nonce were Ethash artefacts, and Rootstock never had an equivalent because its proof of work is Bitcoin's. On Ethereum they did not disappear at the Merge so much as change meaning: mixHash was redefined as prevRandao and now carries the beacon chain's randomness (EIP-4399), while nonce remains in the structure and is required to be zero (EIP-3675). difficulty is likewise fixed at zero there, though Rootstock still uses it for what it says. And baseFee has no Rootstock counterpart because EIP-1559 was never adopted.

The three merged-mining fields are what the merge-mining page takes apart.

Which Ethereum

Comparisons on this page are against Ethereum as it is now, after the Merge, unless they say otherwise. The distinction matters more than it looks: Ethereum's pre-Merge rules are the ones Rootstock was designed beside, and several of the differences here — uncles, block rewards, the meaning of a header nonce — are differences from a protocol that no longer exists in that form. Where a rule only makes sense against proof-of-work Ethereum, it is labelled.

A consequence worth knowing

Because the proof of work lives in an attached Bitcoin header rather than in the Rootstock header, a Rootstock block hash does not commit to any proof of work. A contract using BLOCKHASH as a randomness source is therefore far cheaper to manipulate here than the same pattern on Ethereum. Do not use BLOCKHASH for randomness on Rootstock. The Bridge can be queried for Bitcoin block hashes instead, which is both the intended route and a much more expensive one to attack.

Precompiled contracts

Rootstock implements all of Ethereum's active precompiles — including BLAKE2F (EIP-152), which earlier write-ups list as missing and which is present now — and adds its own at addresses well above Ethereum's range.

Rootstock-specific precompiles
AddressNamePurpose
0x…01000006BRIDGERegister peg-ins; query Bitcoin headers in the best chain
0x…01000008REMASCDistribute block rewards; called once per block
0x…01000009HD_WALLET_UTILSUtilities for Bitcoin token offerings
0x…01000010BLOCK_HEADERQuery Rootstock block headers for the past 4,000 blocks
0x…01000011ENVIRONMENTEnvironment queries
0x…01000016SECP256K1_ADDCurve point addition
0x…01000017SECP256K1_MULCurve point multiplication

BLOCK_HEADER is more interesting than it looks. BLOCKHASH reaches back 256 blocks, which is not enough for a layer-two dispute window. Four thousand blocks is — and four thousand is also the peg-out maturity and the REMASC reward maturity, which is not a coincidence.

The Bridge is a precompile too, so its behaviour is EVM behaviour for consensus purposes. It carries a large body of rules of its own, which the PowPeg page covers. Two cross-cutting ones belong here: a Bridge method that throws consumes only its declared gas, not all of it — called directly as a transaction it produces a successful receipt — and before RSKIP150, precompile output was written to memory without charging for the expansion.

Opcodes Rootstock added, then removed

Rootstock launched with EVM extensions of its own: DUPN and SWAPN for arbitrary stack access, REPLACECODE for secure code upgrades, TXINDEX for linking events, SEND for transfers without callbacks. They were removed in later upgrades.

The reason was not that they failed. The Solidity compiler did not support user-defined opcodes, and the community valued Ethereum compatibility over the improvements. It is a reasonable thing to know when reading old Rootstock material or old contracts: these opcodes appear in historical documentation and are not in the chain today. TXINDEX was later re-proposed as a precompile in RSKIP192.

For implementers

Almost every rule above was established by finding a mainnet block where an independent implementation diverged — not by reading a specification. That is worth stating plainly, because several of these rules contradict the RSKIPs that nominally describe them. Where the written spec and the deployed behaviour disagree, the network consented to the behaviour, and a node implementing the document would fork.

  1. Never infer a gas cost from an Ethereum fork. Treat the schedule as fixed data to be looked up.
  2. Do not implement EIP-161 semantics — including the parts most modern EVMs treat as unremarkable, such as the value > 0 gate on the new-account charge, or emptiness as distinct from nonexistence.
  3. Check against real blocks. A rule that looks stricter than the chain it must accept is a fork, however well argued.
Three rules with no public specification

Three consensus rules are referenced by the deployed code but have no document in the public RSKIPs repository: RSKIP150, RSKIP151 and RSKIP156. They are cited here by number, deliberately without a link, because there is nothing to link to. The call-depth limit of 400 — a rule any implementation must match exactly — is one of them.

This page is a summary of a longer internal catalogue maintained alongside the Rustock client, which records each divergence against the mainnet block that revealed it. Where this page and that catalogue disagree, the catalogue is right: it is derived from replaying the chain, and this is a view over it.

rskj, pinned at 3dc9d977 — every source link on this page resolves against that revision, not against master

Sergio Demian Lerner, "Similarities and Differences between RSK and Ethereum", 11 January 2021 — the chain-level comparison draws on this