> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# op-revm

> op-revm is the Optimism variant of revm, implementing OP Stack modifications to the EVM.

`op-revm` is the Optimism variant of [revm](https://github.com/bluealloy/revm) —
the OP Stack's modifications to the Ethereum Virtual Machine, packaged as a
custom EVM built on top of the upstream `revm` framework.

## Features

`op-revm` extends `revm` with everything the OP Stack needs on top of vanilla
Ethereum execution:

* **Deposit transactions** — the L1-to-L2 deposit transaction type and its
  execution semantics.
* **L1 cost accounting** — `L1BlockInfo` and per-transaction L1 fee / blob fee
  calculation.
* **Operator fees** — operator fee handling introduced in Isthmus and refined
  in Jovian.
* **OP-specific precompiles** — including accelerated BN254 pairing.
* **OP halt reasons & transaction errors** — OP Stack–specific execution
  failure modes.
* **Hardfork-aware spec selection** — `OpSpecId` selects the right behavior for
  each OP Stack hardfork (Bedrock, Regolith, Canyon, Ecotone, Fjord, Granite,
  Holocene, Isthmus, Jovian, …).

## Provenance

`op-revm` is vendored from upstream
[`bluealloy/revm`'s `crates/op-revm`](https://github.com/bluealloy/revm/tree/main/crates/op-revm)
and imported into the monorepo so it can evolve in lock-step with the rest of
the OP Stack Rust code. The upstream release history is preserved in
[`rust/op-revm/CHANGELOG.md`](https://github.com/ethereum-optimism/optimism/blob/develop/rust/op-revm/CHANGELOG.md).

## Crate features

The crate exposes the usual `revm` feature knobs, forwarded through to the
underlying `revm` crate:

* `default = ["std", "c-kzg", "secp256k1", "portable", "blst"]`
* `std` — enables `std`-dependent code paths in `revm`, `alloy-primitives`,
  `serde_json`, etc.
* `serde` — derives `serde` impls and forwards to `revm/serde` and
  `alloy-primitives/serde`.
* `portable`, `c-kzg`, `secp256k1`, `blst`, `bn` — pass-through feature gates
  for the cryptographic backends.
* `dev`, `memory_limit`, `optional_balance_check`, `optional_block_gas_limit`,
  `optional_eip3541`, `optional_eip3607`, `optional_no_base_fee`,
  `optional_fee_charge` — debugging and testing knobs forwarded to `revm`.

`op-revm` supports `no_std` builds: disabling default features (or building
with `--no-default-features`) produces a crate suitable for fault-proof and
zkVM targets such as `riscv32imac-unknown-none-elf`.

## Building & testing

From the `rust/` workspace root:

```bash theme={null}
# Build
cargo build -p op-revm

# Run tests with all features
cargo nextest run -p op-revm --all-features

# no_std check (mirrors upstream's riscv32imac CI)
cargo build -p op-revm \
  --target riscv32imac-unknown-none-elf \
  --no-default-features
```

The `no_std` build is also exercised by `just check-no-std` and runs in CI on
every PR that touches `rust/**`.

## Using op-revm

`op-revm` is the EVM used by [op-reth](/rust/op-reth) for OP Stack block
execution, and by [Kona](/rust/kona/intro/overview) inside the fault-proof
program and rollup node. Most users will consume it transitively through one
of those components rather than depending on it directly; depend on `op-revm`
directly only when building a custom OP Stack execution environment (for
example, an alternate client or a zkVM proof backend).

## License

`op-revm` is licensed under the MIT License — see
[`rust/op-revm/LICENSE`](https://github.com/ethereum-optimism/optimism/blob/develop/rust/op-revm/LICENSE).
