Building Lendasat on ARK - Introducing DLC VTXOs
At Lendasat we are building p2p, instant Bitcoin-collateralized loans using regular Lightning payments.
The key requirements we have given ourselves are the following:
- As simple as paying a Lightning invoice.
- Self-custodial.
- Bitcoin only.
Doing this on-chain would be prohibitively expensive and inefficient, so we evaluated the following L2 solutions.
ARK | Fedimint | Lightning | DLC Channels | |
---|---|---|---|---|
Smart contracts | No | Yes | No | Yes |
Liquidity requirements | Medium | Low | High | High |
Custody | Self-custodial | Federation | Self-custodial | Self-custodial |
Online requirements | Every 2 weeks | n/a | Every day | Every day |
None of the solutions considered fit our requirements on their own, but we quickly got very excited about the idea of lifting DLCs onto ARK, thus combining the benefits of ARK (reduced liquidity requirements) and DLCs (smart contracts).
As mentioned before, the use case we are focusing on is collateralized loans. In short, the user journey would look something like this:
- Borrower gets a Lightning invoice e.g. from Bitrefill.
- Borrower shares the invoice with Lendasat; borrower gets a collateral invoice from Lendasat.
- Borrower pays the collateral invoice and in turn a lender pays the Bitrefill invoice.
In the background, the loan collateral is locked up in a DLC VTXO, the new construct we present here.
Before we continue, we’d like you to know that the rest of this post assumes some knowledge of DLCs and ARK. Also, keep in mind that everything you read here is still work in progress, so take it with a grain of salt.
How to take a loan
To take a loan, the borrower first lifts bitcoin to Ark via a Lightning payment, for an amount that will cover the required collateral.
Once the borrower has their own VTXO, they can work with the lender to set up the DLC VTXO. The DLC VTXO is a virtual multisig output that will be owned by lender and borrower. Before signing the transaction that creates the DLC VTXO, both parties collaborate to presign a bunch of CETs spending from the DLC VTXO, like we do for regular DLCs.
One key difference is that the lender CET outputs do not pay directly to a lender-owned address, but to a HTLC locked with the same
r_hash
from the borrower’s invoice. If the lender pays the borrower’s invoice and learns the preimage, they will be able to claim their CET outputs. Otherwise, the borrower will be able to claim the funds after a timeout.How to repay a loan
While both parties can unilaterally close the loan contract on-chain, it’s always preferable to collaborate. In the cooperative scenario, lender and borrower forfeit their claim on the collateral locked up in the DLC VTXO under the condition that Lendasat pays them back: the loan plus interest to the lender, and the collateral to the borrower.
We need to ensure that the exchange of ownership is atomic, so the DLC forfeit transaction is constructed in such a way that Lendasat can only claim the funds with knowledge of the preimages to the Lightning payments to borrower and lender.
Outro
This is what we’ve got for today. There is certainly a lot to be done to make this happen, but we are excited about it and hope you are too.
Let us know what you think and check us out at https://www.lendasat.com if you want support us and learn more about the tech and the use case.
“Don’t sell your Bitcoin!”
Lendososhi Satamoto