|
1 | 1 | ---
|
2 | 2 | title: "Cash App Enables Lightning Withdrawals & Deposits Using LDK"
|
3 | 3 | description: "Learn how Cash App integrated with the lightning network, allowing its users to send and receive bitcoin instantly."
|
4 |
| -date: "2022-11-15" |
| 4 | +date: "2022-11-16" |
5 | 5 | authors:
|
6 | 6 | - Ryan Loomba
|
7 | 7 | tags:
|
8 | 8 | - Case Studies
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -Our team builds the Cash App lightning wallet. We power all lightning bitcoin withdrawals and deposits within Cash App. |
| 11 | +Cash App allows users to instantly deposit and withdraw bitcoin over the lightning network. As an engineer on the Cash App Lightning Wallet team, I was very involved in the entire implementation process. |
12 | 12 |
|
13 |
| -Cash App is the #1 finance app in the App Store – we have extremely high standards for product development and the infrastructure that powers all our cool features. We were looking for a solution that would ensure high reliability, high scalability, and a stellar developer experience. Cash App is the financial hub for millions of people and often the first place an individual acquires bitcoin, so having a slick user experience, and the infrastructure to onboard lots of new users is extremely important. As a publicly traded company, we take security very seriously, so having the ability to customize our wallet implementation to adhere to our security standards was necessary. |
| 13 | +Cash App is the #1 Finance App in the app store – we have extremely high standards for product development and the infrastructure that powers all our cool features. We were looking for a solution that would ensure high reliability, high scalability, and a stellar developer experience. Cash App is the financial hub for millions of people and often the first place an individual acquires bitcoin. It’s important to have a slick user experience and robust infrastructure that can onboard many new users. As a publicly traded company we take security seriously and need the ability to customize our wallet implementation in order to adhere to strict standards. |
14 | 14 |
|
15 |
| -We chose LDK for various reasons over other implementations. It provided us with a lot of customizability and flexibility. The [Java bindings](https://github.com/lightningdevkit/ldk-garbagecollected) let us develop in Kotlin, which is the preferred language we use at Cash for backend services. We also had a great working relationship with the [Spiral](https://spiral.xyz/) folks and so it was great to collaboratively work together on more advanced feature asks (phantom invoices!). |
| 15 | +We chose LDK for various reasons over other implementations. It provided us with a lot of customizability and flexibility. The [Java bindings](https://github.com/lightningdevkit/ldk-garbagecollected) let us develop in Kotlin, which is the preferred language for backend services. We also have a great working relationship with the [Spiral](https://spiral.xyz/) folks, making it easy to collaborate on more advanced feature requests such as phantom invoices. |
16 | 16 |
|
17 | 17 | # What we did
|
18 |
| -LDK allowed us to develop an extremely scalable lightning node infrastructure. We run multiple wallet nodes and have strict requirements on what peers we can connect to and strict parameters around opening channels. We have logic that does advanced probing in the background, to ensure we have an up to date snapshot of the liquidity on the lighting network. |
| 18 | +LDK allowed us to develop a scalable lightning node infrastructure. Cash App runs multiple wallet nodes and has strict parameters around opening channels and connecting to peers. We have logic that does advanced probing in the background in order to ensure an up-to-date snapshot of liquidity on the lightning network. |
19 | 19 |
|
20 | 20 | 
|
21 | 21 |
|
22 |
| -We also do probing before every send, so that we can pre-fetch a route and execute the send after a customer has confirmed the send. We have utilized LDK’s [phantom node](https://lightningdevkit.org/blog/introducing-phantom-node-payments/) feature, so we can generate invoices that can be claimed by more than one node. We use MySQL to save our channel state data and node metadata, this allows us to quickly shut down and start up nodes at will on different servers. LDK allows us to run A/B tests on different pathfinding algorithms. |
| 22 | +Probing is done before every send, allowing us to pre-fetch a route and execute the send once the customer confirms. LDK’s [phantom node](https://lightningdevkit.org/blog/introducing-phantom-node-payments/) feature makes it possible to generate invoices that can be claimed by more than one node. We use MySQL to save our channel state data + node metadata in order to quickly shut down and start up nodes at will on different servers. Additionally, LDK lets us run AB tests on different pathfinding algorithms. |
23 | 23 |
|
24 | 24 | # Results
|
25 | 25 |
|
26 |
| -The outcome was that we were able to relatively quickly build a lightning wallet to power bitcoin withdrawals and deposits on Cash App taking into account the complicated constraints we had as a publicly traded company with tens of millions of users. |
27 |
| - |
28 |
| -Users can now deposit and withdraw their bitcoin to Cash App over lightning, so essentially instant BTC deposits and withdrawals for free. |
| 26 | +LDK made it possible to relatively quickly build an easy-to-use lightning wallet while adhering to the complicated constraints Cash App faces as a publicly traded company with tens of millions of users. Users can now instantly deposit and withdraw bitcoin to Cash App over lightning. |
29 | 27 |
|
30 | 28 | To learn more check out this [presentation](https://www.youtube.com/watch?v=kbhL5RqL8Aw) at btc++ explaining some of the trade-offs the Cash App team had to think about when comparing LDK to other solutions.
|
31 | 29 |
|
|
0 commit comments