# The Transaction Lifecycle

A transaction proceeds through several stages before being accepted by the contract.

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

First the initiator (zkBob client) forms the desired transaction type. Output account and notes are calculated, encrypted, and packed into the memo block. The zkSNARK proof is also calculated. The client sends the public portion of the transaction along with the proof to the relayer node.

{% hint style="info" %}

#### The public transaction data sent to the relayer:

* Transaction proof containing the following input fields:
  * Merkle tree root (at the moment the transaction is created)
  * Transaction nullifier
  * The commitment
  * The delta value (a composition of the transaction index, token delta and energy delta)
* Encrypted memo block
* Transaction type
* Deposit signature (for deposit transactions only)
  {% endhint %}

The relayer calculates the Merkle tree proof for the received transaction and composes a transaction sent to the zkBob Pool contract.

On transaction receipt the pool contract checks proofs with the verifier contracts and approves the transaction.

{% hint style="info" %}

#### Sending a transaction without a Relayer

If a relayer node is down or compromised, a user can create a transaction without the relayer. To do this the user should build an actual zkBob Merkle tree to calculate the proof.

*Directions in process*
{% endhint %}


---

# 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.zkbob.com/implementation/transaction-overview/the-transaction-lifecycle.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.
