> For the complete documentation index, see [llms.txt](https://docs.zkbob.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zkbob.com/implementation/transaction-overview/common-structure.md).

# Common Structure

The transaction sent to the zkBob contract contains the following fields:

* Account nullifier - protects from double-spending, if the nullifier already exists the transaction is not valid and will not be executed.
* Transaction commitment - transaction's subtree root hash
* Transfer index
* XP (energy) amount - for withdrawal transaction
* Token amount - a positive value for deposit transaction, negative for withdrawal.
* Transaction proof
* Merkle tree root after transaction inclusion
* Merkle tree proof
* [Transaction type](/implementation/transaction-overview/transaction-types.md)
* Transaction specific fields (depending on transaction type)
* Memo block containing encrypted transaction details (accounts and notes)
* Deposit signature - for retrieving source account (exists in the deposit transaction only)

In general, a transaction sender must prepare all fields before submitting a tx to the contract. When using the relayer, the relayer should calculate proofs and send the transaction to the contract.

There are two parts to a transaction created by a sender -  public and secret.&#x20;

1. The public input containing encrypted transaction data and other fields which do not disclosure sender, receiver, internal transfer amount, etc.
2. The secret portion contains unencrypted data such as input and output accounts and notes, proofs, and EDDSA signature.

#### Public transaction components

* The current Merkle tree root (before transaction processing by the contract)
* Input account nullifier
* Transaction commitment
* Delta value (a composition of the transaction index, token delta and energy delta)
* Memo block

#### Secret transaction components

* A set of unencrypted input\output account and notes for the transaction
* Input account and notes proofs
* Transaction signature $$(S, R)$$
* Transaction verifier key $$A$$ to verify signature


---

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