ensdomains / ens-contracts

The core contracts of the ENS protocol
https://ens.domains/
MIT License
572 stars 394 forks source link

Lockable resolver #262

Open serenae-fansubs opened 1 year ago

serenae-fansubs commented 1 year ago

Lock specific record types

Lock specific text record keys but not others

Lock everything

Once a specific record type (or everything) is locked, cannot be unlocked. Once at least one lock is performed, that node will no longer be clearable (cannot increment version).

This can be used in conjunction with the CANNOT_SET_RESOLVER fuse on wrapped names to create an immutable name that is guaranteed to resolve to records forever (or at least until the name expires).

Arachnid commented 1 year ago

Is this ready for review?

jefflau commented 1 year ago

From a high level, should we consider adding a function or functions that will first check if is a) wrapped, and b) has burnt CANNOT_SET_RESOLVER and then c) the record type is locked. This could then be used as by clients to know if a record is truly immutable, or it's just the resolver that has the record locked

serenae-fansubs commented 1 year ago

From a high level, should we consider adding a function or functions that will first check if is a) wrapped, and b) has burnt CANNOT_SET_RESOLVER and then c) the record type is locked. This could then be used as by clients to know if a record is truly immutable, or it's just the resolver that has the record locked

That makes sense, I can add something like that.

Also, another consideration is the expiry of the name, and whether that should clear any locks. That would increase the complexity of this contract though.

As it stands now, if this was added into the Public Resolver, then any locks for a particular node would be permanent for that particular resolver deployment. So if Owner A locks the ETH address, but then the name expires and someone re-registers the name, Owner B would not be able to change the ETH address (that is of course, the whole point). So Owner B would be forced to update to a different resolver first.