Skip to content

Commit 859b256

Browse files
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-2927
1 parent de6894d commit 859b256

26 files changed

Lines changed: 2312 additions & 9 deletions

package-lock.json

Lines changed: 125 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/wasm-solana/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
target/
2+
node_modules/
3+
# we actually only track the .ts files
4+
dist/
5+
test/*.js
6+
test/*.d.ts
7+
js/*.js
8+
js/*.d.ts
9+
js/wasm
10+
.vscode

packages/wasm-solana/.mocharc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extensions": ["ts", "tsx", "js", "jsx"],
3+
"spec": ["test/**/*.ts"],
4+
"node-option": ["import=tsx/esm", "experimental-wasm-modules"]
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist/
2+
target/
3+
js/wasm/
4+
pkg/
5+
node_modules/

0 commit comments

Comments
 (0)