Skip to content

Commit

Permalink
update language around tlds and introduce nonTldPrefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Jan 8, 2024
1 parent 22a9274 commit 2a1add1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SIPS/sip-12.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,18 @@ This permission is specified as follows in `snap.manifest.json` files:
"initialPermissions": {
"endowment:name-lookup": {
"chains": ["eip155:1", "bip122:000000000019d6689c085ae165831e93"],
"tlds": [".lens"],
"matchers": { "tlds": ["lens"], "nonTldPrefixes": ["farcaster"] }
}
}
}
```

`chains` - A non-empty array of CAIP-2 chain IDs that the snap supports. This field is useful for a client in order to avoid unnecessary overhead.
`tlds` - A non-empty array of top level domains that the snap will provide resolution for. This field is useful for a client for validating input for domain resolution, also helpful in reducing overhead.
`matchers` - A non-empty object that MUST contain 1 or both of the below properties. These matchers are useful for a client for validating input for domain resolution, also helpful in reducing overhead.
`tlds` - An optional non-empty array of top level domains that the snap will provide resolution for.
`nonTldPrefixes` - An optional non-empty array of prefixes that the snap expects for non-tld domain lookup.

**Note:** Tld domains are presumed to end with "." and one of the `tlds`. Non-tld domains are presumed to start with one of the `nonTldPrefixes` followed by ":" then the domain. Respectively, an example of each would be `hassan.lens` and `farcaster:hbm88`.

### Snap Implementation

Expand Down

3 comments on commit 2a1add1

@pawmmm
Copy link

@pawmmm pawmmm commented on 2a1add1 Jan 8, 2024

Choose a reason for hiding this comment

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

@hmalik88 Can matchers be made omitted altogether? With the SNAP we are building, we would like to be able to resolve any name that matches FIO Handle format which is something@something and that does not fit the tlds or nonTldPrefixes matchers.

@hmalik88
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In your case, you would omit the tld field and provide a non-tld prefix matcher like "fio" in the nonTldPrefixes array, the client can then know what prefixes to watch out for non-tld input.

@pawmmm
Copy link

@pawmmm pawmmm commented on 2a1add1 Jan 8, 2024

Choose a reason for hiding this comment

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

@hmalik88 But wouldn't that require the user to enter fio:something@something vs just something@something?

Please sign in to comment.