Skip to content

Commit fb21a28

Browse files
authored
Adds Mutiny case study (#216)
* Adds Mutiny case study ---------
1 parent d7414f3 commit fb21a28

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed
10.3 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: "Mutiny uses LDK to create the first lightning wallet for the web"
3+
description: "Learn how Mutiny built a lightning wallet for the web"
4+
date: "2023-08-07"
5+
authors:
6+
- Ben Carman
7+
tags:
8+
- Case Studies
9+
---
10+
11+
Mutiny is a new lightning wallet for the web. It is the first self-custodial wallet to run directly in a user's browser. It’s built on top of LDK and [BDK](https://bitcoindevkit.org/), written in Rust, and compiled into WebAssembly. It offers a simple, intuitive interface for sending and receiving payments and other advanced features, such as Nostr Wallet Connect and subscription payments.
12+
13+
We chose to build on LDK and BDK because it wouldn’t have been possible to build a wallet like Mutiny in any other way. Since LDK is written in Rust, we were able to compile it into WebAssembly. Rust's unique combination of type-safety, memory-safety, and efficient runtime performance make it ideally suited to a lightning node that must be reliable, fast, and lightweight enough to run on a mobile phone. LDK's modular design means we can customize it to work within the specific constraints of a web browser. LDK also provides a robust API for building advanced features for our wallet that would otherwise not be possible.
14+
15+
# What we did?
16+
17+
We used LDK to make a crate called mutiny-node which holds all our main wallet logic. Then we used the wasm-bindgencrate to generate JavaScript bindings that can be imported into a regular web project. Thankfully, LDK supports no_std, so compiling it into WebAssembly without any modifications was possible.
18+
19+
Mutiny is a lite-client wallet, meaning it does not run a full bitcoin node. Instead, it gets its blockchain data from an esplora instance. LDK's Filter interface made it easy to implement this, allowing for a simple and efficient way to sync the wallet with the blockchain. [Rapid Gossip Sync](https://docs.rs/lightning-rapid-gossip-sync/0.0.115/) also helps make the wallet sync quickly, and RGS allows us to sync lightning gossip data nearly instantly without spending unnecessary bandwidth and CPU resources.
20+
21+
Local storage can be unreliable in web browsers, so we also want users to be able to recover their wallet in case they lose their device. We implemented the LDK project's [VSS](https://github.com/lightningdevkit/vss-server) specification to give our users encrypted cloud backups to support this.
22+
23+
While we're currently focused on the web, this architecture and the flexibility of LDK means we will be able to share most of our code with a mobile or even server version of Mutiny in the future.
24+
25+
# Results
26+
27+
LDK made building a lightning wallet that runs in the browser possible. Compiling to WebAssembly and LDK's various tools for lite clients allowed us to create an unstoppable, self-custodial wallet that anyone can use without downloading any software. We hope that Mutiny will help bring lightning to the masses, and we are excited to see what the future holds for LDK and lightning on the web.
28+
29+
You can learn more and try it out at [mutinywallet.com](https://www.mutinywallet.com/).

docs/case-studies.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ description: "A list of bitcoin applications and services building with LDK"
66
actionText: "Add your project"
77
actionLink: "https://github.com/orgs/lightningdevkit/discussions/1554"
88
features:
9-
- title: "The Eye of Satoshi"
10-
details: "A watchtower with a specific focus on Lightning"
11-
image: "/img/teos-main.png"
12-
imageAlt: ""
13-
caseStudyLink: "/blog/teos-uses-ldk-to-build-open-source-watchtower/"
9+
- title: "Mutiny"
10+
details: "A self-custodial lightning wallet that runs in the browser"
11+
image: "/img/mutiny-featured.png"
12+
imageAlt: "mutiny logo"
13+
caseStudyLink: "/blog/mutiny-uses-ldk-the-first-lightning-wallet-for-the-web/"
1414
- title: "Cash App"
1515
details: "Send and spend, bank, and buy stocks or bitcoin "
1616
image: "/img/cash-app-logo.png"
1717
imageAlt: "cash app logo"
1818
caseStudyLink: "/blog/cashapp-enables-lightning-withdrawals-and-deposits-using-ldk/"
19-
- title: "Sensei"
20-
details: "A Lightning node implementation for everyone"
21-
image: "/img/sensei-main.png"
22-
imageAlt: "sensei logo"
23-
caseStudyLink: "/blog/sensei-uses-ldk-to-build-a-multi-node-lightning-server-application/"
19+
- title: "The Eye of Satoshi"
20+
details: "A watchtower with a specific focus on Lightning"
21+
image: "/img/teos-main.png"
22+
imageAlt: ""
23+
caseStudyLink: "/blog/teos-uses-ldk-to-build-open-source-watchtower/"
2424
editLink: false
2525
lastUpdated: false
2626
---

0 commit comments

Comments
 (0)