-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC: Attribute Registry Standard #1616
Comments
Great stuff, we have a similar proposal for querying metadata for an ethereum address using a standard JSON scheme stored on IPFS (potentially Swarm as well) Check out the ERC-1456 - Address Metadata JSON Schema You can also test out the PoC at https://beta.ethregistry.org As an example you have the address pre-filled (0x6090a6e47849629b7245dfa1ca21d94cd15878ef -ENS Public Registrar) with a front-end displaying the ERC-1456 complaint metadata which include some attributes about the submitter of this metadata and others |
ERC-1456 looks great! The way I see it, there are a few key differences between the two:
In general, it seems to me like singular, authoritative registries (e.g. ENS, ERC-1456, ERC-820) should often have interfaces that are catered directly to the format of their particular metadata / information, but most registries with a more specific audience would benefit greatly from a common interface that is still flexible enough to represent the information they hold. A flat |
Thanks for the detailed breakthrough @0age! That was super helpful 🙏 |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
Simple Summary
EIP-1616 provides a basic interface for querying a registry for attribute metadata assigned to Ethereum accounts.
Abstract
This EIP contains the following core ideas:
uint256 -> uint256
key-value pair on each account, with the important property that each attribute type has one canonical value per address. This property allows for composability of attribute registries and advanced attribute formation.Potential advanced uses of attribute registries include:
Motivation
This EIP is motivated by the need for contracts and external accounts to be able to verify information about a given address from a single trusted source without concerning themselves with the particular details of how the information was obtained, and to do so in as simple a manner as possible. It is also motivated by the desire to promote broad cross-compatibility and composability between attribute registries, a property which is amplified by both the simplicity of the interface as well as by the guarantees on uniqueness provided by the proposed standard.
Existing EIPs for assigning metadata to an account include EIP-735 and EIP-780, which both allow for multiple claims to be issued on the same address for any given claim topic. This forces verifiers of said metadata to assess the veracity of each claim, taking into account the relative reputation of each claim issuer. It also prescribes a methodology for adding and removing claims, which may not be appropriate for all use cases.
This EIP proposes a light-weight abstraction layer for a standard account metadata registry interface. This abstraction layer can sit on top of claims registries like EIP-735 and EIP-780 or others as the attribute registry curator selects trusted data sources.
Specification
The Attribute Registry interface contains four functions, outlined as follows:
Contracts that comply with the Attribute Registry EIP MUST implement the above interface.
As an additional requirement, the ERC-165 interface MUST be included:
The implementation MUST follow the specifications described below.
View Functions
The view functions detailed below MUST be implemented.
hasAttribute
functionCheck if an attribute has been assigned to a given account on the registry and is currently valid.
NOTE: This function MUST return either true or false - i.e. calling this function MUST NOT cause the caller to revert. Implementations that wish to call into another contract during execution of this function MUST catch any
revert
and instead returnfalse
.NOTE: This function MUST return two equal values when performing two directly consecutive function calls with identical
account
andattributeTypeID
parameters, regardless of differences in the caller's address, the transaction origin, or other out-of-band information.getAttributeValue
functionRetrieve the
uint256
value of an attribute on a given account on the registry, assuming the attribute is currently valid.NOTE: This function MUST revert if a directly preceding or subsequent function call to
hasAttribute
with identicalaccount
andattributeTypeID
parameters would return false.NOTE: This function MUST return two equal values when performing two directly consecutive function calls with identical
account
andattributeTypeID
parameters, regardless of differences in the caller's address, the transaction origin, or other out-of-band information.countAttributeTypes
functionRetrieve the total number of valid attribute types defined on the registry. Used alongside
getAttributeTypeID
to determine all of the attribute types that are available on the registry.NOTE: This function MUST return a positive integer value - i.e. calling this function MUST NOT cause the caller to revert.
NOTE: This function MUST return a value that encompasses all indexes of attribute type IDs whereby a call to
hasAttribute
on some address with an attribute type ID at the given index would returntrue
.getAttributeTypeID
functionRetrieve an ID of an attribute type defined on the registry by index. Used alongside
countAttributeTypes
to determine all of the attribute types that are available on the registry.NOTE: This function MUST revert if the provided
index
value falls outside of the range of the value returned from a directly preceding or subsequent function call tocountAttributeTypes
. It MUST NOT revert if the providedindex
value falls inside said range.NOTE: This function MUST return an
attributeTypeID
value on some index if the sameattributeTypeID
value would cause a given call tohasAttribute
to returntrue
when passed as a parameter.Rationale
This standard extends the applicability of metadata assignment to those use cases that are not adequately represented by EIP-735, EIP-780, or similar proposals. Namely, it enforces the constraint of one attribute value per attribute ID per address, as opposed to one value per ID per address per issuer.
Aside from the prescribed attribute value, attribute properties are deliberately omitted from the standard. While many attribute registries will require additional metadata on attributes at both the instance and the class level, reliable and flexible interoperability between highly variable registry extensions is facilitated more effectively by enforcing a widely-applicable base layer for attributes.
Backwards Compatibility
There are no backwards compatibility concerns.
Test Cases
Targeted test cases with 100% code coverage can be found at this repository. See here for tests on a more complex contract that implements the application registry interface.
Implementation
See this repository for an example implementation (or here for an example of a more complex implementing contract).
Copyright
Copyright and related rights waived via CC0.
The text was updated successfully, but these errors were encountered: