Imagine you want your ENS name to be formatted like
CAPSLOCK.ETH. This extra formatting lets your users know they’re interacting with the correct name and provides a visual checksum.
- The normalization process casefolds so both of these names present like
- The reverse record (primary name) is per-account, not per-name.
Let’s claim a new coinType
X, such that
addr(node, X) now corresponds to the display name as UTF8.
Since this field can be set to anything, I suggest the following process for rendering the display name:
input = "firStlasT.eth"
norm = normalize(input) => "firstlast.eth"
node = namehash(norm)
addr(node, X) = "FirstLast"Edit:
textrecord could also be used
- count the number of labels
Lin the display name
L = countLabels("FirstLast") = 1
- check that
normalize(first L labels of norm) == normalize(first L labels of display)
- if so, swap with the display:
L optimization just makes it so less bytes are required in the common case. If you want to style the full name, you pay for those bytes. A more advanced solution could query the remaining labels for additional formatting, but that seems necessary.
If you don’t set a display, the normalized name is your display name.
Using this protocol, any name could be checked to see if it matches the display name (the well-intentioned case). This also encourages the use of capitalization to increase readability.
This is also a solution to
FE0F being ignored and
ZWJ being dropped from new emoji sequences, since the owner can choose any UTF8 sequence that normalizes to the same value.
Lastly, this can be implemented today w/o any changes: just pick
X and provide a function
ens_display(name: string): string that performs the process above.