> For the complete documentation index, see [llms.txt](https://docs.recyv.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.recyv.xyz/how-it-works/architecture.md).

# Architecture

Recyv is a Next.js application with a small number of API routes. There is no Recyv smart contract, and no backend that holds funds.

## What happens on chain

A payment is a single transaction from the payer's wallet to the payee's: an ERC-20 `transfer` for tokens, or a plain value transfer for native ETH. Recyv is not a party to it.

## What happens off chain

Three small pieces of state:

**Link payloads.** A short code maps to what the request is for, the amount, the recipient, and the token. Stored server-side so links can be short rather than carrying an encoded payload in the URL.

**Payment receipts.** A hash reported by the payer's browser after confirmation, verified against the chain before it is stored.

**The token registry.** The list of tokens the app accepts.

## The token registry

The registry is served from storage at runtime and re-fetched by every open page every five seconds, with caching disabled.

This means a token can be added, or an address corrected, and every open browser picks it up within one poll — no rebuild, no redeploy, and no reload on the user's part.

The tradeoff is that the registry is a high-value target: whoever can write to it decides which contract the payment buttons point at. Recyv therefore does not trust it. Every token is read from its own contract before payment is enabled, and a registry entry whose on-chain symbol disagrees with what it claims is refused.

## Links

Requests are self-describing. A link contains, or resolves to, everything needed to render and pay it. There is no user record behind it, which is why there is no account to create and nothing to log into.


---

# 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://docs.recyv.xyz/how-it-works/architecture.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.
