mirror of
https://code.gri.mw/GUI/grim.git
synced 2026-07-15 03:08:56 +00:00
ea07fd2081
App side of the index-0 unpinning. Wallet::mint_proof_address allocates the next fresh derivation index from a persisted, never-reusing counter (src/wallet/proof_addrs.rs; proof_addrs.json in the wallet dir — an index carries no secret, the keys live in the wallet seed) and derives its slatepack/proof address through the wallet's existing indexed derivation (address_from_derivation_path), exactly as the app's default index-0 address is derived. Index 0 stays the default app address; nothing changes for normal receives. Allocation starts at 1, is monotonic and persisted before use (a crash burns an index, never reuses one), and is capped at MAX_PROOF_ADDRESS_INDEX = 1023 — the receive-side scan bound of the matching grin-wallet submodule patch (kept as a local constant so this crate also builds against the unpatched upstream submodule; the wallet-side patch, which detects the addressed index on receive and signs the payment proof with the matching key, lives in the wallet submodule on a local branch pending the owner's decision on where that patch is pinned). Tests: allocation monotonic + persistent from 1, refuses past the scan bound, corrupt counter degrades to address reuse (the old single-address world), never a fund risk.