> For the complete documentation index, see [llms.txt](https://docs.fbtc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fbtc.com/system-components/onchain-smart-contracts/fbtc-minter.md).

# FBTC Minter

The `FBTCMinter` contract is a critical component in the FBTC protocol that manages the confirmation of minting, burning, and cross-chain requests. It operates under a role-based access control system to ensure secure and efficient processing of these operations.

## Key Features

### **Role-Based Access Control**

Utilizes specific roles for minting, burning, and cross-chain operations to ensure only authorized entities can perform these actions.

* `MINT_ROLE`: Responsible for confirming minting requests.
* `BURN_ROLE`: Responsible for confirming burning requests.
* `CROSSCHAIN_ROLE`: Responsible for confirming cross-chain requests.

### **Bridge Integration**

The `FBTCMinter` interacts with the `FireBridge` contract to execute its functions, ensuring seamless integration within the FBTC ecosystem.

## High-level Workflow

The `FBTCMinter` contract works closely with the `FireBridge` contract to ensure secure and efficient confirmation of minting, burning, and cross-chain requests. Below is a detailed workflow for each operation:

### Minting Workflow

1. **Minting Request Initiation**:
   * A merchant initiates a minting request via the `FireBridge` contract.
   * The `FireBridge` contract validates the request and records it.
2. **Confirmation by FBTCMinter**:
   * An entity with the `MINT_ROLE` calls the `confirmMintRequest` function on the `FBTCMinter` contract.
   * `FBTCMinter` forwards the confirmation to the `FireBridge` contract by calling its `confirmMintRequest` function.
   * The `FireBridge` contract processes the request and mints the appropriate amount of FBTC tokens.

### Burning Workflow

1. **Burning Request Initiation**:
   * A merchant initiates a burning request via the `FireBridge` contract.
   * The `FireBridge` contract validates the request and records it.
2. **Confirmation by FBTCMinter**:
   * An entity with the `BURN_ROLE` calls the `confirmBurnRequest` function on the `FBTCMinter` contract, providing the request hash, withdrawal transaction ID, and output index.
   * `FBTCMinter` forwards the confirmation to the `FireBridge` contract by calling its `confirmBurnRequest` function.
   * The `FireBridge` contract processes the request and burns the appropriate amount of FBTC tokens.

### Cross-Chain Workflow

1. **Cross-Chain Request Initiation**:
   * A merchant initiates a cross-chain request via the `FireBridge` contract.
   * The `FireBridge` contract validates the request and records it.
2. **Confirmation by FBTCMinter**:
   * An entity with the `CROSSCHAIN_ROLE` calls the `confirmCrosschainRequest` function on the `FBTCMinter` contract, providing the request details.
   * `FBTCMinter` forwards the confirmation to the `FireBridge` contract by calling its `confirmCrosschainRequest` function.
   * The `FireBridge` contract processes the request and initiates the cross-chain transfer.

### Batch Confirmation Workflow

1. **Batch Cross-Chain Request Initiation**:
   * Multiple cross-chain requests are initiated and recorded by the `FireBridge` contract.
2. **Batch Confirmation by FBTCMinter**:
   * An entity with the `CROSSCHAIN_ROLE` calls the `batchConfirmCrosschainRequest` function on the `FBTCMinter` contract, providing an array of requests.
   * `FBTCMinter` iterates through the array and forwards each request confirmation to the `FireBridge` contract.
   * The `FireBridge` contract processes each request and initiates the respective cross-chain transfers.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fbtc.com/system-components/onchain-smart-contracts/fbtc-minter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
