Bitcoin Transaction Fees
Last updated
Last updated
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:
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:
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.
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:
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.