Skip to content

Test vectors as a standalone package #24

@truthixify

Description

@truthixify

Labels: Stellar Wave, stellar, crypto, test, drips, help-wanted
Tier: M (2–4 days)
Type: test / crypto

Context

Wraith's stealth math is going to be re-implemented in other languages over time (Go indexers, Rust agents outside Spectre, Swift mobile apps). Each reimplementation needs to be verified bit-for-bit identical to the reference TypeScript SDK. Without a shared test-vector corpus, every reimplementer is on their own to figure out edge cases.

We want a published vector package: @wraith-protocol/test-vectors.

Scope

Create a new workspace package packages/test-vectors/ containing JSON files (per chain) with vectors covering:

Per chain (start with Stellar)

  1. Key derivation — array of { signature: hex, expected: { spendingKey, viewingKey, spendingPubKey, viewingPubKey } } covering ~100 random inputs + boundary cases (all-zero signature, all-FF signature, near-curve-order, etc.).
  2. Stealth address generation{ spendingPubKey, viewingPubKey, ephemeralPrivateKey, expected: { stealthAddress, ephemeralPubKey, viewTag } }.
  3. Scan match{ announcement, viewingKey, spendingPubKey, expected: { isMatch, stealthAddress, stealthPrivateKey } } covering match, near-miss (view tag false-positive), full miss.
  4. Signing{ scalar, message, expected_signature } for the custom signWithScalar.
  5. Encoding — meta-address encode/decode round-trip vectors.

Generation

  • A script packages/test-vectors/scripts/generate.ts produces the vectors deterministically from a seed.
  • Each vector file is committed in packages/test-vectors/dist/stellar/*.json.
  • A checksum.json carries SHA-256 hashes of every vector file so other implementations can verify integrity.

Cross-validation

  • The SDK's existing unit tests must be updated to consume these vectors as a sanity check.
  • A README explains how to consume the vectors from another language — show snippets in Rust, Go, Python.

Acceptance criteria

  • @wraith-protocol/test-vectors published to npm.
  • Stellar vectors complete (≥ 100 per category).
  • SDK consumes them in tests.
  • README with cross-language consumption examples.
  • Versioning: vectors are tagged 1.0.0 and bumped only on cryptographic / encoding changes.

Why this matters

Wraith's network effects depend on multiple compatible implementations. The bottleneck for those implementations is certainty that they got the math right. Shared test vectors are the cheapest possible insurance policy against ecosystem fragmentation.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcryptoCryptographic codedripsFunded via Drips Networkhelp wantedExtra attention is neededstellarTouches Stellar / Soroban codetestTest coverage / harness

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions