# 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](https://docs.zkbob.com/implementation/untitled) 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="https://283693977-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjSwkv4zokqCUebt-98%2Fuploads%2FpAJKDBgoBVOcIZ7Sue8n%2F1_Light_Smart%20Contracts.jpg?alt=media&#x26;token=35428bd1-7280-4427-8a87-585a3fc97c4e" 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 ](https://docs.zkbob.com/implementation/contracts-and-circuits/the-pool-contract)is the main contract which holds the current Merkle tree state. It process all transactions and holds a current Merkle tree root.
* [Token contract](https://docs.zkbob.com/implementation/contracts-and-circuits/token-contract) mints a shielded coin protected by the current zkBob solution. This token is deposited in the Pool contract and withdrawn from it.
* [Verifier contracts](https://docs.zkbob.com/implementation/contracts-and-circuits/verifier-contracts) are used by the Pool contract to check transaction correctness / validate zkSNARK proofs.
* [Operator contract](https://docs.zkbob.com/implementation/contracts-and-circuits/operator-manager-contract) 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](https://docs.zkbob.com/implementation/contracts-and-circuits/voucher-token-contract) mints a token ([XP](https://docs.zkbob.com/roadmap/exploratory-features/xp)) to reward users for their contribution in the anonymity set.
