> For the complete documentation index, see [llms.txt](https://docs.velio.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.velio.xyz/security/design-rationale.md).

# Design rationale

Why Velio Fabric separates execution, proving, and on-chain confirmation.

Perpetual markets place two demands on an exchange: it must keep processing orders and managing risk, while maintaining account records that can be checked. Receiving an instruction, updating assets and positions, and confirming a new state on-chain are distinct responsibilities.

Velio Fabric separates execution, account-state proving, and on-chain confirmation, then connects them through the same account updates. This division gives the trading system a focused role and establishes an explicit verification path for the changes it produces.

### Keep execution focused on trading

Matching, risk checks, and position updates work closely together. An off-chain execution layer keeps these operations separate from the main chain’s confirmation cycle. The resulting account changes then move through proving and verification.

### Give account updates a verifiable basis

Balances and positions record the outcome of trading activity. The ZK reconciliation circuit connects the before-and-after states with change events and required authorization, allowing contracts to check that an update satisfies the relationships defined by the circuit.

### Establish a shared reference for confirmed state

An execution result still needs a defined acceptance step. Once a proof passes verification, the contract updates the state root, providing a common starting point for subsequent updates. Keeping execution and confirmation distinct makes each stage’s responsibility explicit.

### Pair proofs with the data needed for reconstruction

A proof supports verification of a state change; reconstructing an account requires the underlying data. Velio Fabric therefore writes account changes to a separate DA layer. Given a starting state and the complete set of account changes, those changes can be applied in sequence to reconstruct account state.

### How the pieces work together

Execution produces account changes, the proving engine checks them, and on-chain contracts accept the verified state. State and event data connect these modules into a complete path from a trading instruction to account-state confirmation.

1. **Execute**: process instructions and update accounts.
2. **Prove**: check changes and required authorization.
3. **Confirm on-chain**: accept the verified state.

Account-state updates connect each stage of the architecture.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.velio.xyz/security/design-rationale.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
