Move WalletKit web into a package-owned worker - #523
Conversation
d30490c to
d48644b
Compare
d48644b to
0de0604
Compare
0de0604 to
8468178
Compare
8468178 to
b8e49f8
Compare
b8e49f8 to
0fc93c8
Compare
7da011f to
5964061
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7da011f. Configure here.
| if (variants.Batching.instanceOf(status)) return { state: "batching" }; | ||
|
|
||
| return { state: "queued" }; | ||
| } |
There was a problem hiding this comment.
Failed registration cannot be retried
Medium Severity
register refuses a second attempt whenever registration is already set, and pollRegistration never clears that handle after a failed status. A gateway failure therefore makes the client permanently unable to start a new registration, while the demo still offers the Register action because it only sets registered on success.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7da011f. Configure here.
previous build didn't include dist files


Make walletkit-web own its Web Worker and expose an async TypeScript facade. Hosts supply a resolved database key and can configure worker/Wasm URLs; generated Rust bindings remain inside the worker.
Targets #522 directly, above the original POC (#480). The browser uses StorageKeys.fromBytes and does not need a software keystore or envelope blob database.
Validation: Wasm package build (including TypeScript checking and bundling), fixture TypeScript checking, and all 6 Chrome browser tests pass on the rebased stack.
Note
High Risk
Breaking public API and cryptographic/storage wiring (database keys, OPFS, worker exclusivity); consumers must migrate off raw generated bindings.
Overview
walletkit-webno longer exposes the generated UniFFI namespace. Initialization now requires a 32-bytedatabaseKeyand optionalstorageId, spins up a package-bundled worker, and returns aWalletKitclient with promise-based RPC (register/pollRegistration,initializeAuthenticator,prepareCredential/storeCredential,generateProof,close/terminate). Rust/WASM, SQLite, and OPFS persistence run inside that worker; only plain data crosses the boundary.The Next.js POC drops its local
walletkit.worker.tsand drives the full staging flow from the page viainitializeWalletKit, with in-memory keys and updated copy about OPFS persistence after reload.Tooling/docs: bundle ships
walletkit.worker.js, README documents the browser API and storage model, version 0.22.1, plus Playwright + Vite browser tests (lifecycle, exclusive pool, wrong key, URL overrides).Reviewed by Cursor Bugbot for commit edf57ab. Bugbot is set up for automated code reviews on this repo. Configure here.