EIPs Explained

ERC-8023 · Draft · ERC · 2025-09-16

ERC-8023: Multi-step Contract Ownership

A draft ownership standard that turns transferOwnership into three steps (initiate, confirm after an optional delay, accept by the new owner) so mistakes and compromised-key takeovers can be caught and cancelled.

What problem does it solve?

Many contracts are controlled by a single owner, and with the classic ERC-173 model that owner can hand over control in one call: transferOwnership(newOwner). A typo, an address-poisoning scam or a stolen key can therefore move control of a protocol instantly and irreversibly.

Two-step patterns (owner proposes, new owner accepts) already reduce the risk of sending ownership to a wrong address. ERC-8023 goes further: it adds an explicit confirmation step by the current owner, optionally separated from the proposal by a time buffer, so there is a window to review the address on-chain and to stop the transfer.

How it works

Ownership moves through three steps:

  1. Initiate - the owner calls initiateOwnershipTransfer(newOwner). The address becomes the preConfirmedOwner and OwnershipTransferInitiated is emitted.
  2. Confirm - after the buffer (getOwnershipTransferBuffer(), in seconds) has passed, the owner calls confirmOwnershipTransfer(newOwner) with the same address. It becomes the pendingOwner (OwnershipTransferConfirmed). To change the target, start over.
  3. Accept - the pending owner calls acceptOwnershipTransfer(), and ownership changes (OwnershipTransferred).

The owner can call cancelPendingOwnershipTransfer() before acceptance. Until the new owner accepts, the existing owner keeps all rights; pre-confirmed and pending owners have none. The spec recommends a buffer between 2 and 14 days, but does not enforce a range, and the buffer itself is optional.

An optional UpdateableOwnershipTransferBuffer extension lets the owner change the buffer, but only via a two-step update separated by the current buffer. Otherwise a thief with the owner key could simply set the delay to zero.

If the key is stolen, a long buffer gives the real owner time to react: they can repeatedly re-initiate a transfer, resetting the attacker's clock, while moving funds to safety.

Sample code

A compact implementation sketch:

// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

contract MultiStepOwnable {
    event OwnershipTransferInitiated(address indexed prevOwner, address indexed newOwner);
    event OwnershipTransferConfirmed(address indexed prevOwner, address indexed newOwner);
    event OwnershipTransferred(address indexed prevOwner, address indexed newOwner);

    address public owner;
    address public preConfirmedOwner;
    address public pendingOwner;
    uint256 private immutable buffer;   // seconds
    uint256 private initiatedAt;

    constructor(uint256 bufferSeconds) {
        owner = msg.sender;
        buffer = bufferSeconds;          // set together with the owner
    }

    modifier onlyOwner() { require(msg.sender == owner, "not owner"); _; }

    function getOwnershipTransferBuffer() external view returns (uint256) { return buffer; }

    function initiateOwnershipTransfer(address newOwner) external onlyOwner {
        preConfirmedOwner = newOwner;
        pendingOwner = address(0);
        initiatedAt = block.timestamp;
        emit OwnershipTransferInitiated(owner, newOwner);
    }

    function confirmOwnershipTransfer(address newOwner) external onlyOwner {
        require(newOwner != address(0) && newOwner == preConfirmedOwner, "mismatch");
        require(block.timestamp >= initiatedAt + buffer, "buffer");
        pendingOwner = newOwner;
        preConfirmedOwner = address(0);
        emit OwnershipTransferConfirmed(owner, newOwner);
    }

    function cancelPendingOwnershipTransfer() external onlyOwner {
        preConfirmedOwner = address(0);
        pendingOwner = address(0);
    }

    function acceptOwnershipTransfer() external {
        require(msg.sender == pendingOwner, "not pending owner");
        emit OwnershipTransferred(owner, msg.sender);
        owner = msg.sender;
        pendingOwner = address(0);
    }
}

Things to know

  • Status: Draft. The Backwards Compatibility section is still "TBD".
  • owner() is kept so existing tooling that reads the owner keeps working, but the transfer functions differ from ERC-173's transferOwnership, so integrations that call that function will not work unchanged.
  • Without a buffer, the scheme is essentially a two-step "propose / accept" pattern plus an extra confirmation. Its protection against key theft depends on choosing a meaningful buffer at deployment.
  • A time-delayed transfer protects ownership, not everything the owner can do: a compromised owner key can still call other owner-only functions immediately.
  • For a lighter, single-function ownership interface, see ERC-5313.

#ownership #access-control #security #admin #timelock

Details

Authors
David Kim (@PowerStream3604)
Status
Draft
Type
Standards Track / ERC
Created
2025-09-16
Required by

Machine-readable: Markdown · JSON