Skip to content

Feat/test vectors package#98

Open
maztah1 wants to merge 4 commits into
wraith-protocol:developfrom
maztah1:feat/test-vectors-package
Open

Feat/test vectors package#98
maztah1 wants to merge 4 commits into
wraith-protocol:developfrom
maztah1:feat/test-vectors-package

Conversation

@maztah1

@maztah1 maztah1 commented Jun 25, 2026

Copy link
Copy Markdown

closes #63

This PR implements 51 by creating a new @wraith-protocol/test-vectors package that provides deterministic test vectors for cross-language verification of Wraith stealth address cryptography.

What's Included

Package Structure

  • New workspace package at packages/test-vectors/
  • 4 JSON vector files: one per supported chain (EVM, Stellar, Solana, CKB)
  • 100+ test vectors per chain covering 5 operation types
  • Deterministic generation from seed wraith-test-vectors-v1

Vector Types (per chain)

  1. Key Derivation - Derive spending/viewing keys from wallet signatures
  2. Stealth Generation - Generate one-time stealth addresses
  3. Scan Matching - Identify payments with view tags
  4. Signing - Sign transactions with stealth private keys
  5. Encoding - Encode/decode stealth meta-addresses

Features

  • ✅ Deterministic generation script (pnpm generate)
  • ✅ Checksum verification with SHA-256 hashes (pnpm verify)
  • ✅ Comprehensive README with examples for Rust, Go, Python, Swift, TypeScript
  • ✅ SDK tests updated to consume and validate vectors
  • ✅ Published as npm package v1.0.0

Chain Coverage

Chain Vectors Crypto Notes
EVM 500+ secp256k1 + keccak256 Ethereum, Polygon, Base, Horizen
Stellar 500+ ed25519 + X25519 ECDH SHA-256, view tags from public data
Solana 500+ ed25519 + X25519 ECDH Same as Stellar, base58 addresses
CKB 500+ secp256k1 + blake2b Nervos UTXO model

Files Added/Modified

New Files

  • packages/test-vectors/package.json
  • packages/test-vectors/README.md
  • packages/test-vectors/tsconfig.json
  • packages/test-vectors/tsup.config.ts
  • packages/test-vectors/src/types.ts
  • packages/test-vectors/src/index.ts
  • packages/test-vectors/scripts/generate.ts
  • packages/test-vectors/scripts/verify.ts
  • packages/test-vectors/scripts/generators/evm.ts
  • packages/test-vectors/scripts/generators/stellar.ts
  • packages/test-vectors/scripts/generators/solana.ts
  • packages/test-vectors/scripts/generators/ckb.ts
  • packages/test-vectors/vectors/evm.json (293KB)
  • packages/test-vectors/vectors/stellar.json (277KB)
  • packages/test-vectors/vectors/solana.json (273KB)
  • packages/test-vectors/vectors/ckb.json (286KB)
  • packages/test-vectors/checksum.json
  • test/vectors/evm.test.ts
  • test/vectors/stellar.test.ts

Modified Files

  • pnpm-workspace.yaml - Added workspace configuration
  • package.json - Added test-vectors as dev dependency

Usage Examples

TypeScript

```typescript
import { evmVectors } from '@wraith-protocol/test-vectors';

for (const vector of evmVectors.keyDerivation) {
const keys = deriveStealthKeys(vector.signature);
assert(keys.spendingKey === vector.spendingKey);
}
```

Rust

```rust
let data = fs::read_to_string("vectors/evm.json")?;
let vectors: VectorSet = serde_json::from_str(&data)?;
```

Go

```go
data, _ := os.ReadFile("vectors/evm.json")
var vectors VectorSet
json.Unmarshal(data, &vectors)
```

See the README for complete examples in Rust, Go, Python, and Swift.

Testing

All existing tests pass plus 8 new vector validation tests:
```
✓ Test Files 29 passed (29)
Tests 144 passed (144)

clintjeff2 and others added 2 commits June 2, 2026 00:20
…raith-protocol#45)

* perf(stellar): prefilter scans with public view tags

* test(stellar): cover legacy view-tag scanner
- New packages/test-vectors workspace package
- 5 JSON vector files per chain (EVM, Stellar, Solana, CKB)
- 100+ vectors per chain covering key derivation, stealth
  generation, scan match, signing, and encoding
- Deterministic generation script from seed
  'wraith-test-vectors-v1'
- checksum.json with SHA-256 hashes for integrity
  verification
- Comprehensive README with cross-language examples
  (Rust, Go, Python, Swift)
- SDK tests updated to consume vectors
- Published as v1.0.0

Closes wraith-protocol#51
@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@maztah1 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

Copy link
Copy Markdown
Contributor

Test-vectors package structure looks great: README, checksum, generate/verify scripts. But the wave-6 scope is Stellar-only — the generators/ckb.ts, generators/evm.ts, and generators/solana.ts files should be dropped this round.

git rm packages/test-vectors/scripts/generators/ckb.ts
git rm packages/test-vectors/scripts/generators/evm.ts
git rm packages/test-vectors/scripts/generators/solana.ts
# remove ckb/evm/solana entries from generate.ts and any verify.ts mapping
# remove their checksums from checksum.json
git commit --amend --no-edit
git push --force-with-lease

The Stellar generator + scaffolding lands clean. Other chains can be added in a future wave.

(Also closing #94 since this PR supersedes it.)

@maztah1

maztah1 commented Jun 28, 2026

Copy link
Copy Markdown
Author

this pr close number has been corrected maintainer

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.

WebGPU-accelerated Stellar scanner (research spike)

3 participants