Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP-5131: ENS Subdomain Authentication #5131

Merged
merged 36 commits into from
Jul 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
02fdd31
Add EIP-603: ENS Auth Linking
wwhchung Jun 3, 2022
d926f0a
rename eip-603 to eip-5131 and remove external links
wwhchung Jun 3, 2022
3e3b45c
changing to an ERC
wwhchung Jun 3, 2022
069848e
additional context
wwhchung Jun 3, 2022
03d63ba
add refrence implementations
wwhchung Jun 3, 2022
31fd495
rename
wwhchung Jun 3, 2022
d779068
edits as per suggestions
wwhchung Jun 3, 2022
a24fa63
further content edits
wwhchung Jun 3, 2022
e51e8ed
grammar fix
wwhchung Jun 3, 2022
5676cce
short description change
wwhchung Jun 3, 2022
3c70189
update discussion link
wwhchung Jun 3, 2022
c0c8ded
update ref implementation
wwhchung Jun 3, 2022
713c03f
update with new reference code
wwhchung Jun 3, 2022
51a0753
format edits
wwhchung Jun 3, 2022
dc3ad8a
update reference implementation
wwhchung Jun 3, 2022
1c3abd7
Update eip-5131.md
wwhchung Jun 3, 2022
54a20ef
add additional code for sample implementation
wwhchung Jun 5, 2022
00458df
clean up Abstract and move contents into Motivation
wwhchung Jun 6, 2022
47558a2
Update eip-5131.md
wwhchung Jun 6, 2022
8360e7e
Update EIPS/eip-5131.md
wwhchung Jun 10, 2022
bb9dace
edits
wwhchung Jun 10, 2022
fc02098
Update EIPS/eip-5131.md
wwhchung Jun 13, 2022
248dad3
Update EIPS/eip-5131.md
wwhchung Jun 13, 2022
c1b51af
Update EIPS/eip-5131.md
wwhchung Jun 14, 2022
b59c292
Update EIPS/eip-5131.md
wwhchung Jun 14, 2022
9bd601c
Update EIPS/eip-5131.md
wwhchung Jun 14, 2022
7d59810
Update EIPS/eip-5131.md
wwhchung Jun 14, 2022
ace2c39
Update EIPS/eip-5131.md
wwhchung Jun 14, 2022
8ce77e1
Update EIPS/eip-5131.md
wwhchung Jun 27, 2022
1f7f35c
Update EIPS/eip-5131.md
wwhchung Jun 27, 2022
0b880a1
Update EIPS/eip-5131.md
wwhchung Jun 28, 2022
43f8ba4
update Specification for EIP-5131
wwhchung Jun 28, 2022
bf02f83
update Rationale section
wwhchung Jul 3, 2022
c3c8687
improve Motivation section
wwhchung Jul 3, 2022
a9fe2e6
Update EIPS/eip-5131.md
wwhchung Jul 8, 2022
a7c605a
Update EIPS/eip-5131.md
wwhchung Jul 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions EIPS/eip-5131.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL


Let:
- `mainAddress` represent the wallet address we are trying to authenticate or very asset ownership for
- `mainENS` represent the reverse lookup ENS string for `mainAddress`
- `authAddress` represent the address we want to sign with in lieu of `mainAddress`
- `authENS` represent the reverse lookup ENS string for `authAddress`. It must be in the format `auth[0-9]*.<mainENS>`.
- `mainAddress` represents the wallet address we are trying to authenticate or prove asset ownership for.
wwhchung marked this conversation as resolved.
Show resolved Hide resolved
- `mainENS` represents the reverse lookup ENS string for `mainAddress`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be beneficial for the readers understanding to underline the importance of the reverse record here. Maybe adding something like

This is crucial because it acts as proof that `mainENS` is operated by or on behalf of the `mainAddress` owner.

- `authAddress` represents the address we want to use for signing in lieu of `mainAddress`.
- `authENS` represents the reverse lookup ENS string for `authAddress`. It must be in the format `auth[0-9]*.<mainENS>`.


### Setting up one or many `authAddress` records
The pre-requisite assumes that the `mainAddress` has an ENS ETH resolver record configured.

1. Using your `mainAddress` wallet, sign into ens.domains and create a subdomain record for `mainENS` called `auth[0-9]*`. This becomes the `authENS`
wwhchung marked this conversation as resolved.
Show resolved Hide resolved
wwhchung marked this conversation as resolved.
Show resolved Hide resolved
2. Set the ETH resolver record for this `auth[0-9]*` subdomain to the `authAddress`
2. Set the ETH resolver record for the subdomain created in step 1 (`authENS`) to the `authAddress`.
3. Using `authAddress`, sign into ens.domains and set the ENS reverse record to `authENS`

Repeat this process with as many addresses as you would like.
Currently this EIP does not enforce an upper-bound on the number of `authAddress` entries you can include. Users can repeat this process as with as many address as they like.
wwhchung marked this conversation as resolved.
Show resolved Hide resolved

### Authenticating `mainAddress` via `authAddress`
Control of `mainAddress` and ownership of `mainAddress` assets is proven if any one of associated `authAddress` is the msg.sender or has signed the message.
Expand All @@ -74,7 +75,9 @@ Further, I have multiple devices:
- My iPhone has mobile metamask hot wallet, and I can add it as an auth account by setting auth1.wilkins.eth to that wallet (and the corresponding reverse record).
wwhchung marked this conversation as resolved.
Show resolved Hide resolved
- My iPad has the same and can be set to auth2.wilkins.eth, etc.

Lost my device? No problem, just delete the record. No need to import/reimport seed phrases.
Lost Access to Signing Key/Device:
In the event that a user losses access to the signing key of an `authAddress` they can simply delete the corresponding ENS record. An attractive side effect of this is that there is no need to import/reimport seed phrases.
In the unfortunate event that you lose access to the signing key of the `mainAddress`, users will lose access to that top-level domain and all related subdomains. As always, this private key data should be treated as highly sensitive.


## Reference Implementation
Expand Down Expand Up @@ -104,7 +107,7 @@ async function getLinkedAddress(provider: ethers.providers.Provider, address: st
### Contract side

### With a secure server
wwhchung marked this conversation as resolved.
Show resolved Hide resolved
If there is a secure, you could run the client/server code above, then use the result in conjunction with specs like [EIP-1721](./eip-1721.md): `Standard Signature Validation Method for Contracts` for a cheap and secure way to validate that the the message signer is indeed authenticated for the main address.
If your application operates a secure backend server, you could run the client/server code above, then use the result in conjunction with specs like [EIP-1721](./eip-1721.md): `Standard Signature Validation Method for Contracts` for a cheap and secure way to validate that the the message signer is indeed authenticated for the main address.
wwhchung marked this conversation as resolved.
Show resolved Hide resolved

#### Without a secure server (web client only)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have trouble understanding what is meant by secure server. Does this refer to the node provider? Otherwise, I could run the above js code also on a web client.

Provided is a refrence implementation for an internal function to verify that the message sender has an authentication link to the main address.
wwhchung marked this conversation as resolved.
Show resolved Hide resolved
Expand Down