# Smart Contracts

The zkBob solution is based on several interrelated smart contracts. The main purpose of the contract subsystem is to store the current [Merkle tree](/implementation/untitled.md) state inside the base blockchain. Each zkBob transaction changes the Merkle tree, so it should be processed by a smart contract. See the subsystem below, where the Pool contract is the primary contract for processing transactions.

<figure><img src="/files/LielUTNDwDtKWK6Sb7tv" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
[Contracts Github repo.](https://github.com/zkBob/zkbob-contracts) Contract code is also linked in the contract pages referenced below.
{% endhint %}

* [Pool contract ](/implementation/contracts-and-circuits/the-pool-contract.md)is the main contract which holds the current Merkle tree state. It process all transactions and holds a current Merkle tree root.
* [Token contract](/implementation/contracts-and-circuits/token-contract.md) mints a shielded coin protected by the current zkBob solution. This token is deposited in the Pool contract and withdrawn from it.
* [Verifier contracts](/implementation/contracts-and-circuits/verifier-contracts.md) are used by the Pool contract to check transaction correctness / validate zkSNARK proofs.
* [Operator contract](/implementation/contracts-and-circuits/operator-manager-contract.md) helps the Pool contract to determine whether transactions can be accepted from a sender. It is used in the multi-relayer configuration to serialize the transaction sequence from the different nodes and minimize transaction collisions.
* [Voucher token contract](/implementation/contracts-and-circuits/voucher-token-contract.md) mints a token ([XP](/roadmap/exploratory-features/xp.md)) to reward users for their contribution in the anonymity set.


---

# 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://docs.zkbob.com/implementation/contracts-and-circuits.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.
