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.

heirrealm package

Overview

Package heirrealm is a dead-man's-switch inheritance realm for Gno.land.

The problem: a Gno holder dies, loses their keys, or simply disappears, and their GNOT is locked forever. No will, no custodian, no recovery.

HeirRealm lets the holder name a beneficiary and a check-in window. As long as the holder checks in before the window expires, nothing happens. Miss the window and anyone — an incentivised keeper, not a trusted custodian — can trigger the release. The keeper earns a small fee for doing the work; the rest goes to the beneficiary. The keeper can never release early, never change the beneficiary, and never touch the funds before the deadline.

Design choices (all documented in README.md):

  • Denomination is ugnot only (GNOT). One coin type keeps the accounting auditable.
  • Keeper fee is 2% (200 basis points) of the vault balance at release time. Integer math: fee = balance * 200 / 10000. For balances under 50 ugnot the fee rounds to 0.
  • Check-in interval must be between 60 seconds (1 minute, so the 60-second demo can fast-forward) and 365 days.
  • CheckIn only works BEFORE the deadline. Once the deadline has passed, the vault is claimable and the owner can no longer rescue it by checking in — that is the whole point of a dead-man's switch.
  • Cancel (owner refund) only works BEFORE the deadline and only while the vault is still active. After expiry the funds belong to the beneficiary.
  • The keeper may not be the owner or the beneficiary.
  • Time is block time: time.Now(), the same timelock primitive used by examples/gno.land/r/demo/defi/atomicswap in gnolang/gno.

Caller authentication follows the atomicswap pattern: payment functions require cur.Previous().IsUserCall() and read the attached coins from unsafe.OriginSend(). A realm in the middle of a call chain cannot fake a payment, because OriginSend describes the transaction envelope and IsUserCall rejects non-wallet callers.

Social/voice recovery is intentionally NOT in this MVP. It is listed as a future extension in README.md.

Function

TriggerRelease

func TriggerRelease(cur realm, id int) (beneficiaryShare int64, keeperFee int64)
Ask AI Claude ChatGPT

TriggerRelease releases an expired vault. Anyone may call it — that is the keeper's job — but the keeper may not be the owner or the beneficiary, and the deadline must have passed. The keeper earns 2% of the balance; the beneficiary receives the remaining 98%. The keeper is paid for doing the work, never a custodian: they cannot release early, change the beneficiary, or touch the funds before expiry.

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/g1pzw2mc795ahjumtmkxjyxhz0awklc3apyfpw9e/heirrealm" -func "TriggerRelease" -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/g1pzw2mc795ahjumtmkxjyxhz0awklc3apyfpw9e/heirrealm" -func "TriggerRelease" -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/g1pzw2mc795ahjumtmkxjyxhz0awklc3apyfpw9e/heirrealm, for example a function call with arguments.