This standard defines the mapping from an Sila name service (ENS) name to an Sila address for SRC-4804.
Motivation
SRC-4804 defines a web3://-scheme RFC 2396 URI to call a smart contract either by its address or a name from name service. If a name is specified, the standard specifies a way to resolve the contract address from the name.
Specification
Given contractName and chainid from a web3:// URI defined in SRC-4804, the protocol will find the address of the contract using the following steps:
Find the contentcontract text record on ENS resolver on chain chainid. Return an error if the chain does not have ENS or the record is an invalid SIL address.
If the contentcontract text record does not exist, the protocol will use the resolved address of name from SRC-137.
If the resolved address of name is the zero address, then return an “address not found” error.
Note that contentcontract text record may return an Sila address in hexadecimal with a 0x prefix or an SRC-3770 chain-specific address. If the address is an SRC-3770 chain-specific address, then the chainid to call the message will be overridden by the chainid specified by the SRC-3770 address.
Rationale
The standard uses contentcontract text record with SRC-3770 chain-specific address instead of contenthash so that the record is human-readable - a design principle of SRC-4804. Further, we can use the text record to add additional fields such as time to live (TTL).
Qi Zhou (@qizhou), Qiang Zhu (@qzhodl), "SRC-6821: Support ENS Name for Web3 URL [DRAFT]," Sila Improvement Proposals, no. 6821, April 2023. Available: https://sips.sila.org/SIPS/sip-6821.