<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maan2003</title>
    <description>The latest articles on DEV Community by Maan2003 (@maan2003).</description>
    <link>https://dev.to/maan2003</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F444306%2F3fd678a6-15fb-49d6-9a52-d8a9d5c622c9.png</url>
      <title>DEV Community: Maan2003</title>
      <link>https://dev.to/maan2003</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maan2003"/>
    <language>en</language>
    <item>
      <title>Summer of Bitcoin Journey</title>
      <dc:creator>Maan2003</dc:creator>
      <pubDate>Fri, 08 Jul 2022 15:14:00 +0000</pubDate>
      <link>https://dev.to/maan2003/summer-of-bitcoin-journey-1177</link>
      <guid>https://dev.to/maan2003/summer-of-bitcoin-journey-1177</guid>
      <description>&lt;h2&gt;
  
  
  The Project
&lt;/h2&gt;

&lt;p&gt;I was accepted for “&lt;strong&gt;Graphical Wallet for &lt;a href="https://github.com/fedimint/fedimint"&gt;Fedimint&lt;/a&gt; using WASM”.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/fedimint/minimint/pull/140/commits"&gt;Compile to Web Assembly&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  async runtimes
&lt;/h3&gt;

&lt;p&gt;Minimint uses &lt;a href="https://tokio.rs"&gt;tokio&lt;/a&gt; runtime, which is not compatible with Web Assembly. &lt;/p&gt;

&lt;p&gt;Luckily, we have &lt;a href="https://rustwasm.github.io/wasm-bindgen/reference/js-promises-and-rust-futures.html"&gt;wasm-bindgen-futures&lt;/a&gt; that allows to interop between Rust Futures and JavaScript Promises. We just had to add some &lt;a href="https://github.com/fedimint/minimint/commit/fb2b140c6540e70d6081acd9693cfcd16d3d75a3"&gt;helper functions&lt;/a&gt; to replace the tokio usage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Disentangling mint-client from minimint server
&lt;/h3&gt;

&lt;p&gt;Mint client depended on the server for various type definitions and modules. I fixed this by &lt;a href="https://github.com/fedimint/minimint/commit/6c8edb1200297ac11a207aad553d03fa9e0ced94https://github.com/fedimint/minimint/commit/6c8edb1200297ac11a207aad553d03fa9e0ced94"&gt;separating out a minimint-core&lt;/a&gt; that both server and client can depend on.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/fedimint/minimint/pull/203/commits"&gt;Web Sockets&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Graphical Client
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/futurepaul"&gt;futurepaul&lt;/a&gt; and &lt;a href="https://github.com/justinmoon"&gt;justinmoon&lt;/a&gt; have already been working on a &lt;a href="https://github.com/futurepaul/fluttermint"&gt;flutter based client&lt;/a&gt;. I am working on getting it to &lt;a href="https://github.com/Maan2003/fluttermint/tree/wasm"&gt;run inside a web browser&lt;/a&gt;. It is so awesome seeing fluttermint run inside Firefox.&lt;/p&gt;

&lt;p&gt;A bunch of changes later and bug squashes later, paying and recieve lightning payments works!&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/743471444" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Thanks
&lt;/h2&gt;

&lt;p&gt;I would like to thank my mentor &lt;a href="https://github.com/elsirion"&gt;elsirion&lt;/a&gt; and all the reviewers for helping me throughout this and for quick responses and reviews.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
