Names
Using the node12.5.12+

Names

Unique names on Lotus: claim, settle, renew, transfer and release; prices and delays, the commands and the routes.

A name is a unique handle in the VOIX phone book, held by a contract output that only its owner can spend. Uniqueness is decided by the same rules on every node whose phone book is complete (complete: true in the answers; a pruned node's may not be, and can then call a taken name free); it is not a consensus rule. Names open with the contracts upgrade.

A name has 4 to 32 characters a to z, 0 to 9, ., _ and -. The first and the last are a letter or a digit, and two of ., _, - never follow each other.

Claim a name #

  1. Commit (namecommit): publish a hash of the name, the owner and a secret salt. Nobody can read the name from it.
  2. Claim (nameclaim), 1 to 5,040 blocks later: reveal the name and lock its price in an escrow. The first valid claim is pending.
  3. Settle (namesettle), within 720 blocks (about a day) of the claim: the escrow is burned and the name is yours.

A claim that loses, or is not settled in time, is taken back with namerefund 5,760 blocks (about 8 days) after it: 90% comes back and 10% is burned.

Warning

Keep the salt that namecommit returns. It is also in <datadir>/voix/names.json. Without it the claim fails.

Price and time #

  • A period is 262,800 blocks, 365 days at 2 minutes a block. A name is paid for at most 5 periods ahead.
  • The price of a period depends on the length of the name and on the block subsidy (the median of 2,016 blocks). Ask the node: GET /api/v1/book/name/<name>/price?periods=1.
  • After the end there is a grace of 21,600 blocks (30 days): the name does not resolve, and only its owner can renew it.
  • A name that falls free costs extra for 8 days, halving each day.

Change a name #

CommandDoes
namerenewAdd periods; the new end is the old end plus the periods paid
nametransferGive it to another address
namereleaseFree it now; the price is not refunded
namerevokeWith the recovery key: move it to a new owner, or freeze it until its end plus the grace

If the name has a recovery key, a transfer keeps it unless that key cosigns: the seller could otherwise take the name back. Each command takes dry_run. See JSON-RPC.

Read the registry #

GET /api/v1/book/name/<name>, /history and /price; book/names?owner=<address>; book/names/recent; book/names/stats. A free name answers 200 with "status": "free". The format of the records: BOOK.

Source share/www/docs/names.md in the lotusd repository
Checked against doc/voix/names.md src/voix/names.h src/rpc/names.cpp src/modules/book/book_module.cpp