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.

nslogic/v1 package

Overview

Package nslogic is the swappable "business rules" half of the split (NOTES.md §9t). It holds every piece of policy that might reasonably change — pricing, character validation, payment/refund, freeze rules, transfer restrictions — and no persistent records of its own. (One throttle, not a record: when each bounded price setting last moved, timelock.gno's lastTweak. A logic swap starts it empty and loses nothing.)

Every mutation here ends by calling into nsdata's narrow Record/Raw API via cross(cur). nsdata trusts whichever address is currently wired up as trustedLogic to have done its own authorization checks correctly, so THIS realm is where "is the caller allowed to do this" actually lives. If a bug is found here, admin deploys a fixed nslogic and re-points the vault at it (ProposeTrustedLogicGrant, then ExecutePending after the timelock) — no data migration, records and config untouched.

Deliberately reads config fresh from nsdata on every call rather than caching it. The one thing that cannot be read fresh is a COMPILED regex — avl trees store the pattern string, not the compiled object — so that one value is cached, and the cache is validated against nsdata on every use.

Function

ClearPrimaryName

func ClearPrimaryName(cur realm)
Ask AI Claude ChatGPT

ClearPrimaryName switches reverse resolution OFF for the caller.

WHY THIS HAS TO EXIST, and it is a hole rather than a feature request.

nsdata sets the reverse pointer AUTOMATICALLY on a wallet's first registration — RegisterNameRecord does it, and nothing asked the person first. From that moment their address answers with their name, so anybody who sees that address anywhere can find the persona attached to it, and every transaction it has ever made becomes attributable. Retroactively: the chain is permanent and indexers keep copies.

And until now there was NO WAY OUT. ClearPrimaryRecord is gated to trusted logic, and no logic realm exposed it, so the one person the pointer is about could not remove it. A name service is a bridge between a persona and a wallet; publishing that bridge without consent and without an exit is the worst version of it.

This is the exit. It takes no arguments on purpose: a wallet has exactly one reverse pointer, and the only address it can clear is its own, so there is nothing to pass and nothing to get wrong.

WHAT IT DOES NOT DO, said plainly because a promise we cannot keep would be worse than the hole: clearing stops FUTURE lookups. It does not unpublish what was already visible, and it cannot — the history is on chain and other people have copies. The honest sequence is to choose before publishing, which is why the site now shows what the link exposes before it offers to make it.

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/nslogic/v1" -func "ClearPrimaryName" -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/nslogic/v1" -func "ClearPrimaryName" -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