> For the complete documentation index, see [llms.txt](https://docs.tproof.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tproof.io/technical-section/smart-contracts-overview.md).

# Smart Contracts overview

Before presenting the global structure of smart contracts, a technical note about how we decided to develop them. While initially we were working on Upgradable smart contracts, we fiannly opted for multiple **contracts that are non-upgradable**. This to guarantee the immutability of the core parts of the service over time, especially for those integrating it in business processes that cannot accept multiple payments.

While core elements are immutable, we've set up a degree of flexibility around potential new services that can be added over time.&#x20;

Currently, all the management of the contracts is under responsibility of the core team. In the future, a DAO with voting power will be set up.

### Factory and registry

To mint NFTs and manage the certification of a File URL with a hash, we have two contracts:

* **NFTFactory.sol** - responsible of generating the NFTs, representing the file hash on the blockchain, with the storage of other core NFT details
* **HashRegistry.sol** - manages the certification of the File URL - Hash pair (using Chainlink), with a degree of flexibility on a few parameters. This contract is used only if your files are made Publicly accessible in the certification process

So, if you need to generate a simple proof, you can directly interact with NFTFactory. If you want to publish your file, you need to interact with both. This makes everything more complex, leading to the next contract: Router

### Router: simplify interaction with tProof

The **Router** contract will be your main entry point for almost any of the interactions you may want. Through the router you'll be able to:

* request the creation of a new proof (with private or public file)
* start the certification of a File URL
* extend the validity of a file URL certification
* edit the Name of an NFT

These are the functions that simplifies the interaction and covers 99% of the use cases. More fine-grained options are available by directly interacting with lower-level contracts.

### URL storage and verification

Since in the future we can have, ideally, a wider range of supported storage, we decided to manage the storage of each of them with separate contracts

**HashRegistryStorageType\_ArweaveV1.sol** is the contract that manages the storage for files published on Arweave.

To manage the verification process (call to Chainlink Oracle and reply), **UrlVerifierRouter.sol** has all the required functions.&#x20;

### Represent the tProof

The last contract of our ecosystem is **NFTTokenUriGenerator.sol**. This contracts is in charge of generating the **TokenURI** and can be edited over time, to update its logic with the evolution of our product.


---

# 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.tproof.io/technical-section/smart-contracts-overview.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.
