mirror of
https://github.com/luxfi/wallet.git
synced 2026-07-27 03:37:41 +00:00
7c39e066f0d268f5165dd7c6faab94481437f46b
Wires the canonical post-quantum stack per LP-4200 into the wallet:
• mldsa.ts — ML-DSA-44/65/87 providers (FIPS 204) over @noble/post-quantum
• mlkem.ts — ML-KEM-512/768/1024 KEM providers (FIPS 203)
• slhdsa.ts — SLH-DSA-128f/192f/192s/256f providers (FIPS 205)
• hybrid.ts — secp256k1∥ML-DSA + Ed25519∥ML-DSA containers; wire format
byte-compatible with luxfi/sdk wallet/keychain PQSigner
• hdPq.ts — BIP-32 → cSHAKE expandChildSeed → ML-DSA/SLH-DSA keypair
• domain.ts — FIPS-204 §5.4 ctx strings:
lux-evm-precompile-mldsa-v1 (0x012202)
lux-x-chain-utxo-v1
lux-p-chain-platform-mldsa-v1
lux-recovery-slhdsa-v1 (0x012203)
lux-handshake-mlkem-v1
• precompile.ts — eth_call encoders for 0x012201/02/03 LP-4200 verifiers
The pkgs/wallet/pq surface decomplects four concerns that were previously
tangled in luxfi/sdk's PQSigner: scheme dispatch (providerFor), domain
separation (contextBytesFor), hybrid composition (encode/decodeHybrid),
HD derivation (derivePQIdentity). Each module is independently complete;
the index re-exports them as a single PQ public API.
Web facade lives at apps/web/src/lib/pq.ts; usePQIdentity() hook derives
the canonical ML-DSA-65 identity at m/44'/9000'/<chainID>'/0'/0'/0' from
the unlocked auth-slice mnemonic.
Tests: 71 passing across 8 suites
domain: 4 mldsa: 11 mlkem: 7 slhdsa: 6
hybrid: 9 hdPq: 9 precompile: 8 pqAccount: 17 (pre-existing)
Test runner: jest.pq.config.js (standalone — bypasses upstream-shaped
jest-expo preset still pending refactor; see LLM.md).
Domain separators pinned by domain.test.ts; cSHAKE customizations pinned
by pqAccount.test.ts (pre-existing). Replay-across-chains explicitly
tested via mldsa.test.ts and hybrid.test.ts cross-ctx verify cases.
Description
Open Source Lux DeFi Wallet.
187 MiB
Languages
TypeScript
88%
Swift
4.2%
Kotlin
4.1%
JavaScript
1.2%
Go
0.8%
Other
1.6%