Skip to content

Audit v14: balance counts only owned notes (SCAN-841), VK-751 sender check - #9

Merged
dendisuhubdy merged 2 commits into
mainfrom
fix/audit-v14
Nov 17, 2026
Merged

dendisuhubdy merged 2 commits into
mainfrom
fix/audit-v14

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

Fixes for the audit v14 addendum.

Changes

  • SCAN-841 — the history balance sums only notes the pasted key's pk owns, so a note opened by the key but owned by someone else no longer shows as balance.
  • VK-751 — a row is Received only when the key's pk owns the note and Sent only when it created it; a chain-fixed creator is labelled as an unverified sender (20 locales).
  • The WASM viewing bundle is rebuilt.

Tests

  • randscan-viewing: 19 passed. Frontend: 85 tests, 84 pass, 1 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GFs5h2CVCmdBKerZzH2Xrx

dendisuhubdy and others added 2 commits November 17, 2026 15:17
…ent only when it created it (SCAN-841, VK-751)

open_note reported any envelope whose receiver part opened as received and verified, with a
nullifier, and any whose sender part opened as sent. Opening is neither ownership nor authorship:
anyone can seal a note it owns itself to a published address, and anyone holding a viewing key
holds its ovk. classify() now restates the wallet's and the node's rule and adds the creator check:
received iff the receiver part opens and note.pk == pk(nk); else sent iff the sender part opens and
note.from == pk(nk); else sent_unverified iff the sender part opens and note.from is a chain-fixed
word (zero, rpl-mint, rpl2-pay, rpl3-pay: a relayed deposit, a mint, a payout); else null.

tests/ownership.rs seals its own envelopes (the keyless SCAN-841 test uses only the victim's
address). frontend/public/viewing rebuilt with wasm-pack from this source.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s; unverified-sender label (SCAN-841, VK-751)

lib/history.ts restates the owner and creator comparisons on the page's side (admit, isOwned,
spendableNotes), so the spendable balance, the received count and the nullifier match no longer
rest on the role string alone: a received row owned by another pk is dropped, a sent row created
by another pk is never shown as Sent. RoleBadge gains sent_unverified
(components.openedNotes.sentUnverified, English in every locale until translated).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dendisuhubdy
dendisuhubdy merged commit 392ef97 into main Nov 17, 2026
7 checks passed
@dendisuhubdy
dendisuhubdy deleted the fix/audit-v14 branch November 17, 2026 09:34
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