> For the complete documentation index, see [llms.txt](https://docs.fetcch.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fetcch.xyz/pull-payments-layer/how-it-works/how-is-it-stored.md).

# How is it stored?

Let's delve into the storage and structure of transaction requests to understand how they're stored and verified:

**1. Structure of Transaction Request**

Transaction requests can reside in one of three states:

* **Fulfilled:** This state is achieved once a user has successfully paid a transaction request.
* **Pending:** This is the state when a transaction request is freshly created but hasn't been processed by the user.
* **Expired:** A transaction request transitions to this state when the current time surpasses its set expiration time.

**2. Storage Mechanism**

For ensuring security and traceability:

* Every version undergoes a `SHA-256` hashing process.
* If the second version of a transaction request is absent, a placeholder `null` SHA-256 hash (e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855) steps in.
* These hashes are then funneled into a merkle root generator function. The resulting merkle root is diligently stored on the target blockchain. This setup empowers users to authenticate whether their off-chain transaction requests are legitimate.

**3. Verification Process**

For payment platforms like wallets, there are a couple of options:

* **Trust Offchain Data:** Platforms can choose to rely on offchain data, but they should be fully aware of the associated risks.
* **Verify Offchain Data:** If platforms opt for verification:
  * They can solicit a proof from the offchain server.
  * Using the acquired proof, they can invoke the `verifyMerkleProof` function on their provider's contract.
  * By submitting the proof alongside the owner's address, they'll receive a straightforward `true` or `false` response, denoting the validity of the transaction request.

<figure><img src="/files/7tMGlC4CGMrNbUFpbXSw" alt=""><figcaption></figcaption></figure>

Note: Change transaction requests to pull payments

In essence, this framework ensures both the integrity and traceability of transaction requests, offering users and platforms a secure and transparent experience.


---

# 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:

```
GET https://docs.fetcch.xyz/pull-payments-layer/how-it-works/how-is-it-stored.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.
