# Peg-out Timing and Optimizations

During the peg-out process in TON Teleport BTC, certain nuances related to the speed and cost of transactions arise. Since each UTXO in Bitcoin requires a separate signature, transactions with multiple inputs can become significantly more expensive. This is because the size of the transaction in the Bitcoin blockchain directly affects the fee: the more data that needs to be included in a transaction, the higher its cost.

To address this issue, TON Teleport BTC implements a peg-out aggregation mechanism. Instead of executing peg-outs individually, they are collected and conducted in a single transaction once every predefined period—typically every two hours. This approach allows for combining multiple withdrawal operations into one transaction, significantly reducing the total fee.

Rather than creating a separate output for each burn, the system forms a single transaction that includes outputs corresponding to each withdrawal request, plus an additional output that returns to the system’s ”bank.” This reduces the amount of data required, and consequently, the transaction fee.

While the aggregation of peg-outs saves on fees, it also affects the speed of transactions. Users have to wait for the withdrawal window, which occurs every two hours, potentially delaying access to funds compared to immediate transaction execution. However, this trade-off between cost and wait time is typically acceptable to most users, given the significant savings on fees.

Despite the advantages of aggregated peg-outs, users are not strictly bound by the predefined withdrawal intervals. If a user prefers not to wait, they can initiate an early withdrawal at any time. In this case, the withdrawal transaction will be processed immediately, but the Bitcoin network fee will be higher due to the lack of aggregation benefits. This option provides flexibility for users who prioritize speed over cost.

The integration of the peg-out aggregation mechanism in TON Teleport BTC represents a thoughtful solution that optimizes both the cost and speed of fund withdrawals. This makes the system more efficient and economically advantageous for users seeking maximum efficiency and minimal costs in cryptocurrency operations.
