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

memba_quest_attestation_v1 state

Back to all declarations

OwnerAddress

untyped string

── Constants ────────────────────────────────────────────────

Value

"g1x7k4628w93a7wzdhqc06atzx0v50rnshweuxu0"

MaxAttestXP

untyped bigint

── Constants ────────────────────────────────────────────────

Value

(1000 <untyped> bigint)

pubKeySize

untyped bigint

// ed25519 public key length (gno crypto/ed25519 exposes no const)

Value

(32 <untyped> bigint)

sigSize

untyped bigint

// ed25519 signature length

Value

(64 <untyped> bigint)

fieldSep

untyped string

── Constants ────────────────────────────────────────────────

Value

"|"

signerPubKey

[]uint8

── State ────────────────────────────────────────────────────

Value

<zero>

completions

*avl.Tree

// addr + ":" + questId -> int64 (block height recorded)

Open
OID
008ff0…6ea3:19
completions details

Inspect pointer

attestedXP

*avl.Tree

// addr -> int (cumulative attested XP)

Open
OID
008ff0…6ea3:21
attestedXP details

Inspect pointer

usedNonce

*avl.Tree

// nonce -> true (replay guard)

Open
OID
008ff0…6ea3:23
usedNonce details

Inspect pointer

canonicalMsg

func(addr string, questId string, xp int, nonce string) []uint8

canonicalMsg is the EXACT byte string the backend signs offline and this realm verifies. It MUST stay byte-identical to the backend signer (ADR Track A / A.3). strconv.Itoa gives a canonical decimal with no leading zeros, so both sides agree for any xp.

Open
OID
008ff0…6ea3:9
canonicalMsg details

Inspect func

completionKey

func(addr string, questId string) string
Open
OID
008ff0…6ea3:10
completionKey details

Inspect func

validXP

func(xp int) bool

validXP bounds the attestable XP (see MaxAttestXP).

Open
OID
008ff0…6ea3:11
validXP details

Inspect func

fieldsClean

func(addr string, questId string, nonce string) bool

fieldsClean rejects any voucher field containing the separator. This makes the canonical message PROVABLY unambiguous (no field-injection collision) without trusting the backend's nonce charset: with no field able to contain "|", a given canonical byte string maps to exactly one (addr, questId, xp, nonce).

Open
OID
008ff0…6ea3:12
fieldsClean details

Inspect func

verifyVoucher

func(pub []uint8, addr string, questId string, xp int, nonce string, sigHex string) bool

verifyVoucher reports whether sigHex is a valid ed25519 signature by pub over the canonical voucher message. Pure (no state) so it is unit-tested directly with offline-generated test vectors.

Open
OID
008ff0…6ea3:13
verifyVoucher details

Inspect func

SetSigner

func(pubKeyHex string)

SetSigner installs/rotates the backend's offline signer PUBLIC key (32-byte hex). Owner-multisig only. This is a crossing function, so PreviousRealm() correctly identifies the immediate caller (see gno interrealm semantics).

Open
OID
008ff0…6ea3:14
SetSigner details

Inspect func

RecordCompletion

func(addr string, questId string, xp int, nonce string, sigHex string)

RecordCompletion verifies a backend-signed voucher and records the completion + its XP on-chain. Idempotent per (addr, questId); replay-proof per nonce. Panics (reverting the tx) on any invalid/again-used/out-of-range voucher.

Open
OID
008ff0…6ea3:15
RecordCompletion details

Inspect func

GetAttestedXP

func(addr string) int

GetAttestedXP returns addr's cumulative on-chain attested XP (0 if none).

Open
OID
008ff0…6ea3:16
GetAttestedXP details

Inspect func

GetRecordedCompletions

func(addr string) string

GetRecordedCompletions returns addr's attested quest IDs as a comma-separated list (empty string if none), in ascending key order.

Open
OID
008ff0…6ea3:17
GetRecordedCompletions details

Inspect func

Render

func(path string) string

Render is the human/gnoweb view; the authoritative reads are the exported Get\* funcs (queried via vm/qeval).

Open
OID
008ff0…6ea3:18
Render details

Inspect func
OwnerAddress : untyped string ="g1x7k4628w93a7wzdhqc06atzx0v50rnshweuxu0"
MaxAttestXP : untyped bigint =(1000 <untyped> bigint)
pubKeySize : untyped bigint =(32 <untyped> bigint)
sigSize : untyped bigint =(64 <untyped> bigint)
fieldSep : untyped string ="|"
signerPubKey : []uint8 =<zero>
completions : *avl.Tree Inspect
attestedXP : *avl.Tree Inspect
usedNonce : *avl.Tree Inspect
init.9 : func() Inspect
canonicalMsg : func(addr string, questId string, xp int, nonce string) []uint8 Inspect
completionKey : func(addr string, questId string) string Inspect
validXP : func(xp int) bool Inspect
fieldsClean : func(addr string, questId string, nonce string) bool Inspect
verifyVoucher : func(pub []uint8, addr string, questId string, xp int, nonce string, sigHex string) bool Inspect
SetSigner : func(pubKeyHex string) Inspect
RecordCompletion : func(addr string, questId string, xp int, nonce string, sigHex string) Inspect
GetAttestedXP : func(addr string) int Inspect
GetRecordedCompletions : func(addr string) string Inspect
Render : func(path string) string Inspect