feat(audit): Stellar chain module cryptographic audit report and fixes#93
Conversation
…raith-protocol#45) * perf(stellar): prefilter scans with public view tags * test(stellar): cover legacy view-tag scanner
…fixes Completes independent cryptographic audit of the Stellar chain module. (issue wraith-protocol#55) Findings: - 0 Critical, 0 High, 2 Medium, 2 Low, 9 Informational - All cryptographic primitives verified correct - Custom signWithScalar implementation justified and cross-validated Fixes applied: - Add zero-scalar guard in signWithScalar (scalar must be in (0, L)) - Add stealth private scalar validation in deriveStealthPrivateScalar - Skip zero-scalar candidates in scanAnnouncements - Verify signatures with @noble/curves ed25519.verify() New test coverage: - signWithScalar test vectors (17 tests): determinism, edge cases, boundary values (scalar=1, scalar=L-1), empty/1MB messages, LE encoding - Clamping reproducer test (keys.test.ts) - signStellarTransaction cross-validation (spend.test.ts) - E2e signing step added Closes wraith-protocol#55
|
@Timrossid Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
The audit doc is solid. 13 findings with right severity tiers, the Same blocker as #88/#89/#91/#92: branch predates view-tag batching landing on develop, so the diff includes those files as conflicts. git fetch origin
git rebase origin/develop
# during rebase, drop changes to src/chains/stellar/scan.ts, stealth.ts (the view-tag bits), test/chains/stellar/scan.test.ts, test/chains/stellar/bench/scan.bench.ts, docs/chains/stellar-view-tag-batching.md
# keep: audits/2026-06-author-stellar-module.md, test/chains/stellar/signwithscalar-vectors.test.ts, your spend.test.ts/keys.test.ts/e2e.test.ts additions, the scalar.ts 3-line fix, src/chains/stellar/spend.ts changes, the index.ts re-exports
git push --force-with-leaseOnce rebased the audit + test fixtures land cleanly. |
|
Clean merge. The audit report (236 lines), view-tag-batching doc, scalar/scan/spend/stealth fixes, and signWithScalar vectors are exactly what we needed. Bench harness is a nice bonus. Thanks @Timrossid. |
Bring the WebGPU spike branch up to date with develop post-wraith-protocol#93 and wraith-protocol#116: src/chains/stellar/constants.ts - Add SCHEME_ID_V1, SCHEME_ID_V2, ANNOUNCE_EVENT_SYMBOL, VIEW_TAG_BUCKET_COUNT (from wraith-protocol#93 audit / develop) src/chains/stellar/scan.ts - Add scanAnnouncementsStream (streaming / low-memory variant) from develop - Accept SCHEME_ID_V2 announcements in scanAnnouncements + stream - Add zero-scalar guard: skip stealthPrivateScalar <= 0n (wraith-protocol#93 security fix) src/chains/stellar/stealth.ts - Merge JSDoc from develop (detailed DKSAP steps + @deprecated note on computeViewTag) src/chains/stellar/index.ts - Re-export SCHEME_ID_V1/V2, ANNOUNCE_EVENT_SYMBOL, VIEW_TAG_BUCKET_COUNT - Re-export scanAnnouncementsStream, scanAnnouncementsLegacySharedSecretTag - Re-export computeAnnouncementViewTag src/chains/stellar/webgpu/scan-webgpu.ts - Accept SCHEME_ID_V2 in the GPU prefilter path (mirrors scan.ts change) pnpm-workspace.yaml - Add allowBuilds config + root + examples/* entries from develop packages/test-vectors/vectors/{ckb,evm,solana}.json - Generate deterministic vectors for CKB, EVM, Solana chains (fixes three pre-existing test failures from commit 764b751) packages/test-vectors/scripts/generate-multichain.ts - New generator script for the three missing vector sets All 31 test files / 2036 tests pass.
Summary
This PR delivers the independent cryptographic audit of the Stellar chain module (issue #55).
Deliverables
Audit report
\�udits/2026-06-author-stellar-module.md\ — covers every primitive in \src/chains/stellar/:
Findings & Fixes
Tests
Files changed
Closes #55