mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
Add pkg/wallet implementing the 9-tier model (hot, warm, cold, gas, bridge, contract_admin, validator, quarantine, disaster_recovery) with canonical TierPolicy, in-memory Registry, domain-separation enforcement, and per-wallet velocity/daily counters. Domain separation rejects (cloud_provider, account) collisions and HSM-provider collisions; cold + DR demand 3+ distinct cloud and HSM vendors. Hot/warm/bridge/contract_admin demand 2+. Gas tier disables the check (low value, allowlisted only). Sign dispatch in pkg/api/handlers_wallet.go routes per tier: quarantine rejects unconditionally; over-cap rejects with usage view; airgapped tiers (cold, DR) return airgapped_queued; timelocked tiers return timelocked with end-time; auto-approval tiers (hot, gas, bridge, validator) commit counters and return auto_approved when amount is under the large-amount escalation threshold; remainder return approval_required with HumanApprovalsMin (or HumanApprovalsLarge above threshold). Routes mounted at /v1/wallet (no /api/ prefix per house rule). Tests: - pkg/wallet/tier_test.go: 16/16 pass - e2e/tier_lifecycle_test.go: 9/9 pass