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

provable/v0 package

Overview

Package provable is an honest demonstration of what gno.land can and cannot prove about itself.

It keeps a small append-only log in a Merkle mountain range and hands out inclusion proofs against the log's root. That part works, and it is the useful half: a realm can commit to a set and let anyone verify membership cheaply, with one native call.

The other half is the point of the realm. A proof here says "this entry is consistent with the root this realm published". It cannot say "this root is the chain's own", because:

  1. gno.land mounts two stores (gno.land/pkg/gnoland/app.go). The IAVL one is merkleized and holds package source and account balances. The other is a plain dbadapter whose Commit is documented as "Always returns a zero commitID, as dbadapter store doesn't merkleize", and THAT is where every realm's objects live. So no realm's state, including this log, contributes anything to the app hash. There is no state proof to produce.
  2. chain/runtime exposes ChainID, ChainDomain, ChainHeight and GetSessionInfo, and nothing else. No app hash, no block hash, no header. So even given a Tendermint proof, a realm has no trusted root to check it against.

The one crack in the wall: an ESCAPED object, one referenced across realm boundaries, does get its hash written into the IAVL store (gnovm/pkg/gnolang/store.go). Cross-realm objects are therefore partially provable already. Nothing else is.

Demo of gno.land/p/moul/x/merkle/v0 and gno.land/p/moul/x/mmr/v0.

Function

Append

func Append(cur realm, entry string) int

Append adds an entry to the log and returns its index. The root moves, so every previously issued proof stops verifying against the new root: that is the nature of an append-only commitment, not a bug.

Param

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/moul/x/provable/v0" -func "Append" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/provable/v0" -func "Append" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx