# Trade receipts

> Prove a trade's result without revealing the position, your address or the close. What a receipt shows and how it's checked.

Source: https://docs.rooq.trade/trade-receipts

## Trade receipts

A trade receipt proves how one of your closed trades went, and shows only what you choose. It's a zero-knowledge proof your browser makes from your own private records. Anyone can check it, and it never reveals the position itself.

Use one to share a result, to enter a competition, or to show a trade to anyone you choose, without opening up your account.

### What a receipt can show

You pick the fields when you make it. Anything you leave out is not in the receipt at all.

| Field | What it says |
| --- | --- |
| Return on margin | Your result as a percentage of the margin the position ended with, after every fee and funding payment |
| Profit or loss | The same result in collateral units |
| Market | Which market the trade was on |
| Long or short | The side |
| Size | The position size |
| Entry price | The price you entered at |
| Margin | Your margin in that position |

### What a receipt never shows

- Your private address, your maker's address, or any key
- The position record or the transaction that closed it
- The exit price. The close publishes the oracle mark on chain, so an exact exit price would point straight at the close transaction.
- Anything that links two of your receipts. Every position uses its own one-time key, so two receipts from the same account look unrelated.

### What the proof checks

The proof shows that:

1. You hold the one-time key of the position, so only the trader who took it can make the receipt. The maker and the risk workers can't.
2. The position was recorded in the Rooq tree on this deployment.
3. The close or liquidation that ended it paid you a note, which is also in the tree. Your result is that payout minus your margin, so fees, the close spread and funding are already included.
4. The values you chose to show are the real ones. A hidden field is zero in the proof, never a guess.

A receipt can also be tied to a statement, such as a competition and your handle. A receipt made for one statement fails for any other, so nobody can enter your trade under their name.

### Make one

1. Open **Private activity** and expand a closed trade you took.
2. Under **Share this result**, tick what to show.
3. Press **Save trade receipt**. The proof is made on your device in a few seconds and saved as a file.

### Check one

Open [rooq.trade/inspect](https://rooq.trade/inspect) and drop in the file. The check runs in your browser. It verifies the proof against the circuit this site ships and confirms the tree state it refers to exists on chain. Nothing is sent to Rooq.

### Competitions

Competition entries are trade receipts made for that competition and your X handle, from the competition page in the app. The board ranks each entrant's best trade by return on margin. You choose which trades to enter, because nobody, Rooq included, can link your trades together.

### Limits today

- Receipts cover positions you took. Receipts for makers come later.
- If you reduced a position before closing it, the receipt covers the final version, and its return is on the margin that version ended with.
- Receipts are for this deployment's chain. A receipt from Elysium is checked on [elysium.rooq.trade/inspect](https://elysium.rooq.trade/inspect).

The circuit is `trade_receipt` in the [repository](https://github.com/winsznx/rooq/tree/main/zk/circuits/trade_receipt), built with the same reproducible build as every other Rooq circuit.
