> For the complete documentation index, see [llms.txt](https://koova.gitbook.io/koova-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://koova.gitbook.io/koova-whitepaper/the-platform/technical-architecture.md).

# Technical Architecture

## Five-Layer Architecture

Koova’s architecture is built on five integrated layers, combining technical infrastructure with business logic.

### Layer 1: Proof Generation

This layer creates verifiable evidence of transactions using Type 0, 1, or 2 proofs. It includes:

* **Proof Selector:** Heuristic engine that automatically chooses which proof type to use based on transaction value, merchant reputation, and market conditions
* **Type 0 Generator:** ECDSA signatures for fast, simple proofs
* **Type 1 Generator:** Notarized TLS for medium-strength proofs
* **Type 2 Generator:** zkTLS for maximum-strength proofs
* **Proof Caching & Batching:** Reduces redundant computation and improves performance

### Layer 2: Verification & Validation

This layer validates proofs and detects fraud using machine learning. It includes:

* **Proof Validator:** Type-specific logic for validating each proof type
* **Offer Parser:** Structured data extraction from offers
* **Fraud Detector:** ML-based fraud detection trained on historical data
* **Rate Limiter:** x402-based rate limiting to prevent abuse

### Layer 3: Recording

This layer anchors proofs to an immutable ledger for disputes and compliance. It includes:

* **Merkle Tree Batching:** Efficient batching of proofs
* **Solana Program:** State storage on Solana blockchain
* **State Compression:** Hash + metadata for efficient storage

### Layer 4: Integration

This layer provides SDKs and plugins for easy integration. It includes:

* **JavaScript/TypeScript SDK:** For web and Node.js applications
* **Python SDK:** For backend merchants and data scientists
* **Rust SDK:** For high-performance agents
* **Plugin System:** Shopify, WooCommerce, and AI frameworks
* **Webhook Handlers:** Event-driven integration

### Layer 5: Governance & Economics

This layer manages incentives, pricing, and protocol evolution. It includes:

* **Reputation System:** Merchant and agent reputation tracking
* **Fee Structure:** Dynamic pricing based on market conditions
* **Governance DAO:** KOOVA token-based governance
* **x402 Coordinator:** Micropayment coordination


---

# 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 dynamically by asking a question.

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

```
GET https://koova.gitbook.io/koova-whitepaper/the-platform/technical-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
