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

Added condition ENS ownership #564

Open
wants to merge 2 commits into
base: epic-offchain
Choose a base branch
from

Conversation

andresceballosm
Copy link

@andresceballosm andresceballosm commented Aug 8, 2024

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:

  • This proposal suggests adding a condition for ENS on the client side. The client will send a structure to the node as shown below. This structure will enable the validation of whether the signer in the decryption process is the owner of the ENS with the resolved address (validate that signer === resolvedAddress).
  {
  "schema": {},
  "value": {
    "conditionType": "ensOwnership",
    "domain": "tapir",
    "ensName": "andrestest.eth",
    "resolvedAddress": "0xf45ED59ea03AaA29EAB6DB0Ea019E5299b335Ea2"
  }
}

High-level idea of the changes introduced in this PR. List relevant API
changes (if any), as well as related PRs and issues.

Issues fixed/closed:

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network. E.g.,
if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:

  • ENS resolve only works in mainnet and Sepolia
  • to call the condition
     const ensCondition = new conditions.ensOwnership.EnsAddressOwnershipCondition({
        ensName: 'andrestest.eth',
        signer,
        domain
      });

What should reviewers focus on? Is there a particular commit/function/section
of your PR that requires more attention from reviewers?

@theref theref self-requested a review August 9, 2024 08:21
@theref
Copy link
Contributor

theref commented Aug 9, 2024

This is a great start, thank you! I've got 2 comments :)

  1. With the current design, you're converting the ens name to an address using viem. This happens at condition creation time. The problem here is that ens ownership can change, and the condition won't stay in line with the ownership.

  2. This implementation would also require us to build an equivalent ensOwnership condition in nucypher/nucypher. Would it be possible to have ensOwnership be a wrapper of ContractCondition?

The condition is still defined exactly as you specified:

     const ensCondition = new conditions.ensOwnership.EnsAddressOwnershipCondition({
        ensName: 'andrestest.eth',
        signer,
        domain
      });

but behind the scenes it would create a contract condition that reads from the ens registry. This would fix both of my comments. @KPrasch thoughts?

@piotr-roslaniec
Copy link
Contributor

Please see this issue comment #104 (comment) for the context on ENS resolution. TLDR, it's a multi-step process that requires some development in nucypher/nucypher and we can't support it out-of-the-box using ContractConditions at the moment. Maybe with sequential conditions?

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 this pull request may close these issues.

3 participants