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

namereg/v0 package

Functions

Canonicalize

func Canonicalize(s string) string
Ask AI Claude ChatGPT

Canonicalize is a delegating shim to r/sys/users.Canonicalize.

HISTORY: namereg/v0 used to host its own per-stem canonical store and its own Canonicalize (l→i only). Option B unified the canonical lookup into r/sys/users keyed by full canonical name with broader substitutions ({l,i,1}→i, {0,o}→o, {-,.,_} stripped). This shim preserves the call-site name for local consumers (blacklist init, IsReserved) and any external consumer that imported the function from namereg/v0 before Option B.

New code should call susers.Canonicalize directly.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/namereg/v0.Canonicalize()"

Result

IsPaused

func IsPaused() bool
Ask AI Claude ChatGPT

IsPaused exposes the realm's pause flag for cross-controller coordination.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/namereg/v0.IsPaused()"

Result

IsReserved

func IsReserved(stem string) bool
Ask AI Claude ChatGPT

IsReserved reports whether the given alpha stem matches a reserved role name (with implicit `s`-suffix expansion). The check is canonicalized — so `vital1k`-style l-substituted variants of a reserved name are also caught. O(1) backed by `reservedSet` built in init().

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/namereg/v0.IsReserved()"

Result

NewSetPausedExecutor

func NewSetPausedExecutor(cur realm, newPausedValue bool) dao.ProposalRequest
Ask AI Claude ChatGPT

NewSetPausedExecutor allows GovDAO to pause or unpause this realm

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/sys/namereg/v0" -func "NewSetPausedExecutor" -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/sys/namereg/v0" -func "NewSetPausedExecutor" -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
  

ProposeDeleteUser

func ProposeDeleteUser(cur realm, addr address, reason string) dao.ProposalRequest
Ask AI Claude ChatGPT

ProposeDeleteUser allows GovDAO to propose deletion of a user This will make the associated address and names unresolvable. WARN: After deletion, the same address WILL NOT be able to register a new name.

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/sys/namereg/v0" -func "ProposeDeleteUser" -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/sys/namereg/v0" -func "ProposeDeleteUser" -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
  

ProposeNewName

func ProposeNewName(cur realm, addr address, newName string) dao.ProposalRequest
Ask AI Claude ChatGPT

ProposeNewName allows GovDAO to propose a new name for an existing user. The associated address and all previous names of a user that changes a name are preserved, and all resolve to the new name.

Governance renames bypass the Open Nym Tier `nym-...\d{3}` format intentionally. The DAO is the trust root for this realm; if voters approve a rename to `vitalik` (e.g. for trademark dispute resolution or system reservations), the validation here imposes no further opinion. The new name is still subject to the base shape enforced by `r/sys/users.validateName` (`^[a-z][a-z0-9]*([_-][a-z0-9]+)*$`, max 64 chars), which runs inside the updateUsername callback below.

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/sys/namereg/v0" -func "ProposeNewName" -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/sys/namereg/v0" -func "ProposeNewName" -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
  

ProposeNewRegisterPrice

func ProposeNewRegisterPrice(cur realm, newPrice int64) dao.ProposalRequest
Ask AI Claude ChatGPT

ProposeNewRegisterPrice allows GovDAO to update the price of registration. Rejects prices below MinRegisterPrice (currently 0) at proposal-creation time. (audit finding #14: original code only rejected negative values, which would have been arithmetically nonsensical.)

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/sys/namereg/v0" -func "ProposeNewRegisterPrice" -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/sys/namereg/v0" -func "ProposeNewRegisterPrice" -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
  

Register

func Register(cur realm, username string)
Ask AI Claude ChatGPT

Register registers a new username for the caller.

Valid usernames match `nym-[a-z]{5,13}\d{3}`:

  • literal `nym-` prefix (4 chars)
  • 5-13 lowercase letters (the alpha stem)
  • exactly 3 trailing decimal digits

Total length 12-20 chars. The alpha stem additionally must NOT start with `gno`/`gi`/`gl` and must not match a reserved role name (with implicit `s`-suffix expansion). See ValidateNymFormat for the format/blacklist check.

Canonical-collision detection is enforced atomically by susers.RegisterUser via the unified canonical store in r/sys/users (decision: per Option B, every controller participates in the same canonical-form lookup keyed by full canonical name).

Only direct EOA (maketx call) invocations are supported.

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/sys/namereg/v0" -func "Register" -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/sys/namereg/v0" -func "Register" -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
  

Render

func Render(path string) string
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/namereg/v0.Render()"

Result

RenderLatestUsersWidget

func RenderLatestUsersWidget(num int) string
Ask AI Claude ChatGPT

RenderLatestUsersWidget renders the latest num registered users. For num = -1, the maximum number (100) will be displayed.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/namereg/v0.RenderLatestUsersWidget()"

Result

ValidateNymFormat

func ValidateNymFormat(username string) error
Ask AI Claude ChatGPT

ValidateNymFormat checks the regex, prefix-exclusion, and reserved- name rules in that order. Returns one of the exported sentinel errors per failure mode, or nil on success.

Does NOT run the canonical-collision check — that lives in r/sys/users (susers.IsCanonicalTaken or, atomically with the write, inside susers.RegisterUser).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/sys/namereg/v0.ValidateNymFormat()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/sys/namereg/v0, for example a function call with arguments.