Fee-Based Spam Prevention For Lightning

Posted by JohnLaw

Jun 30, 2025/00:57 UTC

The process of charging a hold fee during transactions involves three distinct phases to ensure the availability of necessary funds. Initially, both the downstream and upstream nodes commit funds to cover the maximum possible hold fee by moving these funds into a burn output. This preparatory step secures the amount that will be needed to cover the hold fee once the actual charge is determined. The determination of the correct hold fee is made when the HTLC (Hash Time Locked Contract) resolves, either through fulfillment or failure, or when the HTLC's expiry is reached. At this point, both nodes adjust the channel state accordingly: they transfer the calculated hold fee from the burn output to the upstream node, while the remainder of the staked funds are returned to the downstream node.

The mechanism for calculating the hold fee involves pre-locking funds based on the maximum possible delay at a hop, with the maximum charge being a function of the rate at which the downstream node is charged and the duration of payment delay past the grace period until the HTLC's expiry. It's noteworthy that the hold fee reflects the cost of capital held up across all upstream nodes, not merely between direct transaction partners. This comprehensive approach to calculating fees ensures that the costs associated with the time value of money are fully accounted for in the transaction process.

Moreover, the calculation method for hold fees is designed to encapsulate the entire cost of capital while allowing for potential modifications to accommodate different transaction scenarios. For instance, adjustments could introduce fixed charges post-grace period delays or implement nonlinear functions for calculating fees based on delays, aiming to address the complexities of capital costs more accurately. Such adaptations could prove beneficial, especially considering emerging uses like Taproot Assets payments for stable coins, highlighting the protocol's flexibility in accommodating various transaction types and requirements. Lastly, it's noted that the allocation of slots and associated costs are covered by upfront fees paid by the sender, separating these charges from the hold fee calculations.

For a deeper understanding of the intricacies involved in hold fee calculation and collection, references are made to specific sections within a paper, underscoring the detailed analysis and considerations that underpin this aspect of transaction processing.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from authoritative bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiBitcoin Transcripts Review
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project?

Give Feedback