fix(sdk-lib-mpc): use @bitgo/wasm-mps/web in browser to fix EdDSA MPCv2 DKG TypeError#8643
Open
bitgo-ai-agent-dev[bot] wants to merge 1 commit intomasterfrom
Open
fix(sdk-lib-mpc): use @bitgo/wasm-mps/web in browser to fix EdDSA MPCv2 DKG TypeError#8643bitgo-ai-agent-dev[bot] wants to merge 1 commit intomasterfrom
bitgo-ai-agent-dev[bot] wants to merge 1 commit intomasterfrom
Conversation
cde1353 to
31a0c68
Compare
014ee99 to
2b74568
Compare
a15675f to
f4c386f
Compare
6aa13cc to
9eaf2b5
Compare
In browsers (webpack), importing @bitgo/wasm-mps resolves to the --target bundler ESM build which has a race condition between webpack's async WASM instantiation and __wbg_set_wasm being called. This causes wasm.ed25519_dkg_round0_process to be undefined when initDkg() runs. Mirror the ECDSA pattern in ecdsa-dkls/dkg.ts: detect browser via `typeof window !== 'undefined'` (excluding Electron via window.process checks), then use @bitgo/wasm-mps/web which exposes an explicit init() function — guaranteed ready after await. Adds a local .d.ts shim for @bitgo/wasm-mps/web until WCI-250 publishes the ./web subpath export with its own types. Ticket: WCI-251
9eaf2b5 to
c474524
Compare
johnoliverdriscoll
approved these changes
Apr 28, 2026
margueriteblair
approved these changes
Apr 28, 2026
mohammadalfaiyazbitgo
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Background
The existing @bitgo/wasm-mps builds are not browser-safe:
wasm.ed25519_dkg_round0_process is not a function
not a function
The --target web build loads wasm via fetch() and exposes an explicit init(), eliminating both failure modes.
Linear
Ticket: WCI-251
🤖 Generated with Claude Code