ERC-7656: Generalized Token-Linked Services
Define a registry for generic services linked to a specific NFT
Abstract
This proposal introduces a variation of ERC-6551 that extends to all types of services linked to non-fungible tokens (NFTs), i.e., contracts extending an NFT, owned by a single NFT and thus by the owner of the NFT. It achieves this goal using generic language for functions, errors, and events, and avoids conflicting with the strict restrictions imposed by the original proposal.
Motivation
ERC-6551 aims to bind smart accounts to tokens, allowing its registry to deploy accounts owned by a specific tokenID. The issue we attempt to address with this new proposal is that ERC-6551 explicitly requires any contract deployed via the ERC6551Registry
to implement IERC6551Account
and IERC6551Execute
, i.e., it must be an account. This requirement is underscored by the choices for the names of functions and events in the interface. Additionally, ERC-6551 specifies that the ERC6551Registry
smart contract is deployed as a singleton at a specific address on any chain. Due to this centralization of services, projects building on it are prone to consider any contract deployed via that registry that is not an account as spam or invalid.
With this new ERC, we propose a more generic registry that uses generic function/event names to allow the deployment of any kind of contract that makes sense when associated with an NFT, so that the contract is under the full control of the NFT's owner. In comparison with ERC-6551, since one of this proposal's goals is flexibility, there is no expectation for an ERC7656Registry
contract to be deployed as a singleton, allowing any project to adjust it to their needs; consequently, we require that any registry explicitly supports the IERC7656Registry
interface.
The expansion of the registry's capabilities to manage contracts implementing any kind of service beyond accounts provides several advantages:
- Flexibility: Developers can allow NFTs to interact with a broader range of linked contracts, unlocking new use cases and functionalities (lending systems, vested asset distribution, fractional ownership, identity, etc.)
- Compatibility: By ensuring that account-like contracts can still be identified as such, the proposal maintains backward compatibility with ERC-6551.
- Innovation: This proposal encourages further innovation in the NFT space by removing limitations on the types of contracts that can be associated with NFTs, opening the door to pure-utility NFTs.
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
The interface IERC7656Registry
is defined as follows:
Any ERC7656Registry
implementation MUST support the IERC7656Registry
's interface ID, i.e., 0xc6bdc908
.
Similarly to ERC-6551, The registry MUST deploy each token linked service as an ERC-1167 minimal proxy with immutable constant data appended to the bytecode.
The deployed bytecode of each token bound service MUST have the following structure:
Any contract created using a ERC7656Registry
SHOULD implement the IERC7656Service
interface:
or the IERC6551Account
interface or both. This flexibility makes ERC-6551 accounts compatible with this proposal out-of-the-box.
Rationale
The technical foundation of ERC-7656 centers on the extension and generalization of contract types that can be associated with NFTs. This approach was chosen to address specific limitations and opportunities identified in the design and application of NFT-linked contracts. Key technical decisions in this proposal include:
-
Generic Function/Event Names: The choice to adopt a generic naming convention for functions, errors, and events is deliberate. This design decision enables the ERC-7656 registry to support a wide array of contract types beyond mere accounts. By not prescribing specific roles or functionalities, we allow for greater innovation and flexibility in the types of applications that can be built on this standard. This also simplifies the interface and makes it more adaptable to various use cases.
-
No Singleton Requirement for the Registry: Unlike its predecessor, ERC-7656 does not mandate that the registry be deployed as a singleton. This decision was influenced by the recognition that different projects may have unique requirements and constraints. By allowing for multiple instances of the registry, projects can customize and optimize the registry's deployment to fit their specific needs, enhancing the ecosystem's overall diversity and resilience.
-
Explicit Support for the
IERC7656Registry
Interface: Requiring that any registry explicitly supports theIERC7656Registry
interface is a technical decision aimed at ensuring interoperability and recognition. This requirement facilitates the identification and interaction with compliant registries, promoting a more standardized and cohesive ecosystem. -
Flexibility in Contract Association: The proposal is designed to accommodate not just accounts, but any contract that can meaningfully be associated with an NFT. This decision stems from a technical evaluation of the evolving landscape of NFT use cases, recognizing the need for a standard that can support a broader range of functionalities, from complex financial instruments to identity verification systems.
-
Backward Compatibility: The proposal includes provisions for backward compatibility, particularly with account-like contracts from ERC-6551. This technical choice ensures that projects built on the earlier standard can transition to or leverage the new standard without discarding existing infrastructure or investments.
These technical decisions collectively aim to broaden the scope and applicability of NFT-linked contracts, empower developers with more tools for innovation, and support a growing ecosystem of decentralized applications. By addressing both current limitations and future opportunities, ERC-7656 seeks to lay a flexible and robust foundation for the next generation of NFT technologies.
Reference Implementation
The reference implementation of ERC7656Registry
is mutated from ERC6551Registry
, with minor changes to rename over-specific functions, emit a different event and error, and a supportsInterface
function that returns true only for the IERC7656Registry
interfaceId.
An example of implementation of IERC7656Service
:
Security Considerations
This proposal does not introduce any new security considerations beyond those already addressed in ERC-6551.
Copyright
Copyright and related rights waived via CC0.