Imagine you want your ENS name to be formatted like FirstLast.eth
or 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
firstlast.eth
orcapslock.eth
. - 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"
- normalize:
norm = normalize(input) => "firstlast.eth"
- lookup:
node = namehash(norm)
- display:
addr(node, X) = "FirstLast"
Edit:text
record could also be used - count the number of labels
L
in the display nameL = countLabels("FirstLast") = 1
- check that
normalize(first L labels of norm) == normalize(first L labels of display)
- if so, swap with the display:
FirstLast
.eth
Examples:
-
raffy.ETH
w/displayRaffy (L=1)
âRaffy.eth
-
capslock.eth
w/displayCAPSLOCK.ETH (L=2)
âCAPSLOCK.ETH
Note: the 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.