SDK installation
npm package
npm install openac-sdk
Current version in repository: 0.1.0 (wallet-unit-poc/openac-sdk/package.json).
Platform notes
| Platform | Notes |
|---|---|
| Browser | Ship WASM + smaller verifying keys to the client; mind download size (see key table in SDK README). |
| Node | Same WASM; ensure fetch / performance globals exist (Node 18+). |
| iOS / Android | Native PoC uses Flutter + Rust (wallet-unit-poc/mobile/); the npm SDK targets JS runtimes. |
WASM + assets
From wallet-unit-poc/openac-sdk:
npm install
npm run build:wasm # needs Rust + wasm-pack per script
npm run build
Witness + R1CS files are gitignored under assets/; populate from your Circom build/ outputs per SDK README.
Proving keys
Proving keys are generated offline by the Rust CLI (ecdsa-spartan2):
cd wallet-unit-poc/ecdsa-spartan2
cargo run --release -- prepare setup --size 1k --input ../circom/inputs/jwt/1k/default.json
cargo run --release -- show setup --size 1k --input ../circom/inputs/show/default.json
The --size flag selects the JWT-payload variant (1k, 2k, 4k, 8k). Verifying keys are small (≈ 3 MB) and safe to bundle; proving keys are large — plan distribution accordingly:
| Size | Prepare PK | Prepare VK | Show PK | Show VK | Total per credential |
|---|---|---|---|---|---|
1k | 258 MB | 258 MB | 3 MB | 3 MB | ~522 MB |
2k | 427 MB | 427 MB | 3 MB | 3 MB | ~860 MB |
4k | 811 MB | 811 MB | 3 MB | 3 MB | ~1.6 GB |
8k | 1.6 GB | 1.6 GB | 3 MB | 3 MB | ~3.2 GB |
(Source: wallet-unit-poc/openac-sdk/README.md; regenerate locally with the commands above to verify.) For browser wallets, fetch only the VK pair plus the PK matching your worst-case JWT length; for server-side verification, the VK pair alone is sufficient.
Native backend (optional)
NativeBackend wraps the Rust CLI for environments where WASM proving is undesirable — see export in index.ts and tests under tests/native-backend.test.ts.