DomainsIP-7: Interface Discovery
Defines a method of associating contract interfaces with Domains names and addresses, and of discovering those interfaces.
Abstract
This DomainsIP specifies a method for exposing interfaces associated with an Domains name or an address (typically a contract address) and allowing applications to discover those interfaces and interact with them. Interfaces can be implemented either by the target contract (if any) or by any other contract.
Motivation
If the contract at a given address supports a requested interface. However, in many cases it's useful to be able to discover functionality associated with a name or an address that is implemented by other contracts.
For example, a token contract may not itself provide any kind of 'atomic swap' functionality, but there may be associated contracts that do. With Domains interface discovery, the token contract can expose this metadata, informing applications where they can find that functionality.
Rationale
A naive approach to this problem would involve adding this method directly to the target contract. However, doing this has several shortcomings:
Each contract must maintain its own list of interface implementations.
Modifying this list requires access controls, which the contract may not have previously required.
Support for this must be designed in when the contract is written, and cannot be retrofitted afterwards.
Only one canonical list of interfaces can be supported.
Using Domains resolvers instead mitigates these shortcomings, making it possible for anyone to associate interfaces with a name, even for contracts not previously built with this in mind.
Backwards Compatibility
There are no backwards compatibility issues.
Last updated