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.

memba_quest_attestation_v1 package

Overview

Package memba_quest_attestation_v1 is the on-chain quest/XP attestation realm for Memba (audit Q-05, Track A — "Model B" offline-signed voucher).

WHY: Memba quest XP lives in a centralized backend DB; the chain holds no verifiable record. This realm makes a quest completion + its XP an independently verifiable on-chain fact, WITHOUT giving the backend a hot key that can write arbitrary state.

HOW (Model B — offline voucher):

  • The backend holds an OFFLINE ed25519 signing key; it NEVER broadcasts.
  • For a server-verified completion it issues a voucher (address, questId, xp, nonce) + ed25519 signature over the canonical message addr "|" questId "|" itoa(xp) "|" nonce (UTF-8 bytes)
  • The USER broadcasts RecordCompletion(...) with the voucher (they pay gas).
  • This realm verifies the signature against the configured signer pubkey, rejects reused nonces (replay), bounds xp, and records the completion + cumulative attested XP.

TRUST MODEL: the signature is the authority, NOT the caller — anyone may broadcast a valid voucher (it can only record the backend-attested fact). The only privileged action is rotating the signer pubkey (owner multisig).

The canonical message format is a CONTRACT with the backend signer — it MUST stay byte-identical on both sides. See canonicalMsg.

Function

AcceptOwnership

func AcceptOwnership(cur realm)
Ask AI Claude ChatGPT

AcceptOwnership completes the handoff. Only the staged pendingOwner may call it — including against the outgoing owner, so the two steps cannot be collapsed into one by the party giving up the role.

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/g1a9g8nu3m0xgx58hh36fph49e2xkqm9axlxuf5z/memba_quest_attestation_v1" -func "AcceptOwnership" -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/g1a9g8nu3m0xgx58hh36fph49e2xkqm9axlxuf5z/memba_quest_attestation_v1" -func "AcceptOwnership" -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