> For the complete documentation index, see [llms.txt](https://cvnnt.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cvnnt.gitbook.io/documentation/system-architecture/distributed-middleware-state-management-system.md).

# Distributed Middleware State Management System

Covenant system provides deterministic EVM programmability with onchain verifiable statefullness directly on native Bitcoin UTXOs without altering Bitcoin itself.&#x20;

Covenant Distributed Middleware State Management System ensures Covenant environment is seamlessly compatible both with Bitcoin blockchain and EVM-based chains at the same time.

It achieves simultaneous, verifiably correct compatibility with both Bitcoin’s UTXO model and the EVM account model - enabling true self-custodial BTCFi and wrapless cross-chain liquidity.

The system consists of three tightly integrated components:

### 1. Distributed Data Middleware Ledger (DDML)

Covenant system uses original Bitcoin Core-based UTXO as its data and assets handling ledger that maintains 1:1 structural compatibility with native Bitcoin, Bitcoin-grade data security, and Covenant expanded operational resilience.

* Inherits Bitcoin’s exact data model, validation rules, and double-spend protection;
* Enforces Bitcoin-grade state, finality and security for every asset and operation;
* Requires zero consensus or soft-fork changes on Bitcoin mainnet;
* Extended with safe introspection opcodes and covenant primitives to enable stateful scripting

### 2. Intrinsic EVM Runtime Environment

A genuine, unmodified intrinsic Ethereum' EVM running natively on top of the UTXO ledger.

* Full Turing-complete execution environment
* Direct MetaMask/Rainbow/WalletConnect compatibility
* All existing EVM tooling, languages and contracts work seamlessly out-of-the-box
* State and storage are persisted directly against UTXOs

### 3. Data Processing UTXO↔EVM Sequencer Module

A lightweight, deterministic translation engine that bridges the two paradigms in real time.

* Continuously ingests UTXO transitions from the DDML
* Constructs and maintains a Merkle Patricia Trie (MPT) exposing an EVM-native interface for seamless EVM operations
* Guarantees atomic consistency: every related UTXO spend or transition is immediately and correctly reflected in the EVM state
* Produces canonical receipts and state roots that are cryptographically anchored back to the underlying Bitcoin-grade UTXO set

<figure><img src="https://content.gitbook.com/content/IrCs7se0X60UkwSdNUVw/blobs/cFeSYlOoz52yvEjYHCio/image.png" alt=""><figcaption><p align="center"><em>Covenant state management system general structure</em></p></figcaption></figure>

### Resulting Properties (onchain-proven, not promised)

| Property                              | How Covenant achieves it                                   |
| ------------------------------------- | ---------------------------------------------------------- |
| Native Bitcoin asset custody          | All value remains in real Bitcoin UTXOs                    |
| Full EVM programmability              | Unmodified Ethereum EVM running directly on UTXOs          |
| Verifiable on-chain state             | Every EVM state root is derivable from the public UTXO set |
| No bridges, wrappers, or federations  | Zero trust assumptions outside Bitcoin itself              |
| Instant finality & self-custody exits | Covenant scripts release original BTC in <1 minute         |
| Seamless MetaMask integration         | Users interact via standard EVM wallets                    |

<p align="center"></p>
