Skip to content

Support WASM #90

Closed
Closed
@danielgranhao

Description

@danielgranhao

At Breez, we are interested in supporting WASM in the Nodeless SDK. The SDK depends on boltz-rust, which isn't compatible right now due to dependencies on:

  • ureq to access Boltz API
  • electrum-client for accessing blockchain data
  • tungstenite for the WebSocket status stream
  • secp256k1-zkp

We’d like to discuss possible approaches to enable WASM support while keeping the existing functionality intact.

Potential solutions:

  • Accessing Boltz API
    • Solution can be as simple as switching to reqwest. It implements WASM support by simply mapping requests to the browser's fetch API. We could switch to reqwest or allow the selection of the http client through features.
  • Access to blockchain data
    • This seems like the most challenging part. One option is for the crate to offload communication to the client. An alternative is to add esplora as a possible backend since it's based on http.
  • Status stream
    • There are several crates that could be used for websockets on WASM. gloo-net seems like a good option.
  • secp256k1-zkp
    • The fix here is simple and can be applied directly on the fork currently in use. Just needs the changes from this PR and from this commit.

Would love to hear your thoughts on these approaches to see if we can proceed with the corresponding contributions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions