> For the complete documentation index, see [llms.txt](https://docs.zklink.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zklink.io/architecture/settlement-layer/in-detail-contract-system-on-primary-chain.md).

# In-Detail: Contract System on Primary Chain

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

In order to create a modular smart contract system that can be extended after deployment, Nova applies a **diamond proxy contract** ([EIP-2535](https://eips.ethereum.org/EIPS/eip-2535))  with functions called facets, which include:

* **zkLink admin facet** that provides the interface for managing gas fee, adding new secondary chains, etc.
* **zkLink mail box facet** that provides the interface for on-chain transactions like deposit and withdraw.
* **zkLink executor facet** that provides the interface to commit, prove and execute batches.&#x20;
* **zkLink getters facet** that provides the interface to read the state of Nova network.

In the stage of proving a batch's validity,  the **verifier contract** will be called by the **executor facet** of the **diamond proxy contract** to validate ZKP.

**Governance contract** is the owner of the **diamond proxy contract**, which is able to upgrade facets in the proxy contract.

**Validator Timelock** controls the operations including committing, proving and executing batches.&#x20;

**L1ERC20Bridge** uses the requestL2Transaction interface of Diamond Proxy to send the ERC20 bridge message to Nova network.

**Linea2Gateway** is in charge of transmitting massage between Linea and Ethereum.


---

# 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://docs.zklink.io/architecture/settlement-layer/in-detail-contract-system-on-primary-chain.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.
