> For the complete documentation index, see [llms.txt](https://liquidsat.gitbook.io/liquidsat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liquidsat.gitbook.io/liquidsat/documentation/introduction/security-and-technology.md).

# Security & Technology

LiquidSat is designed from the ground up for **self-custodial security** and **deterministic automation**.\
It eliminates bridge and custody risks by locking BTC **directly on Bitcoin** while executing loan logic on **EVM networks** through verified proofs.

The architecture is built around **four coordinated layers** that together ensure every transaction—borrow, lend, repay, or liquidate—is secure, transparent, and verifiable.

***

#### 🧱 1️⃣ Bitcoin Collateral Layer — “Your BTC Never Leaves Bitcoin”

At the foundation, every borrower interaction begins and ends on Bitcoin.

* **BTC Script Lock:** Borrower locks BTC using a *multi-condition script* that defines two possible unlock paths:
  * **Repayment Path:** BTC released back to borrower upon proof of repayment.
  * **Default Path:** BTC released to lender/pool after expiry or undercollateralization.
* **No Wrapping or Custody:** BTC is never bridged or tokenized on another chain.
* **Auditability:** Each collateral lock generates a verifiable Bitcoin transaction ID linked to a LiquidSat loan ID.

> Security is rooted in Bitcoin’s native consensus — not a wrapped asset.

***

#### ⚙️ 2️⃣ EVM Contract Layer — “Loan Logic & Market Mechanics”

On supported EVM networks, LiquidSat deploys modular smart contracts that manage two parallel lending systems:

**Peer-to-Pool Module**

* Aggregates stablecoin liquidity from multiple lenders into standardized pools (7, 30, 90 days).
* Tracks pool balances, utilization, and yield distribution.
* Handles automatic disbursement of stablecoins to verified BTC borrowers.
* Maintains *fixed-rate configuration* per pool instance.

**Peer-to-Peer Module**

* Hosts borrower-created custom loan offers (amount, duration, APR).
* Allows lenders to accept or counter offers directly.
* Synchronizes loan state with collateral verification on Bitcoin.

Each module is governed by a **shared Loan Registry** that maintains unique loan IDs, collateral mappings, and repayment states.

> Whether a loan comes from a pool or a peer, both follow the same settlement rules and risk management logic.

***

#### 🧠 3️⃣ Risk Engine Layer — “Autonomous Enforcement & Settlement”

The **on-chain risk engine** monitors and enforces all lending activity:

* **Collateral Health Tracking:** Uses price oracles to monitor BTC/USD value in real-time.
* **Liquidation Triggers:** Initiates settlement if collateral value < LTV (e.g., 50%).
* **Pre-Signed Transaction Execution:** Broadcasts the correct unlock transaction (borrower repay or lender claim) and settles loans when they expire.
* **Unified Registry:** Maintains consistent loan data across all EVM chains and Bitcoin scripts.

> Risk is managed algorithmically, not administratively — ensuring full transparency.

***

#### 🔗 4️⃣ Messaging & Verification Layer — “Bridge-Free Cross-Chain Proofs”

LiquidSat introduces a **proof relay layer** that observes Bitcoin activity and updates EVM contracts without ever bridging assets.

* **Event Observers:** Watch Bitcoin for specific script events (lock, repay, expiry).
* **Proof Relayers:** Submit cryptographic proof of events to EVM contracts.
* **State Updates:** Verified proofs trigger smart contract state transitions — e.g., releasing stablecoins or finalizing settlements.
* **Bridge-Free Design:** No wrapped tokens, no custodians, no multi-sig middle layers.

> Information moves cross-chain — assets do not.

***

#### 🧩 Architectural Summary

| Layer                  | Responsibility                          | Technology                                           |
| ---------------------- | --------------------------------------- | ---------------------------------------------------- |
| **Bitcoin Collateral** | Secure BTC locking & settlement         | Bitcoin Script, Taproot-compatible multi-path spends |
| **EVM Contracts**      | Manage pools, P2P offers, and repayment | Solidity smart contracts                             |
| **Risk Engine**        | Health checks, expiry, liquidation      | On-chain automation + price oracles                  |
| **Verification Layer** | Cross-chain event confirmation          | Lightweight proof relay                              |

***

#### 🔐 Deterministic Settlement Paths

Each loan has two pre-signed transactions at creation:

1. **Repayment Tx** — Returns BTC to borrower when repayment confirmed.
2. **Default Tx** — Transfers BTC to lender or pool if loan defaults or expires.

The correct transaction is broadcasted automatically, based on on-chain proofs—removing any trust assumptions between parties.

***

#### 🧭 Architectural Highlights

* **Dual Lending Contracts:** Separate modules for P2Pool and P2P, governed by a unified Loan Registry.
* **Unified Collateral Registry:** Every BTC lock is traceable to a single loan or pool.
* **Composable SDK:** Developers and wallets can plug in to query loans, monitor risk, or visualize BTC collateral.
* **Oracle-Verified Risk:** Collateral health tracked by reliable BTC/USD oracle feeds.
* **Bridge-Free Synchronization:** Message proofs connect Bitcoin and EVM logic, not synthetic tokens.
* **Deterministic Liquidation:** Enforced entirely by pre-signed logic; no admin key intervention.

***

#### 🧾 Transparency & Auditability

Every user action—lock, borrow, repay, claim—is permanently verifiable:

* Bitcoin explorers show collateral locks.
* EVM explorers show loan and pool events.
* APIs expose unified loan status (collateral ID ↔ loan ID mapping).

> Nothing is off-chain or hidden — every interaction is verifiable from both ends.

***

#### 📄 Further Reading

For detailed technical documentation and protocol specifications:

**🔗 Whitepaper:** [**LiquidSat Security & Architecture (PDF)**](https://drive.google.com/file/d/18FjOfj7A4YcN7VZ1w5aexxAN3JbXFO20/view?usp=drive_link)<br>
