Vaults map
Keyed byprincipal (the vault owner’s address). One vault per owner at any given time.
Vault fields
How often the owner must call
heartbeat(), in seconds. The vault enters the grace state once stacks-block-time − last-heartbeat exceeds this value. Set at creation and fixed for the vault’s lifetime.Additional seconds after the heartbeat interval expires before heirs can claim. Provides a buffer for temporary owner absence (hospitalization, travel, device loss). Set at creation and fixed for the vault’s lifetime.
The
stacks-block-time value recorded at the most recent heartbeat() call (or at vault creation). All state computations use this as the start of the elapsed-time window.sBTC held in the vault, denominated in satoshis (1 BTC = 100,000,000 satoshis). Updated on each
deposit-sbtc call and decremented as heirs claim their shares.USDCx held in the vault, denominated in micro-units (1 USD = 1,000,000 micro-units). Updated on each
deposit-usdcx call and decremented as heirs claim their shares.The trusted address permitted to call
guardian-pause() once during the grace period. Set to none if no guardian is designated.Whether the guardian has used their one-time pause. Once
true, the guardian-pause() function rejects all further calls with ERR-GUARDIAN-PAUSE-USED. Persists even if the owner later sends a recovery heartbeat.true when the vault is closed — either because all heirs have claimed or because the owner called emergency-withdraw(). Used as the gate for vault re-creation.The
stacks-block-time value recorded at vault creation. Informational only — not used in state computation.The number of heirs registered at vault creation (or after the most recent
update-heirs call). Used together with claims-count to determine when all heirs have claimed and the vault should auto-distribute.The number of heirs who have successfully called
claim(). When claims-count == heir-count, the vault is automatically marked as is-distributed = true.Heirs map
Keyed by an{owner, heir} principal pair. Stores the heir’s allocation.
The heir’s share of vault assets in basis points.
10000 represents 100%. All heir split-bps values for a given owner must sum to exactly 10000 — the contract enforces this on create-vault and update-heirs.Basis points
Basis points (bps) express percentages as integers to avoid floating-point arithmetic in the contract:| Percentage | Basis points |
|---|---|
| 100% | 10000 |
| 50% | 5000 |
| 33.3% | 3333 (remainder stays in vault) |
| 25% | 2500 |
| 10% | 1000 |
| 1% | 100 |
Due to integer division, tiny remainders (less than 1 satoshi or 1 micro-unit) may be left in the vault after all heirs claim. These amounts are negligible in practice but cannot be recovered once the vault is distributed.
Heir list map
Keyed by ownerprincipal. Stores an ordered list of up to 10 heir addresses for that vault owner.
- Iterate over heirs during vault creation to reset claim statuses on re-creation.
- Expose the ordered heir list via
get-heir-listfor frontend display.
Heir claimed map
Keyed by an{owner, heir} principal pair. A simple boolean tracking whether each heir has claimed.
false when a key is absent (default-to false):
reset-heir-claim private helper explicitly sets all heir entries to false so that previous claim records do not block new heirs.
Dynamic state computation
Vault state is derived on everyget-vault-status call — it is never stored as an enum field. The computation depends on two private helpers:
GUARDIAN-PAUSE-BONUS is the constant u2592000 (30 days in seconds).
State formula
State transition table
| State | Condition | is-distributed |
|---|---|---|
active | elapsed < heartbeat-interval | false |
grace | heartbeat-interval ≤ elapsed < deadline | false |
claimable | elapsed ≥ deadline | false |
distributed | — | true |
