ERC-8023 Multi-step contract ownership transfer (Multi-step Contract Ownership)
Draft · Other · created 2025-09-16
A standard that splits smart contract ownership transfer into three steps, initiation, confirmation, and acceptance, with a waiting period between steps to prevent accidental loss of ownership from mistakes or key compromise.
Why it is needed
The security of many DeFi protocols and smart contract wallets depends heavily on contract ownership. However, the long-standing conventional approach in the industry (such as ERC-173's transferOwnership) uses a single-step structure where ownership transfers immediately with one function call. A single mistyped character in an address, or falling for a scam with a similar-looking address (address poisoning), can permanently transfer ownership to the wrong place. Also, if the owner's private key is leaked, an attacker can seize ownership on the spot, leaving no time to respond. As attacks grow more sophisticated, a multi-step ownership transfer process that can be reviewed and halted midway is needed.
What to implement
event OwnershipTransferInitiated(address indexed prevOwner, address indexed newOwner);: Event emitted when initiation, the first step of ownership transfer, occurs.event OwnershipTransferConfirmed(address indexed prevOwner, address indexed newOwner);: Event emitted when confirmation, the second step, occurs.event OwnershipTransferred(address indexed prevOwner, address indexed newOwner);: Event emitted when the new owner accepts and the ownership transfer is complete.function initiateOwnershipTransfer(address newOwner) external;: The first step of ownership transfer. Stores the new owner address in the preConfirmedOwner state.function confirmOwnershipTransfer(address newOwner) external;: The second step. Can only be called after the buffer period has elapsed, the address must match the one from the initiation step, and it is stored as pendingOwner.function cancelPendingOwnershipTransfer() external;: Cancels an ownership transfer before acceptance and clears pendingOwner. To transfer again, the process must be repeated starting from initiation.function acceptOwnershipTransfer() external;: The final step. Only the new owner designated in the confirmation step can call this to take over ownership.function owner() external view returns (address);: Returns the current owner. Only this address holds owner privileges.function pendingOwner() external view returns (address);: Returns the pending owner that has completed the confirmation step. This address holds no privileges.function preConfirmedOwner() external view returns (address);: Returns the pre-confirmed owner that has completed only the initiation step. This address also holds no privileges.function getOwnershipTransferBuffer() external view returns (uint256);: Returns, in seconds, the buffer period applied between initiation and confirmation.function initiateOwnershipBufferUpdate(uint256 newBuffer) external;: Initiates a change to the buffer period. A function of the optional extension interface.function confirmOwnershipBufferUpdate(uint256 newBuffer) external;: Confirms a change to the buffer period. Must fail if the existing buffer period has not elapsed since initiation.
In depth
Three-step transfer structure
Ownership transfer is split into three steps: initiation (initiateOwnershipTransfer), confirmation (confirmOwnershipTransfer), and acceptance (acceptOwnershipTransfer). The existing owner performs the first two steps, and the new owner performs the final acceptance. Both the initiation and confirmation steps take the newOwner address as a parameter again, reducing the chance of operational mistakes or fraud such as address poisoning. The address in the confirmation step must match the address from the initiation step, and transferring to a different address requires starting over from the initiation step. Acceptance can only be called by the new owner confirmed in step two, and implementations must perform access control such as msg.sender == pendingOwner().
Buffer time and status queries
getOwnershipTransferBuffer() returns, in seconds, the buffer time enforced between initiation and confirmation. The standard does not mandate a range for this value, but strongly recommends between 2 and 14 days. There are three status query functions: only the address returned by owner() holds owner authority, while the addresses returned by pendingOwner() and preConfirmedOwner() must not hold any authority, access, or entitlement. The buffer time itself is left optional; removing the buffer makes it similar to an Ownable2Step implementation with one extra confirmation step.
Cancellation function
cancelPendingOwnershipTransfer() cancels an in-progress ownership transfer at any point before the final acceptance step. This function must clear pendingOwner, and restarting a transfer after cancellation requires going through the process again starting from initiateOwnershipTransfer(). Whether the cause is an operational mistake or a leaked owner key, being able to reverse the process mid-transfer greatly improves security and operational burden.
Buffer time change extension
A MultiStepOwnable contract may optionally implement the UpdateableOwnershipTransferBuffer interface, which allows the buffer time to be changed. This change must also go through two steps: starting with initiateOwnershipBufferUpdate() and confirming with confirmOwnershipBufferUpdate() after the existing buffer time has passed, and the existing buffer time must be enforced between the two calls. Without enforcing this, if the owner's key is compromised, an attacker could first shorten the buffer, undermining the buffer's security.
Defense strategy in case of key compromise
Even in the extreme case where the owner's private key is compromised, if the buffer time is long enough, it buys the original owner time to evacuate funds from the protocol. Also, if an attacker initiates a transfer, the original owner can call the initiation step again to reset the timer to zero, continually blocking the ownership transfer to a malicious address. The original text describes this as a denial of service (DoS) against ownership, and cites the fact that defenders can exploit this property as the rationale for also enforcing two steps for buffer changes.
Compatibility with existing approaches
For compatibility with existing ownership mechanisms, it is designed to be compatible with the existing method of querying the owner via owner(). However, the Backwards Compatibility section of the original text is still left as TBD.
Proposal status
This proposal is in Draft status, created on September 16, 2025. Keep in mind that its contents may change going forward and it is not yet a finalized standard.
Things to watch out for
- Access control for transfer-related functions: initiateOwnershipTransfer(), confirmOwnershipTransfer(), and cancelPendingOwnershipTransfer() must be callable only by the owner.
- The buffer is set together with the owner: OwnershipTransferBuffer must be set at the same time the owner is set, such as in constructor() or initialize().
- Strict enforcement of the buffer: If a buffer is configured, it must be strictly enforced between initiation and confirmation.
- The existing owner retains authority until acceptance: Since ownership has not changed until the new owner performs the acceptance step, the existing owner must continue to hold all owner privileges.