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.