Wallets and limits

A wallet lets an agent spend from the shared balance without holding the owner's key.

A wallet is an account that records one agent's public key and the limits on it. Its address is derived from the book and the agent's key, so an agent has at most one wallet per book. The agent signs spends with its own key; only the owner's key can create the wallet or change its limits.

The limits

LimitFieldRefusal
Per paymentper_tx_limitOverPerTxLimit
Per daydaily_limitOverDailyLimit
Allowed forallowCategoryNotAllowed
FrozenfrozenFrozen

The program checks them in this order on every spend: frozen, allowed for, per payment, per day. The daily limit counts spending within one UTC day (86400 seconds) and starts again at midnight UTC. A spend larger than the vault holds is refused with InsufficientBalance.

Allowed for

allow is a bit mask of what the wallet may pay for.

BitCategoryValue
0Models1
1Tools2
2Payments4

A wallet that may pay for models and tools has allow = 3.

Totals

The wallet also keeps what it has spent today, and what it has spent and earned in total. Earnings are credited to the wallet in the books but land in the shared balance; they do not raise the wallet's limits.

Issue a wallet and set its limitsAgentWallet fields

NextEntries and the chain