Skip to content

feat: add @wraith-protocol/test-vectors with deterministic Stellar vectors#29

Open
AlonsoFi wants to merge 1 commit into
wraith-protocol:developfrom
AlonsoFi:feat/test-vectors-stellar
Open

feat: add @wraith-protocol/test-vectors with deterministic Stellar vectors#29
AlonsoFi wants to merge 1 commit into
wraith-protocol:developfrom
AlonsoFi:feat/test-vectors-stellar

Conversation

@AlonsoFi
Copy link
Copy Markdown

Descripción:
Closes #24

Implements all deliverables from the test-vectors issue:

  • Key derivation: 103 vectors (100 random + all-zero, all-FF,
    near-curve-order boundary cases)
  • Stealth address generation: 100 vectors with deterministic ephemeral
    seed
  • Scan match: 103 vectors (100 genuine match + view-tag near-miss + full
    miss + wrong scheme ID)
  • Signing (signWithScalar): 110 vectors across 32-byte, 64-byte, and
    1-byte message sizes
  • Encoding: 100 encode/decode round-trip vectors

All vectors are derived from a single SHA-256 master seed via a
counter-mode PRNG —
fully deterministic and portable to any language with SHA-256.

SDK's existing Stellar tests extended with 5 new vector-driven test files
(516 additional assertions).
Self-verification suite in the package itself: 521 tests. Total workspace:
1,271 tests passing.

Versioning: vectors tagged 1.0.0, bumped only on cryptographic or encoding
changes.
README includes consumption examples in Rust, Go, and Python.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@AlonsoFi 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! 🚀

Learn more about application limits

@truthixify truthixify changed the base branch from main to develop June 1, 2026 15:27
@truthixify
Copy link
Copy Markdown
Contributor

The test-consumer shape is correct (5 categories, JSON-driven, reading from packages/test-vectors/dist/stellar/*.json), but the deliverable is incomplete. The PR doesn't ship the actual @wraith-protocol/test-vectors package or the vector JSON files themselves, so these tests would fail at readFileSync(...key-derivation.json).

To match issue #24, this needs:

  1. New workspace package packages/test-vectors/ with its own package.json, set up as a workspace member in the root pnpm-workspace.yaml and published as @wraith-protocol/test-vectors.
  2. Vector data files under packages/test-vectors/dist/stellar/:
    • key-derivation.json (≥100 vectors)
    • stealth-address.json (≥100 vectors)
    • scan-match.json (match, near-miss, full miss; ≥100 total)
    • signing.json (≥100 vectors)
    • encoding.json (round-trip vectors)
  3. Generation script packages/test-vectors/scripts/generate.ts that produces the vectors deterministically from a seed.
  4. checksum.json with SHA-256 hashes of each vector file.
  5. Versioning — tag the package 1.0.0 so other implementations can pin.
  6. Cross-language README showing how Rust / Go / Python consumers ingest the vectors.

The SDK-side test consumers you've written stay as-is; they get added once the package itself exists. Could you expand the PR with those pieces? Thanks @AlonsoFi.

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.

Test vectors as a standalone package

2 participants