> For the complete documentation index, see [llms.txt](https://tgbtc.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tgbtc.gitbook.io/docs/whitepaper/key-concepts/additional-components-and-security-mechanisms/bitcoin-transaction-fees.md).

# Bitcoin Transaction Fees

Since the TON Teleport BTC is designed as a trustless system, it cannot rely on an external oracle to determine the current average transaction fee in the Bitcoin network. While the system is capable of monitoring Bitcoin blocks, calculating the average fee independently would require accessing and transmitting all Bitcoin transactions within each block. This would mean processing thousands of transactions per block, making it computationally expensive and impractical. Therefore, the system employs two concepts to optimize transaction fees: Child- Pays-For-Parent (CPFP) and a Progressive Fee Model (PFM).

In Bitcoin, every transaction is linked to a previous UTXO, which it references. If the initial transaction has an insufficient fee, and a subsequent transaction (its child) has a higher fee, miners are incentivized to mine both transactions together to collect the higher combined fee. This effectively raises the average fee for both transactions, increasing the likelihood that miners will include them in a block. The CPFP strategy leverages this behavior, allowing for efficient fee management without relying on external data.

In the context of TON Teleport BTC, each Bitcoin peg-out transaction is linked to a previous UTXO that was locked in the system’s bank. If a new peg-out transaction sets a higher fee than the previous one, the miner will be incentivized to process the previous transaction as well, even if its fee was initially lower. This dynamic naturally balances the fees and prevents long delays due to low initial fees. As a result, users benefit from a self-regulating mechanism that optimizes transaction inclusion without external intervention.

In addition to CPFP, the system implements a PFM that automatically adjusts transaction fees based on the number of peg-outs within a given frame. This ensures that transactions are processed efficiently, even as network conditions change. The PFM is defined by a base coefficient b, which serves as the minimum fee in satoshis per vByte. TON validators can adjust b to match the current average fee in the Bitcoin network, providing flexibility for varying conditions.

The progressive fee an increases linearly for the first few peg-outs and quadratically for subsequent peg-outs. The formula is defined as:

$$
a\_n = b + (n - 1) \cdot 2, \quad \text{for } n = 1, 2, 3, 4, 5
$$

$$
a\_n = a\_5 + (n - 5) \cdot 2, \quad \text{for } n \geq 6
$$

Where:

* aₙ — fee in satoshis per vByte for peg-out number n.
* b — base fee coefficient (e.g., 2 sat/vB).
* n — current peg-out transaction number.

Example of Fee Calculation:

$$
a\_1 = b = 2
$$

$$
a\_2 = 2 + (2 − 1) · 2 = 4
$$

$$
a\_3 = 2 + (3 − 1) · 2 = 6
$$

$$
a\_4 = 2 + (4 − 1) · 2 = 8
$$

$$
a\_5 = 2 + (5 − 1) · 2 = 10
$$

$$
a\_6 = 10 + (6 − 5)^2 = 11
$$

$$
a\_7 = 10 + (7 − 5)^2 = 14
$$

$$
a\_8 = 10 + (8 − 5)^2 = 19
$$

$$
a\_n = a\_5 + (n − 5)^2
$$

The progressive nature of the fee ensures that initial peg-outs are relatively inexpensive, while later peg-outs within the same period become progressively more costly. This discourages excessive peg-outs in quick succession and helps balance transaction flow.

The progressive fee model includes a maximum fee threshold am, which prevents fees from rising indefinitely. This ensures that fees remain within reasonable bounds, even during periods of high activity. Additionally, the system supports a self-regulating mechanism where the fee rate can decrease once a previously executed peg-out transaction is confirmed in the Bitcoin blockchain.&#x20;

Once a peg-out transaction is confirmed, any participant (usually a relayer) can submit the executed transaction and prove its inclusion in a Bitcoin block. The system tracks the highest fee peg-out within the current series and, upon confirmation, reduces the fee index n by one. This means that if the most expensive peg-out is confirmed, the subsequent peg-out will start from a lower

fee, automatically balancing fees over time.

The system also provides users with flexibility in managing their fees. Users have two options:

<figure><img src="/files/9CcbQhZ77ahnSlFEX4yy" alt=""><figcaption></figcaption></figure>

By combining CPFP and a PFM, the TON Teleport BTC system ensures that transactions are processed efficiently and fairly, without relying on centralized control or external data sources. This approach maintains the trustless nature of the system while optimizing transaction processing in the Bitcoin network.


---

# 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://tgbtc.gitbook.io/docs/whitepaper/key-concepts/additional-components-and-security-mechanisms/bitcoin-transaction-fees.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.
