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 explains ERC-7996, which standardizes additional contract capabilities that cannot be expressed through ERC-165 interfaces as named features with consistent identifiers.

This explanation is based on the following proposal.

https://github.com/adraffy/ethereum-ercs/blob/contract-features/ERCS/erc-7996.md

For other EIPs, BIPs, SLIPs, CAIPs, and ENSIPs, see the following page.

Overview

ERC-7996 defines a standard mechanism for advertising and detecting features implemented by smart contracts. In particular, it provides a common way to represent and identify capabilities that cannot be described as ERC-165 interfaces.

For an introduction to ERC-165, see the following article.

ERC-165: Checking Whether a Contract Supports an Interface

Motivation

The Ethereum Name Service (ENS) has long used ERC-165 to maintain compatibility with contracts dating back to 2016. However, not every capability of a contract can be represented by a distinct interface.

The concept of a feature provides a way to describe such capabilities without breaking existing interfaces. ERC-7996 standardizes features and their naming conventions so that contracts can advertise capabilities consistently and maintain interoperability.

Specification

ERC-7996 defines a standard mechanism for identifying and advertising smart contract features. Here, a feature is a capability or property that cannot be adequately expressed as an ERC-165 interface.

Identifying Features

Each feature has a unique name expressed in reverse-domain-name notation. For example, an extended multicall feature for ENS resolvers is named as follows.

text
eth.ens.resolver.extended.multicall

The feature identifier consists of the first four bytes of the Keccak-256 hash of this name.

text
bytes4(keccak256("eth.ens.resolver.extended.multicall")) = 0x96b62db8

This convention gives a capability a descriptive name and derives a compact identifier from it.

Advertising Supported Features

A conforming contract must implement the following interface.

solidity
interface IERC7996 {
    /// @notice 特定のFeatureがサポートされているかを確認する。
    /// @param featureId Featureの識別子(bytes4形式)
    /// @return `true` の場合、そのFeatureはコントラクトでサポートされている。
    function supportsFeature(bytes4 featureId) external view returns (bool);
}

The original comments explain that the function takes a four-byte feature identifier and returns true when the contract supports the feature.

The interface itself supports ERC-165 discovery and has interface ID 0x582de3e7.

Checking Whether a Contract Supports Feature Discovery

First, use ERC-165 to check whether the target contract supports IERC7996. If it does, the contract advertises support for feature discovery.

Checking a Specific Feature

Once feature discovery support has been established, call supportsFeature(featureId). A return value of true indicates that the contract claims to support that feature.

A contract can implement the feature-discovery interface without supporting any individual features, so each relevant feature must be checked separately.

Additional Considerations

ERC-7996 avoids the need to create synthetic ERC-165 interfaces merely to describe contract capabilities. This preserves ERC-165's interface identifier space while allowing more flexible descriptions of functionality.

Backward Compatibility

Contracts and applications unaware of feature discovery can continue operating as before. The design preserves existing behavior for callers that do not understand the new feature standard.

The original article reports that ENS had already implemented this mechanism and was using it in practice.

Security

As with ERC-165, a contract's claim to support a feature does not guarantee that it implements the feature correctly. Contracts can make false declarations.

Applications and services should therefore perform additional validation where appropriate, rather than relying solely on the advertised feature support.

Conclusion

ERC-7996 provides a consistent naming and discovery mechanism for additional smart contract features without requiring changes to existing interfaces.