# Architecture Overview

Axiom consists of two main technical pieces:

* `AxiomV2Core` -- a cache of Ethereum block hashes starting from genesis
* `AxiomV2Query` -- a smart contract which fulfills user queries by verifying against `AxiomV2Core`

### Caching block hashes in AxiomV2Core

The `AxiomV2Core` smart contract caches Ethereum block hashes from genesis in two forms. &#x20;

* First, we cache the [Keccak](https://www.quicknode.com/guides/ethereum-development/smart-contracts/how-to-use-keccak256-with-solidity) Merkle roots of groups of 1024 consecutive block hashes. These Merkle roots are kept updated by ZK proofs which verify that hashes of block headers form a commitment chain that ends in either one of the 256 most recent blocks [directly accessible](https://www.evm.codes/#40?fork=shanghai) to the EVM or a block hash already present in the `AxiomV2Core` cache.
* Second, we store a padded [Merkle Mountain Range](https://github.com/opentimestamps/opentimestamps-server/blob/master/doc/merkle-mountain-range.md) of these Merkle roots starting from the genesis block. This Merkle Mountain Range is updated alongside updates to the Keccak Merkle roots in the first portion of the `AxiomV2Core` cache.

In summary, `AxiomV2Core` provides an efficient way for smart contracts to verify the validity of any historic block hash on Ethereum.

See the page below for more details on how this cache is maintained or accessed.

{% content-ref url="/pages/wE8jQ0IB94EYFiZRvt7P" %}
[Caching Block Hashes](/axiomv2-sdk/protocol-design/caching-block-hashes.md)
{% endcontent-ref %}

### Fulfilling queries in AxiomV2Query

The `AxiomV2Query` protocol is a collection of smart contracts that fulfill user queries for computations over historic Ethereum data. Queries can be made on-chain and are fulfilled on-chain with ZK proof verification.

All computations and Ethereum data accessed within a user query are ZK proved to be valid with respect to Ethereum block hashes. The `AxiomV2Query` smart contract verifies this ZK proof on-chain and also verifies the block hashes against the block hashes cached in `AxiomV2Core`. The result is that all user queries are trustlessly verified with the same security guarantees as Ethereum itself.

Further details about our query protocol are in the page below.

{% content-ref url="/pages/NkxeA3t08FGrgeAk2FMm" %}
[Axiom Query Protocol](/axiomv2-sdk/protocol-design/axiom-query-protocol.md)
{% endcontent-ref %}


---

# 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://intrinsic-1.gitbook.io/axiomv2-sdk/protocol-design/architecture-overview.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.
