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

[ENS] Remove name flow #8497

Closed
rachelhamlin opened this issue Jun 26, 2019 · 14 comments
Closed

[ENS] Remove name flow #8497

rachelhamlin opened this issue Jun 26, 2019 · 14 comments

Comments

@rachelhamlin
Copy link
Contributor

rachelhamlin commented Jun 26, 2019

Problem

Need to build remove username flow, after v1 cut.

Removing a username should:

  • remove it from status persisted state
  • unassociated the whisper key from relevant ENS name
  • Make sure tx state and errors are correctly handled.

image

@3esmit
Copy link
Member

3esmit commented Mar 3, 2020

@3esmit
Copy link
Member

3esmit commented Mar 3, 2020

Its a Blockchain Fact that "usernames can be released", i.e. is the rules of the contract, which at user application level should result into update of UI of all users that are currently looking to that username.

The tracking could be done by blockchain events, so all participants of the network update their interface in response to the same event.
We could use UsernameRegistrar.sol emmited events, such as:
https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L165 emit UsernameOwner(namehash, address(0));
however that should only be used for the UsernameRegistrar interface, not for the chat, contacts or whatever uses ENS Usernames, because ENS Usernames support any ENS, not just .stateofus.eth (interoperability principle)

We should have a specified flow for the ENS Root, when it have an updated event at ENS Root event
https://github.com/ensdomains/ens/blob/c611ba62ec4df289bf4ce882daf82a22e6cf94d2/contracts/ENS.sol#L12
And each username should have its indexes tracked in their selected resolver.

When a user makes public their username in a public chat, multiple users will be tracking that username events. The event tracking happens after the username check (so they have to be checked only once and updated through events), an alternative would be users subscribing through graphql (like thegraph).

Notice that users that added contacts by a username should also probably be tracking their contacts, however to don't consume much data this could be done on request by the user.

Users not looking (not interested on) a username released should not be notified.

@3esmit
Copy link
Member

3esmit commented Mar 3, 2020

However, as a quick path to solve this issue:

I. REMOVE USERNAME
The first button, REMOVE USERNAME, will just drop it at user local database.

II. RELEASE USERNAME
For the button "RELEASE USERNAME" to be visible, it must be a .stateofus.eth subnode.
For the button "RELEASE USERNAME" to be active it must:
a. have a registration older than 1 year OR b. registration contract migrated

a. is true when UsernameRegistrar.getExpirationTime(labelHash) > now()
b. is true when UsernameRegistrar.state() == 2

RELEASE USERNAME should call UsernameRegistrar.release(labelHash)

It fires the event emit UsernameOwner(namehash, address(0))

Glossary:

labelHash = keccak256(<username>)
username = <%s>.stateofus.eth
UsernameRegistrar adderss = 0xDB5ac1a559b02E12F29fC0eC0e37Be8E046DEF49
namehash = https://docs.ens.domains/contract-api-reference/name-processing

For further discussion:

  1. Should REMOVE USERNAME make a transaction cleaning up resolver? As a secondary solution, user would only be warned that it don't cleans up the resolver, and that needs to be done by the user through editing the fields and setting them as zero, if what's user intended.

  2. RELEASE USERNAME always cleans up resolver, and therefore it would cause temporarily inconsistences in some users UI, such as displaying a username from a user that no longer is the owner of that username.
    A similar problem could happen if someone changes the resolver to other chat key, where some users would see different chat ids sending from the same ens name.

@vkjr
Copy link
Contributor

vkjr commented Mar 5, 2020

@rachelhamlin, @3esmit, @flexsurfer, I've created a PR where remove button only clears local user data as @3esmit suggested in previous comment.
If I understand correctly, registrar contract doesn't have the functionality to disable name resolving without releasing it (@3esmit please correct me if I'm wrong). If so, should we add this possibility within the scope of this issue?

@rachelhamlin
Copy link
Contributor Author

The goal of this issue was to remove the user's Status chat key from the ENS name. What is meant by local user data?

@3esmit is it true that we can not remove chat key from registration without releasing the name entirely?

@rachelhamlin
Copy link
Contributor Author

Pinging @3esmit @vkjr :)

@vkjr
Copy link
Contributor

vkjr commented Mar 19, 2020

By "local user data" I mean information about ens name stored locally on user's phone. If we remove it, user won't see his name among available ones. But others still can resolve it.
As far as i understand there is only one release function in the contract that can't be used before release period reached. So probably we need to change contract and add something like unregister to remove resolving without releasing name.

@flexsurfer
Copy link
Member

i think you should be able to remove public key and wallet address from name

@flexsurfer
Copy link
Member

so we just need to call contract and set public key to empty string

@rachelhamlin
Copy link
Contributor Author

@vkjr just pinging on this - any thoughts re: Andrey's response?

@vkjr
Copy link
Contributor

vkjr commented Mar 23, 2020

@rachelhamlin, thanks for pinging!

@flexsurfer, could you please point me to the function in a contract that should be called? I'm not fully understand it.

@flexsurfer
Copy link
Member

@yenda could you help with that, how do we set public key for ens name ?

@flexsurfer
Copy link
Member

ping @yenda

@StatusWrike StatusWrike changed the title [ENS] Remove name flow [ENS] Remove name flow Apr 29, 2020
@flexsurfer flexsurfer self-assigned this May 28, 2020
@flexsurfer flexsurfer removed their assignment Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants