Skip to content

Royal ID

The User struct

Royal IDs are stored in User structs πŸ”—:

FieldTypeMeaning
iduint256Unique identifier (autoincrement)
usernamestringReadable username
custodyaddressThe address currently controlling this Royal ID
recoveryaddressAddress authorized to reset the custody address (optional)

Requirements

For user information to be valid, it needs to follow these requirements:

  • Both username and custody address have to be unique.
  • The username has to be URL safe (matching the regular expression /^[a-zA-Z0-9_][a-zA-Z0-9\._-]+$/)

Changes

Royal IDs can change their username (once every 28 days), custody address, and recovery address. The custody address can also be changed by the recovery address. See here for more information.

To avoid people registering under names that should belong to somebody else, Royal also has the ability to modify an ID’s username.

Contracts

Control and data flows

Queries

You can get Royal IDs by identifier, custody address, or username.

Query byFunctionBaseBase Sepolia
idgetUserById(uint256 id) πŸ”— πŸ”— πŸ”—
usernamegetUserByUsername(string username) πŸ”— πŸ”— πŸ”—
custody addressgetUserByAddress(address wallet) πŸ”— πŸ”— πŸ”—