# On-chain ZK Verifiers

To verify ZK proofs on-chain, Axiom uses specialized smart contracts which are programmatically generated for each SNARK. This was done with the [`snark-verifier`](https://github.com/axiom-crypto/snark-verifier/releases/tag/v0.1.7-goerli-beta) library developed by the [Privacy Scaling Explorations](https://github.com/privacy-scaling-explorations/snark-verifier) group at the Ethereum Foundation, which generates Solidity assembly code for verifying any given ZK circuit.

#### Deployed Verifier Contracts <a href="#deployed-verifier-contracts" id="deployed-verifier-contracts"></a>

We deployed the verifier contracts to Goerli from Solidity source code using `solc` Version: `0.8.19`. The Solidity assembly code for each contract can be inspected on Etherscan.

| [**`AxiomV2CoreGoerliVerifier`**](https://goerli.etherscan.io/address/0xaA1D4372355aB67Fb033Dc244c32A6423C0E87B7#code) |
| ---------------------------------------------------------------------------------------------------------------------- |
| [**`AxiomV2QueryVerifier`**](https://goerli.etherscan.io/address/0x0f330c38eda10Ec94601FE4289BD0B2bCC6F359f#code)      |

We will soon be open-sourcing the Rust code used to programmatically generate the Solidity code above.

#### Checking Verifiers are not Metamorphic <a href="#checking-verifiers-are-not-metamorphic" id="checking-verifiers-are-not-metamorphic"></a>

In `AxiomV2CoreMockHistorical`and `AxiomV2Query`, each of these verifiers is subject to a timelock upgrade guarantee. To ensure that this timelock guarantee cannot be bypassed by a [metamorphic contract attack](https://0age.medium.com/the-promise-and-the-peril-of-metamorphic-contracts-9eb8b8413c5e), users should verify on each upgrade that the bytecode for verifier contracts above does not contain `DELEGATECALL` or `SELFDESTRUCT` opcodes. This can be done either by searching the Solidity assembly code or analyzing the compiled bytecode itself. Thanks to Zellic for pointing out this concern.


---

# 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/transparency-and-security/on-chain-zk-verifiers.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.
