Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

nsdata/v2 package

Overview

Package nsdata is the registry — the records behind every name.

IT IS REPLACEABLE NOW, and that changes what every comment below means.

Until this generation the vault held ownership as well as records, which made it the one realm that could never be redeployed: a "new nsdata" was an empty registry and everybody's names with it. So everything here was written as if it would ship forever — no constants, no policy, no display code — and the comments say "can never be replaced" throughout.

Ownership has moved to nsnft, the small frozen token realm. This realm keeps records — dates, the frozen bit, TTL, profile data, reverse resolution, pricing globals, domains — and reads every owner from the ledger rather than storing one. Replacing it is a new package plus one Trust call on nsnft; no token moves, no holder notices. The integration address the outside world keeps is nsnft's, not this one's.

The two old rules still hold, for a better reason than before:

  1. NOTHING IS A CONSTANT. Term length, grace period, size caps — all settable. Not because a mistake would be permanent any more, but because a registry that needs a redeploy to change a number is a registry that gets redeployed carelessly.

  2. THE REGISTRY STORES, IT DOES NOT DECIDE. Pricing math, validation, what a profile field means — all of it lives in nslogic. Anything this realm "knows" is a rule that needs a migration to change.

Rule 2 is why Domain and Name carry an `extra` tree instead of a growing list of typed fields.

Function

UpgradeFreeRecord

func UpgradeFreeRecord(cur realm, label, domainLabel string, newOwner address) error
Ask AI Claude ChatGPT

UpgradeFreeRecord lifts the free-tier hold — the paid upgrade.

Preserves the dates: this is not a re-registration.

`newOwner` exists because the common case is somebody who decided to sell and, in the same moment, wants the name in a wallet they control rather than the key they were given. That move is a burn and a mint here, because a held token cannot be transferred by design.

THE PROFILE DOES NOT GO WITH IT, and it used to. The move re-stamped the old data to the new epoch and gave the recipient a reverse pointer — and `newOwner` can be ANY address. An audit spelled out the attack: fill a free name's profile with your own pay addresses, pay list price to upgrade it into a victim's wallet, and the victim's name now asks people to pay you, their address reverse-resolves to it, and their own later edits do not clear it because the epoch is already current. So the data is left in the previous epoch, where every read hides it and the next write destroys it, and the recipient gets no pointer they never chose. A person moving their own name to a new wallet re-enters their profile once; that is the price of the move not being usable against somebody else.

Refused for a frozen name. Upgrading must never be the way a disputed name gets out of its hold.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-mnsrehearsal001/nsdata/v2" -func "UpgradeFreeRecord" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-mnsrehearsal001/nsdata/v2" -func "UpgradeFreeRecord" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx