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

receipt package

Overview

Package receipt is an append-only log of agent execution receipts.

The thesis: provenance is not correctness. A chain can prove *who* committed to an output, *when*, that the bytes have not changed since, and *what* was staked or attested — but it cannot, by itself, prove the output was any good. Correctness comes from an external validation mechanism.

So a receipt stores commitments (hashes) to the task, inputs, outputs, tool calls and runtime, never the raw data — that lives off-chain. The realm then lets independent validators attach attestations: "I re-ran this and it reproduced", "the tests pass", "the output matches the commitment", or "rejected". The receipt's trust level is exactly the sum of the attestations it has collected, and nothing more.

Functions

Attest

func Attest(cur realm, seq uint64, verdict, note string)

Attest attaches an independent validator's verdict to a receipt. The same validator cannot attest twice; the author of a receipt cannot attest to their own work (self-attestation proves nothing).

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/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt" -func "Attest" -args $'' -args $'' -args $'' -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/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt" -func "Attest" -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 "topaz-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.topaz.testnets.gno.land" call.tx
  

Confirmations

func Confirmations(seq uint64) (positive, rejections int)

Confirmations returns (positive, rejections) attestation counts. It is a count of independent verdicts, deliberately NOT a truth value: a caller decides what threshold it trusts.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt.Confirmations()"

Result

Count

func Count() int

Count returns the number of receipts recorded.

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt.Count()"

Result

Record

func Record( cur realm, agent, taskHash, inputCommitment, outputCommitment, runtimeID, policyVersion, toolCallsRoot string, humanIntervened bool, ) uint64

Record appends a new execution receipt and returns its sequence number. The caller commits to opaque hashes; the realm never sees raw payloads.

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/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt" -func "Record" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -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/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt" -func "Record" -args $'' -args $'' -args $'' -args $'' -args $'' -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 "topaz-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.topaz.testnets.gno.land" call.tx
  

Render

func Render(path string) string

Render shows the receipt log, or a single receipt at :<seq>.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt.Render()"

Result

Get

func Get(seq uint64) Receipt

Get returns a copy of a receipt by sequence number.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/receipt.Get()"

Result