bitcoin-dev

HTLC output aggregation as a mitigation for tx recycling, jamming, and on-chain efficiency (covenants)

HTLC output aggregation as a mitigation for tx recycling, jamming, and on-chain efficiency (covenants)

Original Postby Johan Torås Halseth

Posted on: December 21, 2023 13:34 UTC

The discussion revolves around the technical intricacies of a Hashed Time-Locked Contract (HTLC) in the realm of cryptocurrency transactions, particularly focusing on an off-chain double-spend scenario involving 1 BTC.

The email highlights that when Bob attempts to replace Alice's timeout transaction, he inadvertently discloses a preimage, thus allowing Alice to settle her incoming HTLC without any loss, while Bob incurs transaction fees. For Bob to gain from this situation, he would need to postpone Alice's transactions until her incoming HTLC's timelock expires, which is referred to as the CLTV delta blocks.

In such a case, Bob would have to pay nearly next block fees for each block during the delta period, assuming Alice is determined to have her transactions included in the block due to impending expiry of the timelocks on her incoming HTLCs. This strategy involves Bob burning the value of an HTLC for every replacement transaction he performs. However, this approach presents significant risks for Bob since Alice has the theoretical upper hand; she can claim all the expired HTLCs cost-effectively using simple transactions that don't require merkle paths or preimages. Moreover, Alice could be willing to allocate a substantial portion of the HTLC value, for example, up to 0.9 BTC out of a 1 BTC HTLC, towards transaction fees to ensure confirmation before the expiry, effectively outbidding Bob who cannot match this with smaller HTLCs. While Bob could force Alice into expending her funds in this manner, it is debatable whether such an action would be considered rational behavior from his perspective.