# Bitcoin-Native Smart Contracts

At the heart of Helios is the MIDL execution layer, which provides a smart contract platform native to Bitcoin. MIDL (Modular Integrated Decentralized Ledger) functions as an EVM-compatible layer operating *on top of Bitcoin’s blockchain*. It’s not a separate alt-chain, sidechain, or Bitcoin L2 that needs bridging; instead, it piggybacks on Bitcoin for ordering and finality. Specifically, each batch of Helios contract executions produces a cryptographic commitment (e.g., a Merkle root of the new state) that is embedded in an **actual Bitcoin transaction**. This gives a tamper-resistant, verifiable log of Helios’s smart contract state changes on Bitcoin – effectively extending Bitcoin with Ethereum-like computation without altering Bitcoin’s consensus rules.

## How it works

Users initiate Helios actions by sending ordinary Bitcoin transactions with encoded data that invoke MIDL smart contracts. For example, to deposit BTC and take a loan, a user sends BTC to a TSS vault (managed by the MIDL validators) with an attached instruction. The validators detect this, execute the corresponding lending logic in the EVM layer, and then commit the outcome on-chain in the next Bitcoin block. Because MIDL is EVM-compatible, Helios’s contract logic is written similarly to Ethereum smart contracts (Solidity), making it familiar to developers. The **execution layer’s modularity** also means Helios’s core logic could be portable to other Bitcoin execution layers or sidechains if needed, ensuring flexibility and upgradability. All contract events (deposits, loans, interest accrual, etc.) ultimately settle in Bitcoin transactions, so the source of truth is always the Bitcoin ledger.

This design provides Ethereum-level functionality with Bitcoin-level security. There are no bridges or secondary tokens – **raw BTC itself is used** for fees and collateral, preserving the “**nativity**” which is crucial for trustless operation on Bitcoin. By using Bitcoin’s blockchain for finality, Helios inherits Bitcoin’s robustness (e.g., enormous hash power security) while introducing programmability through MIDL. In essence, MIDL acts as an execution sandbox whose state is anchored to Bitcoin blocks, enabling complex DeFi operations to run *natively* for the first time on Bitcoin.

For more information, please refer to MIDL's Gitbook, especially the validator section(<https://midl.gitbook.io/midl/midl-overview/validators>).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helios-finance.gitbook.io/helios-finance/architecture/publish-your-docs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
