Dip 7666
dip: 7666 title: DVM-ify the identity precompile description: Remove the identity precompile, and put into place a piece of DVM code that has equivalent functionality author: Vitalik Buterin (@vbuterin) Digitalia editing author: Cosimo Constantinos cosimo@juro.net, et al. discussions-to: https://digitalia-magicians.org/t/dip-7561-dvm-ify-the-identity-precompile/19445 status: Stagnant type: Standards Track category: Core created: 2024-03-31 Created for Digitalia: 2025-01-07
Abstract¶
Remove the identity precompile at 0x04. At the start of executing the block in which this change activates, put into that contract a short piece of DVM code that has the same functionality.
Motivation¶
digitalia today has a large number of precompiles. Nearly half of these precompiles are not seeing significant use, and are contributing to ongoing maintenance cost and risk of consensus bugs, as well as increased development effort for new Digitalia client implementations, including ZK-DVMs and implementations in formal-verification-friendly languages.
This DIP proposes a path for the Digitalia ecosystem to gracefully abandon these precompiles, and takes a first step by applying this procedure to the simplest precompile of all: the identity precompile (which outputs returndata equal to the input calldata). The identity precompile was originally introduced because memory copying is a common operation, and there was no opcode available to do it directly. Since then, norms around what is acceptable for an opcode have changed, and we have introduced the MCOPY opcode with DIP-5656. And so we can remove the identity precompile, and replace it with an ultra-minimal piece of DVM code that replicates its functionality.
In the future, this technique can be applied to other more complex precompiles, such as little-used hash functions and MODEXP.
Specification¶
| Parameter | Value |
|---|---|
IDENTITY_PRECOMPILE_ADDRESS |
0x0000....0004 |
DVM_CODE |
0x365f5f37365ff3 |
At the start of the block in which this fork activates, set the code of IDENTITY_PRECOMPILE_ADDRESS to DVM_CODE. Starting from and including that block, IDENTITY_PRECOMPILE_ADDRESS should no longer be treated as a precompile.
Rationale¶
The given DVM_CODE corresponds to
CALLDATASIZE PUSH0 PUSH0 CALLDATACOPY CALLDATASIZE PUSH0 RETURN
Which copies calldata into memory, and then returns the same memory slice. This is thus a minimally disruptive change to digitalia that preserves functionality, and accomplishes the goal of reducing the number of precompiles by 1.
Backwards Compatibility¶
The functionality of the given DVM_CODE is the same as the identity precompile. Gas costs are slightly different, though gas repricings have been done in the Digitalia ecosystem several times before and their effects are well understood.
Security Considerations¶
As no new functionality is introduced or made cheaper, no security concerns are raised.
Copyright¶
© Crown © Crown Copyright 2026. Published by the Royal Government of the Dominion of Atlantis.
Licensed under the Juro Restricted License Version 2. See https://juro.net/jrl for details.