lightning-dev

OP_Expire and Coinbase-Like Behavior: Making HTLCs Safer by Letting Transactions Expire Safely

OP_Expire and Coinbase-Like Behavior: Making HTLCs Safer by Letting Transactions Expire Safely

Original Postby Peter Todd

Posted on: November 4, 2023 07:26 UTC

The correspondence outlines a significant aspect of the OP_Expire proposal, emphasizing how it simplifies the handling of Hashed Time-Locked Contracts (HTLCs) within the Lightning Network.

The proposal eliminates the concern surrounding replacement cycling techniques because an HTLC's preimage branch becomes invalidated once the refund branch is available. This creates a binary outcome: either the recipient of the HTLC, like Carol, spends it with knowledge of the preimage before expiration, or the sender, Bob in this case, uses the refund option post-expiration.

The proposal ensures that if the preimage is spent, it will be recorded on the blockchain, allowing Bob to learn of it directly from the blockchain data. This mechanism negates the need for Lightning nodes to monitor mempools for preimages, as they are assured visibility of the preimage through the blockchain if it is used, provided they have access to current blockchain information.

Furthermore, the introduction of OP_Expire renders package relay or any related strategies inconsequential since it establishes a clear timeframe for action. Once the time window for spending the HTLC with the preimage closes, only the refund branch remains operable, thereby streamlining the process and reducing complexity. This enhancement to the protocol is expected to improve the security and efficiency of transactions within the Lightning Network. For more detailed insights on the proposal, Peter Todd can be reached at his email address, which can be found on his personal website, Peter Todd's Personal Website.