EIP-7266 · Stagnant · Core · 2023-07-03
EIP-7266: Remove BLAKE2 compression precompile
Proposed disabling the BLAKE2 compression precompile at address 0x09 so every call to it fails, removing a feature that saw almost no real use.
What problem does it solve?
EIP-152 added a precompile at address 0x09 that runs the BLAKE2b compression function F. It went live in the Istanbul upgrade (December 2019) with the idea of enabling cheap verification of BLAKE2-based chains such as Zcash from inside Ethereum.
According to this proposal, that use never materialised: when it was written in mid-2023, 0x09 had been called only about 22,000 times in total, with the most recent call in October 2022. Every precompile is permanent consensus code that each client must implement, test and keep correct. EIP-7266 argues that an unused one is pure maintenance cost and should be removed, and that doing so would also be a useful trial run for retiring EVM features in general.
How it works
The change is a single consensus rule. After the fork, any CALL, CALLCODE, DELEGATECALL or STATICCALL to address 0x09 must:
- end in an exceptional halt,
- consume all gas supplied to the call, and
- return no data.
In other words, the address behaves like a call that always fails, rather than like an empty account. Nothing changes on the execution side apart from that, and no other precompile is affected.
Because it changes what valid blocks look like, it needs a hard fork. The author suggests 6 to 12 months' notice for the few applications that might depend on it.
Sample code
A contract that calls blake2f today, and how the result changes under EIP-7266:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Blake2Caller {
// EIP-152 input: rounds(4) | h(64) | m(128) | t(16) | f(1) = 213 bytes
function compress(bytes calldata input) external view returns (bool ok, bytes memory out) {
(ok, out) = address(0x09).staticcall(input);
// Today: ok == true, out is the 64-byte new state h.
// Under EIP-7266: ok == false, out is empty, and all gas forwarded
// to the call is burned, so cap the gas you forward.
}
}
Things to know
- Status is Stagnant. It has not been scheduled for any network upgrade, and
0x09still works on mainnet. - If you depend on
blake2f, do not assume it will remain forever, but there is currently no activation date. - The discussion thread also considered removing the RIPEMD-160 precompile (
0x03); this EIP covers only0x09. - The "consume all gas" behaviour means a contract that forwards all its remaining gas to
0x09would lose it all. Defensive callers should limit the gas they forward to precompiles.