> For the complete documentation index, see [llms.txt](https://sacred.gitbook.io/sacred-finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sacred.gitbook.io/sacred-finance/technical-details-1/relayer.md).

# Relayer

**To further achieve a state of privacy, Sacred uses Relayers.**

The problem with blockchain transactions on Ethereum, Polygon, and similar chains is that the user will need to pay for gas. To pay for gas, a wallet needs MATIC/ETH. To get MATIC/ETH to pay for gas, a user might get it from an exchange, a friend, or themselves, maybe from a wallet that is already connected to their identity. A malicious actor can find out where their MATIC came from and link it with the user’s identity. Relayers help solve this problem.

Asset withdrawals and Yield earned can be redeemed anonymously to a “clean” wallet, aka a wallet with no ETH or MATIC, through relayers. A relayer is a privacy-preserving payment mechanism that protects anonymity by sending and paying for the transaction on their behalf. The relayer is refunded for the gas fees by deducting the gas fees from their withdrawal. A relayer cannot act maliciously as the ZK-SNARK proof is generated from their local device and verified on-chain. This Zero Knowledge Proof also contains the receiving address as part of the proof calculation to ensure that nobody can tamper with it. Furthermore, the yield redemption mechanism is separate from the initial principle — this separation further ensures the security and anonymization of transactions.

The relayer never has possession of the user’s deposit/withdrawn funds. The contract handles all payments; the relayer only executes the transfer function by providing the user’s proof.

Note: Because the proof is generated using parameter values like the recipient address, a relayer cannot tamper with the proof or arguments to have a successful withdrawal. A malicious relayer will have the transaction rejected, and the user’s funds will stay inside the contract and count as not withdrawn (also at the expense of the relayer who paid for gas until the contract reverted).


---

# 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, and the optional `goal` query parameter:

```
GET https://sacred.gitbook.io/sacred-finance/technical-details-1/relayer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
