Skip to content

Fix review followup: XChaCha20, vault decimals, dead code#143

Merged
rz1989s merged 3 commits intomainfrom
fix/review-followup
Apr 10, 2026
Merged

Fix review followup: XChaCha20, vault decimals, dead code#143
rz1989s merged 3 commits intomainfrom
fix/review-followup

Conversation

@rz1989s
Copy link
Copy Markdown
Member

@rz1989s rz1989s commented Apr 10, 2026

Summary

Addresses 3 Important issues flagged during self-audit of #142.

  • XChaCha20-Poly1305 for blinding factor — replaced custom XOR-mask with AEAD encryption. Random 24-byte nonce per message eliminates keystream reuse. Authentication tag detects tampering.
  • Real SPL token decimals — vault API now batch-fetches mint account data via getMultipleAccountsInfo instead of assuming 9 decimals. Added balanceStatus: 'ok' | 'unavailable' field for RPC failure transparency.
  • Removed dead isTokenSupported — always returned true, zero consumers after Tech Debt Zero: ship real or remove — 15 issues fixed #142.

Test plan

  • pnpm test -- --run — 497 tests passing
  • cd app && pnpm build — clean

rz1989s added 3 commits April 10, 2026 08:18
Replaced custom XOR-mask scheme with AEAD encryption. The previous
approach had no authentication (bit-flip attacks undetected) and
deterministic keystream (two-time-pad on same recipient).
Now uses random 24-byte nonce per message, prepended to ciphertext.
Previous code assumed 9 decimals for all non-USDC/USDT tokens.
Now batch-fetches mint account data (decimals at offset 44) via
getMultipleAccountsInfo. Also adds balanceStatus field so frontend
can distinguish zero balance from RPC unavailability.
Always returned true — no consumers after private-swap pre-flight
removal. Added clarifying comment to getSupportedTokens (label
lookup, not a whitelist).
@rz1989s rz1989s merged commit 2031ab2 into main Apr 10, 2026
1 check passed
@rz1989s rz1989s deleted the fix/review-followup branch April 10, 2026 04:05
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