ERC-1616 Attribute registry standard
Stagnant · Names & metadata · created 2018-11-23
Defines a common lookup interface that lets you query a single trusted registry to check attributes assigned to an account, such as whitelist status or verification status.
Why it is needed
Until now, checking which attributes an account had (for example, having passed a whitelist or completed identity verification) required looking directly at claims issued by individual claim issuers, as in EIP-735 or EIP-780. In this approach, multiple issuers could issue different claims on the same attribute subject, placing the burden on the verifier to also assess the trustworthiness of each issuer. In addition, the procedures for adding and removing claims differed from standard to standard, making it hard to combine different registries. EIP-1616 raises this complexity to the level of the registry operator (curator), letting a verifier make a decision by looking at a single trusted registry instead of individual issuers.
What to implement
function hasAttribute(address account, uint256 attributeTypeID) external view returns (bool);: Checks whether the given attribute type is assigned to the account and currently valid.function getAttributeValue(address account, uint256 attributeTypeID) external view returns (uint256);: Retrieves the uint256 value of a valid attribute; reverts the call if the attribute does not exist.function countAttributeTypes() external view returns (uint256);: Returns the total number of valid attribute types defined in the registry.function getAttributeTypeID(uint256 index) external view returns (uint256);: Looks up the ID of an attribute type by index.function supportsInterface(bytes4 _interfaceID) external view returns (bool);: Checks whether this contract supports a specific interface, in the ERC-165 style.
In depth
Behavior rules for hasAttribute and getAttributeValue
hasAttribute must never revert under any circumstances and must always return either true or false. If a call to another contract reverts during the implementation, this must be caught and treated as false. getAttributeValue must revert if calling hasAttribute with the same account and attributeTypeID would return false. Both functions must have a consistency requirement: calling them repeatedly with the same parameters must always return the same value, regardless of incidental information such as the caller's address or transaction origin.
Attribute type enumeration rules
countAttributeTypes must never revert and must always return a positive integer that covers the indices of every attributeTypeID for which hasAttribute can return true. getAttributeTypeID(index) must revert for any index outside the range returned by countAttributeTypes, and must not revert for an index within that range. In addition, every attributeTypeID value for which hasAttribute is true must be retrievable via getAttributeTypeID at some index.
One canonical value per account
Attributes are registered per account as flat key-value pairs, keyed by a uint256 attributeTypeID with a uint256 value. Each attribute type has only one canonical value per address, unlike structures such as EIP-735 or EIP-780 where a separate value can exist per issuer. This guarantee of uniqueness is what makes it possible to compose multiple attribute registries together.
ERC-165 support is mandatory
Contracts implementing an Attribute Registry must also implement ERC-165's supportsInterface in addition to the four functions above. The Attribute Registry interface ID is 0x5f46473f, and supportsInterface must return true for both 0x01ffc9a7 (ERC-165 itself) and 0x5f46473f.
Applicability: composite attributes and delegation
The original Abstract mentions a few advanced usage patterns. Complex boolean expressions combining multiple attributes can be encoded into a single uint256 key for the registry logic to parse and evaluate. Attribute values can also be used to look up additional on-chain or off-chain metadata. The registry can also be made to call other attribute registries or contracts to resolve values, delegating authority without changing the interface.
Additional metadata on the attribute itself is out of scope for the standard
According to the Rationale, additional attribute information beyond the value for an attributeTypeID, whether instance-level or class-level metadata, is deliberately excluded from the standard. The design aims to secure interoperability across diverse registry extensions more effectively by enforcing a broad, general-purpose base layer.
Proposal status
This ERC's status is Stagnant, meaning it is a proposal that has not progressed further and has stalled. Its contents may change further or may never be finalized as a standard.