# Sequencer Processing

Once the order has been submitted, it moves to the **sequencer** stage. The sequencer's main job is to organize and arrange all the centralized transactions in a specific order, making sure everything is processed fairly and consistently.

<figure><img src="/files/S1FOBRzPcE3hdrrQD2mp" alt=""><figcaption><p>Sequencer Processing</p></figcaption></figure>

### **Off-Chain Order Processing**:

The sequencer collects all the submitted orders and arranges them in a specific order before grouping them into batches (Merkle Trees). You can think of this process as sorting mail into neat piles before sending it out. This organized batch is then ready to be secured and posted on-chain.

### **Securing Transactions&#x20;*****(Merkle Trees)***

1. After the transactions are organized, they are grouped into a **Merkle Tree**, which is a method used to securely bundle and verify the data.
2. Imagine a **Merkle Tree** as a way to create a unique “summary” of all the transactions in a batch. **Here's how it works:** each transaction gets a label (into a “hash”), and then those labels are combined to form branches, eventually leading to a single label at the top called the **Merkle Root**.
3. The **Merkle Root** is like a fingerprint for the entire group of transactions. If someone tries to change even one transaction, the Merkle Root would change, making it clear that something was altered. This provides strong security and ensures that all the transactions remain tamper-proof.

<figure><img src="/files/JImTw9IK2hSnARNhobb1" alt=""><figcaption><p>Merkle Root Visualization</p></figcaption></figure>

### **Decentralized Orders:**

In the **decentralized method**, the order does not need to go through the sequencer. Instead, it is already posted directly on the blockchain. This means that the decentralized version of the order is visible and transparent on-chain without needing the extra step of sequencing.


---

# 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.yamata.io/yamata-nodes/transaction-processing/sequencer-processing.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.
