DEV Community

Maan2003
Maan2003

Posted on • Edited on

Summer of Bitcoin Journey

The Project

I was accepted for “Graphical Wallet for Fedimint using WASM”.

Fedimint is an experimental implementation of federated e-cash written in Rust. Currently, there is only a CLI client. A GUI client will be crucial for widespread adoption, allowing non-technical people to use MiniMint. Packaging the client as Web Assembly will help make more native clients such as an Android app.

Compile to Web Assembly

Compiling Rust to Web Assembly is very simple. We just need to avoid crates that don’t work on Web Assembly. We had to remove and update some crates.

async runtimes

Minimint uses tokio runtime, which is not compatible with Web Assembly.

Luckily, we have wasm-bindgen-futures that allows to interop between Rust Futures and JavaScript Promises. We just had to add some helper functions to replace the tokio usage.

Disentangling mint-client from minimint server

Mint client depended on the server for various type definitions and modules. I fixed this by separating out a minimint-core that both server and client can depend on.

Web Sockets

Minimint server uses http for its API. Each module can expose api endpoints. Due to http, we had to use polling to fetch transaction. With web sockets, we will use jsonrpc for fully async request and responses.

Graphical Client

futurepaul and justinmoon have already been working on a flutter based client. I am working on getting it to run inside a web browser. It is so awesome seeing fluttermint run inside Firefox.

A bunch of changes later and bug squashes later, paying and recieve lightning payments works!

Thanks

I would like to thank my mentor elsirion and all the reviewers for helping me throughout this and for quick responses and reviews.

Top comments (0)