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

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

qrcregistry/v1 package

Overview

Package qrcregistry keeps the Quantum Recovery Commit of user accounts.

A commit is a pair of Merkle roots, each standing for at least 64 Lamport one-time keys, one tree hashed with SHA-256 and the other with Keccak-256 (see package qrc). An account registers its commit once, with an ordinary transaction, while its usual key can still be trusted. From then on the one-time keys, and nothing else, can speak for the account in this realm:

  • Bind registers new public key bytes of any kind for the account,
  • Rotate replaces the commit before its keys run out,
  • Authorize lets another realm spend a key on a request of its own.

Bind and Rotate are open to any sender, and Authorize to any realm, for approvals made out to that realm's package path. What they check is a pair of hash-based signatures, one per tree, never who signed the transaction. An account whose usual key has been broken can therefore still name a new public key here, and whoever broke that key cannot touch the commit. This realm only records that key: for it to sign for the account would take a change to the chain.

Each one-time key signs once. Once every key of a commit is spent, the account can never bind, rotate or authorize again here, and the key bound last stays for good, so a wallet keeps the last key of a commit for a rotation. A commit is never deleted: what it stores keeps its storage deposit.

The realm has no owner, no administrator and no parameter that can change after deployment.

Function

Register

func Register(cur realm, rootSHA256, rootKeccak256 string, height int)
Ask AI Claude ChatGPT

Register stores the Quantum Recovery Commit of the calling account: the roots of its SHA-256 and Keccak-256 trees, hex encoded, and their height.

An account registers once. Its usual key has no say over the commit afterwards; only the one-time keys can replace it, through Rotate.

A registration can never be corrected or withdrawn, and nothing here checks that the roots are a SHA-256 tree and a Keccak-256 tree of the given height: derive both roots and the height from the kit, in this order, and check them before sending. The caller must be the account itself, in a direct call or in a script it runs; a session key is refused.

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-rootlatch001/qrcregistry/v1" -func "Register" -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-rootlatch001/qrcregistry/v1" -func "Register" -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
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/nym-rootlatch001/qrcregistry/v1, for example a function call with arguments.