EIPs Explained

ERC-7878 · Final · ERC · 2025-02-01

ERC-7878: Bequeathable Contracts

A standard interface that lets token holders write an on-chain "Will" naming executors, so their tokens can be passed to an heir after a waiting period once they die.

What problem does it solve?

Tokens, and NFTs representing real-world assets in particular, have no standard way to be inherited. If the owner dies without having shared their keys, the assets are simply lost; if they did share their keys, anyone holding them can move the assets at any time.

ERC-7878 defines a small "Bequeathable" interface that mirrors how a real-world Will works: the owner names executors in advance, an executor announces the death, a waiting period gives everyone time to object, and then the tokens move to the named heir. It can be added to ERC-20, ERC-721 or ERC-1155 contracts without changing their core behaviour.

How it works

The interface has six functions and two events:

Function Purpose
setWill(executors, moratoriumTTL) Owner names one or more executors and a waiting period in seconds. Calling it again overwrites the previous Will.
getWill(owner) Lets the owner check what they set
announceObit(owner, inheritor) An executor starts the process and names the address that will receive the tokens. Emits ObituaryStarted.
cancelObit(owner) Any executor (or the owner, if still alive) cancels the process. Emits ObituaryCancelled.
getObit(owner) Returns the named inheritor and the time left; a negative value means the wait is over
bequeath(owner) After the waiting period, transfers the tokens to the inheritor

The flow is:

  1. The owner calls setWill while alive.
  2. After death, one executor calls announceObit, naming the inheritor.
  3. The moratoriumTTL clock runs. During this window any executor can call cancelObit, for example if there is a dispute. The dispute can be settled off-chain and the process restarted later.
  4. Once the window has passed, bequeath moves the tokens.

To keep the interface simple, all tokens go to a single inheritor address. Splitting them among several heirs is that person's job afterwards.

Sample code

The interface as defined in the standard:

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

interface Bequeathable {
    event ObituaryStarted(address indexed owner, address indexed inheritor);
    event ObituaryCancelled(address indexed owner, address indexed cancelledBy);

    function setWill(address[] memory executors, uint256 moratoriumTTL) external;
    function getWill(address owner) external view returns (address[] memory executors, uint256 moratoriumTTL);
    function announceObit(address owner, address inheritor) external;
    function cancelObit(address owner) external;
    function getObit(address owner) external view returns (address inheritor, int256 moratoriumTTL);
    function bequeath(address owner) external;
}

Setting up a Will with a 30-day waiting period (ethers v6):

import { Contract } from "ethers";

const token = new Contract(tokenAddress, [
  "function setWill(address[] executors, uint256 moratoriumTTL)",
  "function getObit(address owner) view returns (address inheritor, int256 moratoriumTTL)",
], signer);

await (await token.setWill([lawyer, spouse], 30n * 24n * 60n * 60n)).wait();

Things to know

  • The standard is marked Final.
  • It only defines the interface. Access control (who may call announceObit, cancelObit and bequeath) is left to the implementer and must be done carefully.
  • The authors recommend a waiting period of at least 30 days, especially for valuable tokens. It limits the damage if an executor's wallet is compromised and someone starts the process falsely.
  • Any single executor can both start and cancel the process, so choose executors you trust.
  • The contract cannot verify a death. It relies entirely on executors acting honestly, with the waiting period as the safety net.
  • Each token contract keeps its own Will, so an owner with many tokens must set one per contract.

#token #inheritance #nft #interface

Details

Authors
Wamith Mockbill (@wamith)
Status
Final
Type
Standards Track / ERC
Created
2025-02-01
Requires

Machine-readable: Markdown · JSON