Skip to content

Commit 739b7e1

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 739b7e1

27 files changed

Lines changed: 2320 additions & 10 deletions

.github/workflows/build-and-test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
workspaces: |
3737
packages/wasm-utxo
3838
packages/wasm-bip32
39+
packages/wasm-solana
3940
cache-on-failure: true
4041

4142
- name: Setup Node
@@ -85,6 +86,8 @@ jobs:
8586
packages/wasm-utxo/js/wasm/
8687
packages/wasm-bip32/dist/
8788
packages/wasm-bip32/js/wasm/
89+
packages/wasm-solana/dist/
90+
packages/wasm-solana/js/wasm/
8891
retention-days: 1
8992

9093
test:
@@ -94,14 +97,17 @@ jobs:
9497
strategy:
9598
fail-fast: false
9699
matrix:
97-
package: [wasm-bip32, wasm-utxo]
100+
package: [wasm-bip32, wasm-utxo, wasm-solana]
98101
include:
99102
- package: wasm-utxo
100103
needs-wasm-pack: true
101104
has-wasm-pack-tests: true
102105
- package: wasm-bip32
103106
needs-wasm-pack: false
104107
has-wasm-pack-tests: false
108+
- package: wasm-solana
109+
needs-wasm-pack: false
110+
has-wasm-pack-tests: false
105111
steps:
106112
- uses: actions/checkout@v4
107113
with:

0 commit comments

Comments
 (0)