Skip to main content

Identity Service Components

L1 ID Bot & L1 ID Tokens

Whenever a Lamina1 user reserves a new Standard Username (see "Lamina1 Hub Usernames" section below), their account will interact with Lamina1’s custom ID Bot, which operates a faucet for L1ID tokens. This faucet is designed to give users very limited amounts of L1ID tokens to facilitate the purchase of usernames, only enough to pay for transaction fees. Under the current Lamina1 Identity Service Architecture, drip requests will renew for users every 24 hours.

Using L1 ID tokens, users can reserve Standard Usernames by interacting with the Controller smart contract on the ID Subnet. Conversely, when purchasing a Premium Username, users interact with the C-Chain, and the ID Bot submits the username reservation transaction on the Lamina1 Identity Subnet, and must purchase their Premium Username using L1 Betanet tokens.

In either case, once a user has registered a username, extra information such as a nickname, socials (Email address, Twitter account, Discord profile, etc.) can be set on the Lamina1 Identity Subnet. This is done by interacting directly with the Resolver contract (see ‘Resolver’ section below).

Right now, there is no way to redeem or purchase L1ID tokens directly. Instead, the allocation of these tokens is taken care of completely behind the scenes of the Lamina1 Hub.

NOTE: If you receive an error message reading ‘Username change request denied’ when you are attempting to purchase or change your Standard Username, check back on the Hub later for traffic/gas fees to go down, or for the next automatic allocation of L1ID tokens to your account. We are also actively investigating a bug Metamask users sometimes have when trying to register Standard Usernames for the first time, and recommend if you have an error, to refresh the page and try again if you encounter it. If you still get an error, ping our moderators on the Lamina1 Discord for help.

Under the current smart contract, users should be able to change or reserve a Standard Username once every 24 hours.

Registry

The Registry is the top level smart contract that allows registration of usernames and domains in the Lamina1 Identity Service. Each username/domain (also called a Record) is identified by a 32 byte hash value referred to as node. The deployer of the Registry contract is the owner of the top level node, which is the 32 byte value of all 0’s. The owner of each node can transfer it to other addresses, or register subnodes. This means that it’s not possible to register usernames directly on the top level node (for example, the “neal” username on top level would actually be a domain: “.neal”). For each record, the owner can set the Resolver and TTL values.

The owner of the Registry can only set the owner of subnodes of the top level node, which correspond to .domain. The subnode value is computed as keccak256(node, label), where label = keccak256(domain). 

For example, the label value for the .l1 domain is:

0x1fb91f7eb2cf2a8094802e82512b95af372f66555c0bce96861bfb2f7ccfba8a

and the subnode value is keccak256(0x0000000…, 0x1fb91f7e…), which is:

0x72b414450a3ee811aa787f22943b2863e0160fa64e8bf72d74b9a8cc60588249

Subsequently, the owner of the .l1 domain, can register subnodes within its domain, for example: neal.l1. It would be quite cumbersome to have a human/bot control the domain, issuing registrations for each user wanting a username within that domain. Instead this process is managed by the Registrar smart contract, which is described in the next section.

Resolver

The Resolver is the smart contract that is responsible for resolving usernames to any registered data: blockchain address, name, email, etc. The process of looking up some data (address for example) for a username starts by getting the Resolver contract address from the Registry. Then, the specific function is called on the Resolver to retrieve the desired data. Data for a given username can be set by its owner.

For example, the following is the process of looking up the address and name for “neal.l1”:

Compute the node from the username\ neal.l1 -> node = keccak256(0x72b41445…, keccak(neal))

Get the address of the resolver contract from the Registry\ resolver = registry.resolver(node)

Get the address from the resolver\ addr = resolver.["addr(bytes32)"](node)

In order to increase performance, the Lamina1 Hub can skip checking for the resolver address in the Registry, and directly use the public L1IS Resolver. If an experienced user wants to use a custom Resolver and modifies the resolver address in the Registry, the name resolution won’t work properly in the Hub. For L1NISv1, we believe this is a good tradeoff.

Registrar

The Registrar is the smart contract that manages registration of usernames under a specific domain in the Lamina1 Identity Service. This can be a simple first in first served (FIFS) registration service, or have more complex rules. In the case of L1ISv1, we use the same BaseRegistrar contract that is used by ENS to manage the .eth domain. This contract is still essentially a FIFS service, but it’s access controlled, so that only registered controllers can register/renew usernames, instead of users. Furthermore, the BaseRegistrar adheres to the ERC721 interface, so that usernames can be seen as NFTs, and are therefore easily transferable to other users. usernames are registered with expiry dates, after which there is a hardcoded 90 day grace period, where the owner of the username can renew it.

The Registrar itself doesn’t impose any limitations on price and duration of the registration of usernames. This is instead managed by a Controller contract. In ENS’s .eth domain, the Controller includes a pricing mechanism that charges shorter usernames more, and also charges for longer durations of registration. There is also a price oracle which converts the pricing in USD to ETH. For L1ISv1, there is a custom built Controller, which manages the registration of Standard and Premium usernames.

ReverseRegistrar

The ReverseRegistrar is the smart contract that manages reverse registrations. During deployment of contracts, the ReverseRegistrar is assigned the special domain “.addr.reverse”. When registration of usernames is processed by the Controller, the reverse registration is also performed, so that the user’s address points back to the acquired username, as previously mentioned.

Controller

The Controller is the smart contract that manages the registration of Standard and Premium usernames. As previously mentioned, users can directly register free usernames, but only designated controller addresses (in this case, the ID Bot), can register Premium usernames. This contract includes all the logic necessary to validate free usernames, and to ensure renewal of Premium usernames can only be performed during the grace period.

PaymentCollector

The PaymentCollector is the smart contract that manages receiving the fees, in native L1, for purchasing Premium usernames. The ID Bot reads from this contract, detecting purchases, and submitting them to the Controller contract on the Lamina1 Identity Subnet. The purchase price is set in the contract, and can be modified by its owner.