-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
eip: 6821 | ||
title: Support ENS Name for Web3 URL | ||
description: A mapping from an ENS name to the contract address in Web3 URL | ||
author: Qi Zhou (@qizhou), Qiang Zhu (@qzhodl) | ||
discussions-to: https://ethereum-magicians.org/t/eip-6821-support-ens-name-for-web3-url/13654 | ||
status: Draft | ||
type: Standards Track | ||
category: ERC | ||
created: 2023-04-02 | ||
requires: 137, 4804 | ||
--- | ||
|
||
## Abstract | ||
|
||
This standard defines the mapping from an name of an Ethereum name service (ENS) to an Ethereum address for [ERC-4804](../eip-4804.md). | ||
|
||
## 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** in the form of `[name "." [ subDomain0 "." ... ]] "eth"]`, the protocol will find the address of the contract using the following steps: | ||
|
||
1. Find the `web3` text record on ENS resolver. Return error if the record is an invalid ETH address. | ||
2. If the `web3` text record does not exist, the protocol will use ETH address of **name**. | ||
|
||
Note that `web3` text record may return an Ethereum address or an [ERC-3770](../eip-3770.md) 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 `web3` 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 | ||
|
||
Copyright and related rights waived via [CC0](../LICENSE.md). |