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

names package

Overview

Package names enforces namespace permissions for package deployment.

Two namespace shapes grant deploy authority when enforcement is enabled:

  1. PA (personal-address) namespaces — gno.land/{r,p}/<addr>/* — the deployer's address string equals the namespace literal. Anyone can deploy under their own address.

  2. Registered-name namespaces — gno.land/{r,p}/<name>/* — r/sys/users has a (name → addr) mapping where the resolved address equals the deployer AND the name is the user's CURRENT name (not a historical alias from a rename chain). This is the bridge that lets r/sys/namereg/v1 (or any other DAO-whitelisted controller) grant deploy authority via name registration.

Authority is unscoped: a registered name owns BOTH r/<name>/* and p/<name>/* paths. There is no sub-prefix isolation (e.g. r/u/<name>/*).

The realm exposes an emergency-halt switch via SetPaused. When paused, the verifier rejects EVERY namespace check — PA included — until unpaused. This is the "true emergency" semantic; the narrow alternative (pause registered-name only, preserve PA) was considered and rejected because the threats most likely to justify pausing this realm (verifier bug, compromised controller, signature-layer incident) do not reliably exempt PA from the same blast radius.

Function

Enable

func Enable(cur realm)

Enable enables the namespace check for this realm. The namespace check is disabled initially to ease txtar and other testing contexts, but this function is meant to be called in the genesis of a chain.

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/names" -func "Enable" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "topaz-1" -remote "https://rpc.topaz.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.topaz.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/sys/names" -func "Enable" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "topaz-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.topaz.testnets.gno.land" call.tx