Skip to content

feat: encrypted account send via ZK proofs#559

Open
n13 wants to merge 1 commit into
mainfrom
feat/encrypted-account-send
Open

feat: encrypted account send via ZK proofs#559
n13 wants to merge 1 commit into
mainfrom
feat/encrypted-account-send

Conversation

@n13

@n13 n13 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes encrypted (wormhole) accounts spendable. An encrypted account is one HD sequence of wormhole addresses (m/44'/189189189'/0'/0'/n') treated as a single UTXO pool:

  • Send: coin selection picks unspent UTXOs (largest-first, 7 leaf proofs per aggregated batch), pays the recipient via exit slot 1 and returns change to a fresh address via exit slot 2 of the last leaf — no linkage between deposits and spends. Packaged as an EncryptedSendStrategy so the shared recipient/amount/review screens are untouched.
  • Receive: the Receive screen rotates to the next unused address (linear with change addresses), so deposits aren't linkable to each other.
  • Recovery: gap-limit scan (same algorithm as transparent accounts, batched indexer queries) rediscovers all funds from the mnemonic alone; runs automatically on wallet import.
  • In-flight consistency: spent nullifiers + pending change are persisted per batch, so balances stay exact mid-send and back-to-back sends can't double-select inputs.

WormholeClaimService is generalized into WormholeSendService (per-leaf output assignments); mining-rewards claim becomes a wrapper over it, shared with the miner app. Rust ProofInput now exposes exit_account_2/output_amount_2.

Feature-flag gated by enableEncryptedAccount.

Test plan

  • quantus_sdk unit tests incl. new coin-selection suite (fee/quantization/batch-minimum/multi-batch cases)
  • dart analyze clean on quantus_sdk, mobile-app, miner-app
  • Manual: send from encrypted account (single & multi-batch), verify change lands on fresh address and balance refreshes
  • Manual: wipe + reimport wallet, verify encrypted funds are rediscovered
  • Manual: miner-app claim rewards regression

Make encrypted (wormhole) accounts spendable: one HD sequence of wormhole
addresses acts as a single UTXO pool with coin selection, per-send fresh
change addresses, rotating receive addresses and gap-limit recovery.
Generalizes WormholeClaimService into WormholeSendService (claim stays as
a wrapper) and packages the flow as an EncryptedSendStrategy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant