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

DeleteDomainRecord

func DeleteDomainRecord(cur realm, label string) (removed int64, done bool)
Ask AI Claude ChatGPT

DeleteDomainRecord destroys a domain and the names beneath it: it burns every token, drops every reverse-resolution pointer into them, removes the records, and finally removes the domain itself.

WHY IT EXISTS. Retiring a domain after a brand complaint, recovering the storage deposit on a domain that never sold, and clearing out fad domains nobody renewed. A logic realm cannot provide any of this, because the vault owns the trees and exposed no delete path — the only Remove call for a domain lived inside RegisterDomainRecord as the evict-and-replace step of re-registration.

IT DELIBERATELY WORKS ON A DOMAIN WITH LIVE NAMES UNDER IT. The case this exists for is a demand to remove a domain entirely, where waiting for names to lapse is not an option. Compensating the holders is handled off chain and is deliberately not a contract concern.

WHERE THIS DEPARTS FROM THE SPEC, stated plainly because it is a real difference: MAINNET.md §3d asks for all of it "in one call". It is bounded instead, deleting at most maxDeletePerCall names per call and reporting whether it finished. An unbounded loop over a tree that may hold any number of names is a transaction that stops fitting in a block once a domain gets popular — which would mean the domains most likely to attract a complaint are exactly the ones that could never be deleted, in a realm that can never be fixed. The caller repeats until `done`; for any domain of realistic size that is one call, so the no-preconditions requirement is preserved. What is NOT preserved is atomicity: a multi-call deletion is visible half-done between calls. Freeze the domain first if that matters, so nothing new lands under it meanwhile. Not Pause(): a paused registry deletes nothing at all, since this passes the same trust gate as every write.

Calling it on a domain that does not exist is a no-op reporting done, so a repeat loop terminates cleanly rather than panicking on the call that follows the last one.

Param

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 "DeleteDomainRecord" -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 "DeleteDomainRecord" -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