# GET /v4/confidential-rewards/zama

_Merkl API_

Returns a campaign's leaderboard with every reward amount FHE-encrypted for Zama's confidential
distribution: `(recipient, encryptedAmount, inputProof)` triples ready for `FHE.fromExternal`.
Merkl performs the encryption, so the distributor never receives a cleartext amount.

**Only amounts are confidential.** Recipient addresses are returned in cleartext — the
distributor must know who to pay. The participant set and count are therefore visible.

**The consuming contract is fixed by this route**, not a parameter, and is echoed back as
`contractAddress`. It is currently a placeholder, so proofs are structurally valid but NOT
redeemable on-chain — they exercise the pipeline only. `userAddress` IS a parameter: it is
bound into every proof alongside the contract, the chain ID and the chain's fhEVM ACL address,
and a proof built for a different submitting address is rejected on-chain and cannot be
repaired after the fact.

**One proof covers several recipients** — `recipientsPerProof` (32 for `euint64`) entries share
an `inputProof`, grouped by `proofId`. Submit a group together, or pass the same proof in each
of several transactions; both verify.

**Amounts must fit the FHE type.** `euint64` (the ERC-7984 type, and the default) caps one
amount at 2^64-1, which is only ~18.44 tokens of an 18-decimal reward. Use `amountDecimals` to
request a coarser denomination, or a wider `fheType`. Overflow returns 422 and never wraps.

Amounts are settled committed rewards, aggregated per recipient across reasons. Uncommitted
engine state (TempLeaves) is excluded.

Private campaigns are refused. Campaigns that hide their leaderboard ARE supported — the
encryption is what keeps the leaderboard hidden.

Results are ordered by recipient address, which is independent of the amounts — an
amount-ordered response would reveal the full ranking even though every amount is encrypted.
Not configurable, and it makes paging repeatable.

### Query parameters

- `page` (string | number)
- `items` (string | number)
- `chainId` (string | number) _(required)_
- `campaignId` (string) _(required)_
- `fheChainId` (string | number)
- `userAddress` (string) _(required)_
- `fheType` (string | string | string)
- `amountDecimals` (string | number)
- `hide` (boolean)

## Example request

```bash
curl -X GET "https://api.merkl.xyz//v4/confidential-rewards/zama?chainId=<chainId>&campaignId=<campaignId>&userAddress=<userAddress>" \
  -H "x-api-key: YOUR_API_KEY"
```