主页EIPs周刊
EIPsERC-6821
ERC-6821

Support ENS Name for Web3 URL

A mapping from an ENS name to the contract address in Web3 URL
DraftStandards Track: ERC
创建时间: 2023-04-02
关联 EIP: EIP-137, EIP-634, EIP-3770, EIP-4804
Qi Zhou (@qizhou), Qiang Zhu (@qzhodl)
社区讨论原文链接编辑
1 分钟了解
欢迎补充好内容
去提交
相关视频
欢迎补充好内容
去提交
正文

Abstract

This standard defines the mapping from an Ethereum name service (ENS) name to an Ethereum address for ERC-4804.

Motivation

ERC-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 ERC-4804, the protocol will find the address of the contract using the following steps:

  1. 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 ETH address.
  2. If the contentcontract text record does not exist, the protocol will use the resolved address of name from ERC-137.
  3. 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 Ethereum address in hexadecimal with a 0x prefix or an ERC-3770 chain-specific address. If the address is an ERC-3770 chain-specific address, then the chainid to call the message will be overridden by the chainid specified by the ERC-3770 address.

Rationale

The standard uses contentcontract text record with ERC-3770 chain-specific address instead of contenthash so that the record is human-readable - a design principle of ERC-4804. Further, we can use the text record to add additional fields such as time to live (TTL).

Security Considerations

No security considerations were found.

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交
相关项目
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
支持以太坊贡献者,推动生态建设
资源
GitHub
支持社区