Commit 38f8699
committed
feat: add solana address creation via WASM
Implement the initial wasm-solana package to support Solana address
generation using Rust compiled to WebAssembly. This is the first phase
of replacing JavaScript Solana dependencies (@solana/web3.js, tweetnacl)
with secure Rust implementations to mitigate npm supply chain attack risks.
Architecture follows wasm-utxo patterns:
- Two-layer Rust design: core logic (src/*.rs) + thin WASM wrappers (src/wasm/*.rs)
- TypeScript wrappers (js/*.ts) providing idiomatic camelCase APIs
- Comprehensive test suite with BitGoJS compatibility tests
Components added:
- Keypair: Ed25519 keypair generation from random or 32/64-byte secret keys
- Pubkey: Base58 encoding/decoding for Solana addresses
- Error handling using js_sys::Error for proper JS exceptions
Build tooling:
- Cargo.toml with wasm-bindgen, solana-client-wasm, ed25519-dalek
- Makefile matching wasm-utxo's wasm-pack workflow
- TypeScript configs for ESM and CJS output
Verified compatibility with BitGoJS sdk-coin-sol test vectors to ensure
byte-identical address derivation from the same secret keys.
Ticket: BTC-29271 parent de6894d commit 38f8699
26 files changed
Lines changed: 2074 additions & 9 deletions
File tree
- packages/wasm-solana
- js
- src
- wasm
- test
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments