docs(security): correct stealth scheme, NUMS, UltraHonk, constraint counts (audit 3/4) - #109
Merged
Merged
Conversation
…ounts June 2026 docs audit, part 3/4 (#96). Fixes crypto/spec inaccuracies in the security and spec docs (audit-prep critical) + a design-doc banner. - crypto-assumptions + audit-checklist: the stealth-address scheme had the spending/viewing key roles SWAPPED vs the implementation. Corrected to match stealth/secp256k1.ts: S = r*K_spend (ECDH on spending key), P = K_view + H(S)*G, p = k_view + H(S). Now consistent with security-properties.md (A = Q + H(r*P)*G). - NUMS H generator: sha256("SIP_PEDERSEN_H_GENERATOR_V1") + hashToCurve -> try-and-increment over "SIP-PEDERSEN-GENERATOR-H-v1:<counter>" (matches commitment.ts). - Proof system: UltraPlonk -> UltraHonk (crypto-assumptions, zk-architecture; dropped the spurious Groth16 backend node). - Constraint counts: proof-spec badges + crypto-assumptions table corrected from "~20/50/80/150/200" to real ACIR opcodes (funding 972 / validity 1,113 / fulfillment 1,691; 3,776 total) with an ACIR-vs-gate-count clarification; fixed the bogus "64 bytes (mock)" proof-size claims. - near-integration-design: added "design proposal - not the shipped API" banner. astro build green (1277 pages). Stacked on the PR2 staleness branch.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 3 of 4 of the June 2026 docs audit (#96) — security/spec crypto accuracy + a design-doc banner. These pages feed the upcoming external audit, so accuracy matters most here.
Headline: the stealth-address scheme was documented backwards
crypto-assumptions.mdandaudit-checklist.mddescribed the stealth scheme with the spending and viewing key roles swapped relative to the implementation. Verified againstpackages/sdk/src/stealth/secp256k1.ts, the real scheme is:S = r·K_spend— ECDH uses the spending key (doc saidr·K_view)P = K_view + H(S)·G— address built on the viewing key (doc saidK_spend + s·G)p = k_view + H(S)— stealth private key (doc saidk_spend + …)This now matches both the code and
security-properties.md(A = Q + H(r·P)·G, Q = viewing, P = spending).⚑ Note for the auditor / team: SIP's key-role assignment differs from canonical EIP-5564 (which bases the stealth address on the spending key). Deriving the stealth private key here requires both recipient private keys. I've documented what the code actually does and flagged the divergence — no code change in this PR; please confirm it's intentional before the audit.
Other fixes (7 files)
sha256("SIP_PEDERSEN_H_GENERATOR_V1") + hashToCurve→ try-and-increment over"SIP-PEDERSEN-GENERATOR-H-v1:<counter>"(matchescommitment.ts).UltraPlonk→ UltraHonk (crypto-assumptions + zk-architecture; removed the spurious Groth16 backend node).SIPClient/.swap()API that doesn't exist; the real client isSIPwithgetQuotes()/execute()).Verification
astro buildgreen — 1277 pages.stealth/secp256k1.ts(generation + recovery) andsecurity-properties.md.Series
PR1 (#107) · PR2 (#108) · PR3 (this) · PR4 sipher SENTINEL → closes #96.
Refs #96