Commit 739b7e1
committed
feat: add Solana address creation via WASM
Implement wasm-solana package for Solana address generation using official
Solana SDK crates (solana-pubkey, solana-keypair) compiled to WebAssembly.
This is Phase 1 of replacing JavaScript Solana dependencies to mitigate
npm supply chain attack risks.
Architecture follows wasm-utxo patterns:
- Core types wrap official Solana SDK with extension traits (PubkeyExt, KeypairExt)
- Thin WASM bindings (src/wasm/*.rs) expose types to JavaScript
- TypeScript wrappers (js/*.ts) provide idiomatic camelCase APIs
Components:
- Pubkey: base58 encoding/decoding, is_on_curve() for PDA detection
- Keypair: creation from 32-byte seed or 64-byte Solana secret key format
Build tooling:
- Makefile matching wasm-utxo's wasm-pack workflow
- TypeScript configs for ESM and CJS output
Verified compatibility with BitGoJS sdk-coin-sol test vectors.
Ticket: BTC-29271 parent de6894d commit 739b7e1
27 files changed
Lines changed: 2320 additions & 10 deletions
File tree
- .github/workflows
- packages/wasm-solana
- js
- src
- wasm
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | | - | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
0 commit comments