delvingbitcoin
Combined summary - Taxonomy of Transaction Fees in Smart Contracts
In the realm of Bitcoin transactions, developers are increasingly prioritizing compactness in their coding strategies as a response to rising transaction fees.
This shift places an emphasis on using endogenous fees within transactions and consolidating multiple operations into a single transaction with fewer occurrences of exogenous fees. The design of covenant constructions is therefore heavily influenced by economic considerations that demand efficiency and minimal on-chain footprint to manage the cost constraints imposed by higher fees.
The conversation touches upon different fee mechanisms employed in Bitcoin transactions, which are pivotal for mempool design and can enhance scaling solutions to better serve user needs. Endogenous fees refer to those originating from within the logical transaction itself, associated with single RBF transactions. These encompass regular wallet sends and non-anchor lightning network penalty channels and are noted for their space efficiency in a blockchain block. On the other hand, exogenous fees derive from sources external to the smart contract but remain within a singular Bitcoin transaction. This setup, often seen in SIGHASH_SINGLE | ANYONECANPAY
contexts, may necessitate additional inputs or outputs for fees, increasing complexity while maintaining transaction singularity.
CPFP scenarios where the parent transaction encompasses the fees without the need for parent input conflict resolution are also examined. This method is apt for situations where users cannot influence the parent transaction, exemplified by LN's symmetry settlement transactions and fee bumping in pre-anchor channels. Similarly, exogenous fees with CPFP might include outputs that are not immediately spendable due to locktimes or other constraints, characteristic of current LN anchor channels that require all fees to be exogenous.
The concept of Package RBF, which merges CPFP and package RBF, allows a child transaction to subsidize a parent's conflict. If smart contract outputs are unencumbered, it's possible to include endogenous fees, although current Bitcoin mempool infrastructure does not support this due to the necessity of evaluating full transaction packages. The Lightning Network stands to gain from this mechanism for commitment transactions paired with fee-bumping child transactions post-timelock expiration.
Moreover, not all smart contracts rely on parent-child arrangements; some utilize pre-signed or CheckTemplateVerify (CTV)-bound transaction trees. These structures can be categorized based on a range of criteria including relay potential, spendability of virtual UTXOs, and whether sibling eviction—distinct from v3-style—is needed to circumvent cluster limitations. For instance, a Timeout Tree may employ endogenous fees and be compatible with single transaction RBF channels. Should on-chain settlement become necessary, the structure could convert to endogenous fees with CPFP, tapping into package RBF in the event of sibling eviction or any ancestor input conflicts. It could also enable payment for a separate smart contract settled with exogenous fees if the initial contract fails.
This dialogue underscores the importance of understanding how wallets and smart contracts use various fee structures in Bitcoin transactions, particularly in light of the implications for mempool design, scaling solutions, and covenant construction under the pressures of increasing fees.