Add WalletKit browser WASM package POC - #480
Conversation
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
7c492b3 to
0ab575c
Compare
| uniffi = { version = "0.32.0", features = [ | ||
| # uniffi-bindgen-react-native 0.31.0-5 cannot parse UniFFI 0.32 metadata yet. | ||
| # Remove this pin once https://github.com/jhugman/uniffi-bindgen-react-native/pull/409 lands. | ||
| uniffi = { version = "0.31.2", features = [ |
There was a problem hiding this comment.
we won't be able to release with this uniffi version (perhaps, we create rc releases)?
| @@ -0,0 +1,188 @@ | |||
| import type { | |||
There was a problem hiding this comment.
nit. I'd just put this under examples/web
5e38ef6 to
c10e656
Compare
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
Summary
crates/walletkitthe browser WASM artifact source using target-specific UniFFI runtime wiringwalletkit-webpackage with compiled ESM, declarations, wasm-bindgen glue, optimized WASM, and embedded proving artifactsinitializeWalletKit()CredentialStoreconstructor for the current browser demowasm-opt -Oz --convergeinto the package buildwalletkit-web@0.21.3from npm and remove its duplicate Rust wrapper and generated bindingsThis remains a feasibility prototype: the package is published manually, but generation and publication are not integrated into the release workflow yet.
The branch is rebased onto #493 at
8fc59d6. That brings inwalletkit-sqlite0.21.4 and its encrypted persistent browser SQLite path using themultipleciphers-opfs-sahpoolVFS, together with the exportedinitializePersistentStorage()setup function.The example still deliberately constructs
CredentialStore.newEphemeral(). Switching the example to persistent storage is a separate integration step: callinitializePersistentStorage()in the dedicated worker, then construct the store with deterministic paths and host implementations ofDeviceKeystoreandAtomicBlobStore. The currently publishedwalletkit-web@0.21.3also predates #493, so the registry package must be updated before the published-package path can exercise those APIs.Validation
nix develop .#default --command cargo check --workspace --all-targets --all-features --lockednix develop .#wasm --command cargo test -p walletkit-sqlite --target wasm32-unknown-unknown(Firefox dedicated-worker OPFS test passes, including encrypted persistence without plaintext at rest)nix develop .#wasm --command bun run --cwd web/walletkit buildnix develop .#wasm --command bun run --cwd examples/uniffi-web-authenticator-poc buildwith the published packagewalletkit:localandwalletkit:publishedsuccessfully switch between the local Bun link and locked registry packageSystemTime, triggers UniFFI's recursive-mutex cleanup panic, or corrupts signed credentialu64fields through JSONwalletkit-cli proof generate-test-request400without contacting stagingcargo fmt --all -- --checkgit diff --checkKnown limitations
uniffito 0.32 version jhugman/uniffi-bindgen-react-native#409 landswalletkit-web@0.21.3package does not yet contain feat: persist encrypted WASM SQLite in OPFS #493's persistent-storage APIs