WALLET

WALLET

WALLET is the per-USER economic identity. Every USER has one. Every COIN lives in one.

EVENTS

Events

EventDirectionDescription
MINT:WORKcreditValidated work creates COIN — amount = gradient (delta only)
MINT:SIGNUPcredit500 COIN bonus on principal promotion
MINT:PYRAMIDcredit500 COIN to referrer when new principal joins
DEBIT:DRIFTdebitGovernance regression — amount = abs(negative gradient)
TRANSFERdebit/creditUSER sends COIN to USER (5% TREASURY fee deducted)
SPENDdebit/creditUSER pays COIN for SHOP product (cost_basis required)
SETTLEdebitCOIN exits to fiat via Stripe
CLOSEsnapshotEpoch close — balance snapshot, reconcile, rotate (monthly 1st)
RECORD SHAPE

Record Shape

id — content address (SHA256 of body + prev) prev — chain pointer (previous event hash) ts — nanosecond timestamp event — MINT:WORK | MINT:SIGNUP | MINT:PYRAMID | DEBIT:DRIFT | TRANSFER | SPEND | SETTLE | CLOSE from — source USER principal (SYSTEM for MINT events) to — destination USER principal (STRIPE for SETTLE) amount — unsigned COIN units work_ref — evidence pointer (commit hash, IDF id, product slug, promotion commit) referred_by — referrer USER principal (PYRAMID events only) scope — governed scope where event originated meta — { product, service, channel, note }

CONSTANTS

Constants

SIGNUP_BONUS = 500 COIN PYRAMID_BONUS = 500 COIN TRANSFER_FEE = 5% to TREASURY SUPPLY_CEILING = unique_scopes × 255 SIGNATURE_CUTOFF = 2026-03-01 CLOSE_CADENCE = monthly (1st of each month)

INVARIANTS

Invariants

MUST be append-only (no in-place edits). MUST be chain-verifiable (hash includes prev). MUST dual-write — USER TIMELINE + ORG TIMELINE + LEDGER. MUST support derived views (balance, history, aggregates). Balance = SUM(credits) - SUM(debits) from TIMELINE. Never cached independently. MUST Ed25519-sign all events after SIGNATURE_CUTOFF — reject unsigned events. MUST CLOSE monthly — reconcile LEDGER-to-WALLET, snapshot balance, rotate. MUST enforce SUPPLY_CEILING — reject MINT:WORK if cumulative exceeds ceiling.

CLOSE RECONCILIATION ALGORITHM

CLOSE Reconciliation Algorithm

Triggered monthly on the 1st (or vault close –reconcile).

For each USER: derive balance from TIMELINE, compare to WALLET.json. Flag MISMATCH. Walk LEDGER: verify each .idf has corresponding WALLET event. Report unreconciled. Append CLOSE event to each USER TIMELINE. Update last_close in each USER WALLET.json.

SUPPLY_CEILING ENFORCEMENT

SUPPLY_CEILING Enforcement

Before every MINT:WORK:

Count unique scope keys in LEDGER chain. ceiling = unique_scopes × 255. Sum all MINT:WORK amounts from ORG TIMELINE. Reject if cumulative + new_amount > ceiling.

ED25519 SIGNATURE VALIDATION

Ed25519 Signature Validation

After SIGNATURE_CUTOFF (from COIN.v1.json contract):

Every circulation event MUST carry signature. No key-pair → reject (run vault keygen –user ). Message: id|prev|ts|event|user|amount UTF-8. Algorithm: Ed25519 (RFC 8032). Keys: PEM in KEY.pub / KEY.priv. Invalid signature → reject, log to stderr.

RUNTIME STRUCTURE

Runtime Structure

~/.canonic/VAULT/USERS/{USER}/ ├── WALLET.json — derived balance + totals └── TIMELINE.jsonl — append-only event stream

*WALLET SPEC SERVICES*
TALK AUTO