> For the complete documentation index, see [llms.txt](https://docs.bitcoinos.build/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bitcoinos.build/technical-documentation/grail-pro-charms-zkbtc/technical-overview/grail-pro/grail-pro-system-architecture/backend.md).

# Backend

Design: A horizontally scalable, trustless service employing a decentralized queue-based architecture for processing tasks in an orderly manner.

Tasks: Scans integrated blockchains for relevant transactions, stores them in a dedicated database (without secrets or personally identifiable information), generates ZK-proofs (using schemes like Groth16), and handles transaction formation, validation, tracking, and error management via HTTP API endpoints.

Workflow: Detects payments, creates bridging transactions (e.g., locking BTC to mint zkBTC or burning zkBTC to release BTC), and forwards unsigned transactions to operators via a simple message broker. Collects signatures and publishes once the threshold is met. Supports complex transactions with multiple inputs/outputs for batching user payments.

<br>


---

# 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.bitcoinos.build/technical-documentation/grail-pro-charms-zkbtc/technical-overview/grail-pro/grail-pro-system-architecture/backend.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.
