![](https://image.nostr.build/bdc48f594d3f49156cf4bff2045a90463450e2f50ddc9db24cc2868558f54aac.jpg)
@ Lendasat
2024-11-18 10:23:46
In August 2024, **Lendasat** introduced a novel loan protocol, designed to address the inherent risks of custodial lending platforms. By leveraging Bitcoin's self-custodial nature, the **Lendasat** protocol allows borrowers to secure loans without transferring ownership of their assets. If you haven’t had a chance to explore our [whitepaper](https://whitepaper.lendasat.com/lendasat-whitepaper.pdf), this blog post will guide you through the protocol and its advantages.
We’ll explore how **Lendasat** works, the technology behind it, and why it stands out as a solution for Bitcoin-collateralized lending. Diagrams will help break down each stage of the protocol, so you can understand the mechanisms step-by-step.
## Bitcoin Lending, the Right Way
Bitcoin, as a decentralized and self-custodial asset, offers users a chance to be their own bank. However, the current landscape for Bitcoin-backed loans often forces users to hand over their Bitcoin to custodians—introducing a set of serious risks:
- **Custodian risk**: Entrusting a third party with your Bitcoin exposes you to theft, mismanagement, or outright fraud.
- **Opaqueness**: Traditional platforms don’t offer transparency on how assets are handled.
- **Regulatory risk**: Centralized custodians are vulnerable to regulatory changes that may lead to asset freezing or seizure.
**Lendasat** eliminates these concerns by enabling **escrow-less lending**. Borrowers retain control of their Bitcoin, using **Discreet Log Contracts (DLCs)** and **Hash Time-Locked Contracts (HTLCs)** to govern loan agreements without middlemen. With these cryptographic tools, **Lendasat** removes the need for trust in centralized entities, offering a **fully transparent and secure** lending process.
---
## How Lendasat Works
The protocol operates between two parties: **Bob** (the borrower) and **Lydia** (the lender). Bob wishes to borrow stablecoins, locking his Bitcoin as collateral, while Lydia provides the loan principal in stablecoins, looking to earn interest.
Let’s dive into how the protocol works, step by step.
### 1. Opening the Loan
The loan process starts with both parties locking assets in cryptographically secured contracts.
#### 1.1 Secret Generation
- Bob generates a collateral secret, `b`.
- Lydia generates a loan secret, `l`.
#### 1.2 Bob Locks Bitcoin Collateral
Bob locks his Bitcoin in a **Discreet Log Contract (DLC)**. The DLC involves an oblivious oracle[^1] that can attest to certain events, such as the price of Bitcoin at loan maturity. If necessary, an oracle attestation can be used at loan maturity to determine how the collateral should be split between Bob and Lydia.
Additionally, Bob locks Lydia's claim on her share of the collateral behind the hash of the collateral secret, `H(b)`. Lydia will need to know `b` to be able to claim her portion of the collateral unilaterally.
> **Key Insight**: Unlike traditional escrows, the **DLC** ensures that Bob retains control of his collateral throughout the loan process. The oracle attestation is only needed to help settle the contract if Bob and Lydia fail to cooperate.
#### 1.3 Lydia Locks the Principal
Lydia, in turn, locks the loan principal in an **HTLC** on Ethereum (or another smart contract-enabled blockchain[^2] or L2). This HTLC is designed so that Bob can only claim the principal if he reveals `b`.
- **Condition 1**: Bob must provide the preimage to `H(b)` i.e. `b`.
- **Condition 2**: If Bob doesn’t act in time, Lydia can recover her funds after a timelock expires.
#### 1.4 Bob Claims the Principal
Bob, now seeing the loan principal is locked up, reveals the secret `b` to claim it. This revelation allows Lydia to later claim part of the Bitcoin collateral, but only if Bob defaults on repayment or in the event of a liquidation.
![](https://m.stacker.news/63397)
### 2. Cooperative Repayment
If Bob is ready to repay the loan:
1. **Bob** locks the repayment amount in an **HTLC** on Ethereum, this time using `H(l)` as a hash lock.
2. **Lydia** claims her repayment, revealing `l`.
3. **Bob** uses `l` to unlock the entirety of his Bitcoin collateral from the DLC.
![](https://m.stacker.news/63398)
---
## When Things Go Sideways
Not all loans proceed smoothly. Here’s how **Lendasat** handles common scenarios when the loan doesn't go as planned.
### 1. Lender No-Show
What happens if Bob locks up his Bitcoin collateral, but Lydia disappears before providing the principal?
In this case, Bob can unilaterally recover his Bitcoin after an **early collateral refund timeout** built into the contract. This timeout prevents Bob’s collateral from being stuck indefinitely, a common safeguard in decentralized contracts.
![](https://m.stacker.news/63399)
### 2. Borrower Fails to Claim the Loan
Similarly, if Lydia locks up the principal and Bob does not claim it, both parties are protected by respective timeouts:
- **Lydia** recovers her principal after a shorter refund timeout on Ethereum.
- **Bob** gets his Bitcoin collateral back after a longer refund timeout.
These dual timeouts ensure neither party’s assets remain frozen for too long.
![](https://m.stacker.news/63400)
### 3. Unilateral Repayment
If Bob defaults or Lydia doesn’t claim her repayment, the protocol shifts to **non-cooperative repayment** through the **DLC**. In this case, the protocol involves an oracle attestation to the Bitcoin price at loan maturity. Lydia receives an amount of Bitcoin collateral equivalent to the loan’s value (plus interest) based on the oracle's attestation. The remaining collateral goes back to Bob.
This mechanism ensures that even in the worst case, Lydia can still recover her funds by liquidating part or all of Bob’s Bitcoin collateral.
![](https://m.stacker.news/63401)
---
## Keeping the Loan Alive: Liquidation and Collateral Management
One of the key challenges of lending is managing **Loan-to-Value (LTV) ratios**. If Bitcoin’s price falls significantly, Lydia might have to liquidate part of the collateral to cover the outstanding loan.
Here’s how **Lendasat** addresses liquidation:
- If the LTV ratio approaches a critical threshold, **Lydia** can trigger an oracle-based liquidation of the Bitcoin collateral before loan maturity. This protects the lender from losses due to market volatility.
- Liquidation relies on the same **DLC** mechanism that handles non-cooperative repayment, ensuring a smooth, automated process for collateral distribution.
The protocol also allows Bob to **increase his collateral** if necessary, by splicing into the DLC with more funds, keeping the loan in good standing and avoiding liquidation.
![](https://m.stacker.news/63402)
---
## Technical Appendix: How HTLCs and DLCs Combine
### HTLCs: Enabling Cross-Chain Functionality
An **HTLC** (Hash Time-Locked Contract) is a foundational building block for cross-chain operations. It allows Bob to lock collateral on one chain (Bitcoin) while simultaneously claiming funds on another (Ethereum). In Lendasat, **HTLCs** govern the locking and claiming of both loan principal and repayment on the Ethereum chain.
### DLCs: Securing Conditional Payouts
A **Discreet Log Contract (DLC)** is used to ensure that Bob’s Bitcoin collateral is only accessible to Lydia under specific conditions, like a default or liquidation event. The **DLC** relies on oracles to determine the correct payout based on the Bitcoin price at loan maturity or liquidation.
Combining these two technologies allows **Lendasat** to create a trustless lending mechanism that spans multiple blockchains.
---
## Conclusion
**Lendasat** redefines Bitcoin-collateralized lending by eliminating custodial risk and empowering borrowers to retain control of their collateral. Using **HTLCs** and **DLCs**, our protocol creates a trustless environment where both lenders and borrowers are protected, even in the event of non-cooperation or default.
For those interested in a deeper technical understanding, please refer to our [whitepaper](https://whitepaper.lendasat.com/lendasat-whitepaper.pdf), and stay tuned as we continue to refine the protocol and unlock new possibilities for decentralized finance.
## Footnotes
[^1]: When we talk about an oracle, we are not discounting the possibility of using _multiple_ oracles. The DLC protocol does allow for a quorum of oracles to determine the outcome of an event, to distribute the trust.
[^2]: This can be the Bitcoin blockchain itself, via Taproot Assets, RGB or BRC20.