Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-7444, a proposal for a standardized way to determine when a time-locked asset becomes unlocked.

The explanation below translates, summarizes, and expands on the original proposal.

I also cover a range of EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

Many blockchain protocols use time locks to prevent withdrawals or transfers until a specified time. Historically, there has been no common interface for determining when these locks expire.

ERC-7444 aims to define a consistent way to express the maturity date of a time lock. A common format allows applications to determine when different types of assets are scheduled to become accessible.

The value of a time-locked asset may depend on how much time remains until maturity. This resembles time-dependent valuation in finance, including the concept of theta in options pricing, although the direction and magnitude of the effect depend on the instrument. Knowing the maturity date can improve valuation and simplify asset management.

Motivation

Time locks are widely used on-chain, including in token entitlements, staking, and vesting rewards. Without a standardized method for reporting maturity, several difficulties arise.

  • Difficulty valuing assets The value of a time-locked asset can depend on the time remaining until maturity. Without a readily accessible maturity date, estimating its present value becomes more difficult.
  • Complicated transfers of entitlements A time-locked entitlement may itself be transferred as an NFT (ERC-721) or a multi-token position (ERC-1155). If the maturity date is unclear, recipients may have difficulty assessing its value and risks.
  • Fragmented asset management When each project uses its own date representation and interface, users and applications need separate integration logic.

For more on ERC-721, see the following article.

[ERC-721] An Introduction to ERC-721

For more on ERC-1155, see the following article.

[ERC-1155] An Introduction to ERC-1155

ERC-7444 defines a common representation for time lock maturity so that applications can query when an asset is scheduled to become available.

The anticipated benefits include:

  • More consistent on-chain valuation inputs for time-locked assets.
  • Easier trading and transfer of tokenized entitlements.
  • Simpler integration of maturity information from different projects.

The proposal provides infrastructure for more transparent and interoperable handling of time-locked assets.

Specification

ERC-165 compliance

Contracts implementing ERC-7444 must also implement interface detection through ERC-165. This enables external contracts and applications to determine whether a contract declares support for ERC-7444.

For more on ERC-165, see the following article.

[ERC-165] Checking Whether a Contract Supports an Interface

ERC-165 uses an interface identifier to indicate whether a particular interface is supported. Wallets and other contracts can use this mechanism to discover ERC-7444 support, although a reported interface identifier does not guarantee correct implementation behavior.

Interface specification

The central function of ERC-7444 is getMaturity, which returns the maturity timestamp of a specified time lock. The interface reproduced in the original article is shown below.

js
// SPDX-License-Identifier: CC0-1.0

pragma solidity ^0.8.0;

interface ERC-7444 {
    /*
     * @notice      This function returns the timestamp that the time lock specified by `id` unlocks at
     * @param       id The identifier which describes a specific time lock
     * @return      maturity The timestamp of the time lock when it unlocks
     */
    function getMaturity(bytes32 id)
        external
        view
        returns (uint256 maturity);
}

The function provides the following information.

  • id An identifier for a specific time lock. It distinguishes individual locks when a contract manages multiple time-locked positions.

  • Return value: maturity A numeric value representing the scheduled unlock time of the specified time lock, expressed as a Unix timestamp. Unix timestamps count seconds since January 1, 1970 (UTC), matching the time representation used by Solidity's block.timestamp.

This common representation makes maturity information easier for applications and tools to process.

Using Unix timestamps

The returned maturity value must be expressed as a Unix timestamp. This is consistent with the time representation commonly used in Solidity.

For example, block.timestamp provides the timestamp associated with the current block.

Assets with a single time lock

Some assets have only one time lock rather than multiple positions distinguished by individual identifiers. In such cases, the id supplied to getMaturity need not identify a particular position.

The specification therefore provides the following conventions.

  • Implementations with only one time lock may ignore the value of id.
  • Callers querying such implementations are recommended to supply 0x0 as the identifier, represented as a zero-valued bytes32.

This enables assets with a single lock to expose the same interface as assets with multiple locks.

Rationale

Standardizing maturity information for locked assets

DeFi protocols frequently use mechanisms that generate yield or distribute rewards subject to withdrawal restrictions. Examples include yield farming and vesting escrow arrangements, both of which can involve positions with specified maturity dates.

As more protocols adopt time locks, a common method for retrieving maturity information becomes increasingly useful. ERC-7444 aims to make it easier for applications and wallets to integrate different assets by providing a consistent maturity query.

Valuing locked assets using the Black–Scholes model

Time-locked assets differ from freely transferable assets because the timing of access can affect their value. A longer period until maturity may introduce additional risks and uncertainty.

Quantitative valuation may therefore use mathematical models from financial engineering, where appropriate for the instrument. The Black–Scholes model, also known in its broader formulation as the Black–Scholes–Merton model, is one example discussed in this context.

Black–Scholes was developed for options pricing. Its treatment of time-dependent value illustrates why maturity information can be useful when modeling financial instruments. It is not automatically an appropriate valuation model for every time-locked asset.

The following table describes several relevant inputs.

Component Description
Volatility A measure of the variability of the underlying asset price.
Risk-free rate The assumed return on a risk-free asset.
Time to maturity The remaining time until the relevant maturity date, an important input in time-dependent valuation.

The remaining period until unlock can play a significant role in valuing locked assets. A common interface for retrieving the maturity timestamp provides one of the inputs needed for such analysis.

Importance of time-dependent valuation

The Black–Scholes model explicitly incorporates the passage of time into its valuation framework. For some locked assets, the discount associated with restricted access decreases as maturity approaches. Inaccurate maturity data can therefore result in inaccurate valuations.

ERC-7444 makes this underlying maturity information available through a standardized interface. It improves access to valuation inputs rather than defining a pricing model or guaranteeing an asset's value.

Compatibility

Compatibility with ERC-721 and ERC-1155

ERC-7444 is designed to complement existing token standards such as ERC-721 and ERC-1155. For tokens that already have lock functionality, a separate contract may expose the maturity information through the ERC-7444 interface.

This allows some existing projects to integrate standardized maturity queries without replacing their token contracts.

Supporting existing assets

Existing time-locked tokens may record maturity using project-specific mechanisms or may not expose it directly. ERC-7444 allows an additional contract to provide maturity queries where the necessary information can be obtained reliably.

Possible integration approaches include the following.

Approach Description
Adding a dedicated contract A separate contract reads the existing token's lock information and exposes its maturity timestamp.
Extending the token contract Where upgrades are available, the existing token can be extended to expose a maturity query.

This flexibility allows ERC-7444 to complement existing systems, although a wrapper cannot recover authoritative maturity data that the underlying system does not make available.

Reference implementation

LockedERC20 implementation

LockedERC20ExampleContract.sol
// SPDX-License-Identifier: CC0-1.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract LockedERC20ExampleContract implements ERC-7444{
    ERC20 public immutable token;
    uint256 public totalLocked;

    //Timelock struct
    struct TimeLock {
        address owner;
        uint256 amount;
        uint256 maturity;
        bytes32 lockId;
    }

    //maps lockId to balance of the lock
    mapping(bytes32 => TimeLock) public idToLock;    

    function constructor(
        address _token,
    ) public {
        token = ERC20(_token);
    }

    //Maturity is not appropriate
    error LockPeriodOngoing();
    error InvalidReceiver();
    error TransferFailed();

    /// @dev Deposit tokens to be locked in the requested locking period
    /// @param amount The amount of tokens to deposit
    /// @param lockingPeriod length of locking period for the tokens to be locked
    function deposit(uint256 amount, uint256 lockingPeriod) external returns (bytes32 lockId) {
        uint256 maturity = block.timestamp + lockingPeriod;
        lockId = keccack256(abi.encode(msg.sender, amount, maturity));

        require(idToLock[lockId].maturity == 0, "lock already exists");

        if (!token.transferFrom(msg.sender, address(this), amount)) {
            revert TransferFailed();
        }

        TimeLock memory newLock = TimeLock(msg.sender, amount, maturity, lockedId);

        totalLocked += amount;

        idToLock[lockId] = newLock;
        
    }

    /// @dev Withdraw tokens in the lock after the end of the locking period
    /// @param lockId id of the lock that user have deposited in
    function withdraw(bytes32 lockId) external {
        TimeLock memory lock = idToLock[lockId];

        if (msg.sender != lock.owner) {
            revert InvalidReceiver();
        }

        if (block.timestamp > lock.maturity) {
            revert LockPeriodOngoing();
        }

        totalLocked -= lock.amount;

        //State cleanup
        delete idToLock[lockId];

        if (!token.transfer(msg.sender, lock.amount)) {
            revert TransferFailed();
        }

    }

    function getMaturity(bytes32 id) external view returns (uint256 maturity) {
        return idToLock[id].maturity;
    }
}

The original reference example is reproduced unchanged. It contains apparent Solidity errors, including the interface identifier, constructor declaration, misspelled hash function, undefined variable, and an inverted maturity check in withdraw. It is illustrative rather than deployable production code and should not be used without correction and testing.

Security considerations

Extendable time locks

An important consideration when integrating ERC-7444 is the existence of extendable time locks. In these cases, the protocol may change the reported maturity timestamp after a position has been created.

Many locked assets are designed to unlock once a specified period has elapsed. Some implementations, however, allow the maturity time itself to change, for example when:

  • The protocol includes a function for extending the lock period.
  • An administrator can update the maturity timestamp.
  • The lock period changes based on particular conditions.

In such cases, the timestamp returned by getMaturity may change later. Users and integrating protocols must not assume that the reported timestamp is a permanent guarantee.

The following table summarizes relevant risks and precautions.

Issue Description
Risk of changing maturity A purchased position that appeared close to maturity may subsequently have its lock period extended.
Integration risks If maturity changes after a locked asset is used as collateral or in a lending arrangement, the expected repayment schedule may no longer hold.
Necessary verification Determine whether the maturity timestamp is fixed or can be changed under the underlying implementation.

Trading locked assets or accepting them as collateral requires careful assessment of whether their maturity can change. When interacting with other parties or lending protocols, applications must evaluate whether the reported timestamp is reliable for the intended purpose.

ERC-7444 standardizes how maturity information is retrieved. It does not guarantee that the maturity date is immutable or that the underlying asset can actually be withdrawn at that time. Understanding the asset implementation, administrator privileges, and withdrawal conditions remains essential.

Citation

Thanh Trinh (@thanhtrinh2003) thanh@revest.finance, Joshua Weintraub (@jhweintraub) josh@revest.finance, Rob Montgomery (@RobAnon) rob@revest.finance, "ERC-7444: Time Locks Maturity [DRAFT]," Ethereum Improvement Proposals, no. 7444, June 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7444.

Conclusion

This article covered ERC-7444, a proposal for a common interface to query the maturity timestamp of time-locked assets.

If you have questions, feel free to reach out via Twitter DM.

Twitter @cardene777

I also publish on the following platforms.