Author: Luke Dashjr 2016-07-20 06:17:39
Published on: 2016-07-20T06:17:39+00:00
In a message sent to the Bitcoin development mailing list on July 20th, 2016, developer Peter Todd discussed issues with Hash Time-Locked Contracts (HTLCs). Sean Bowe had requested feedback regarding HTLC transactions in Bitcoin. HTLC transactions allow for payment of the preimage of a hash and CSV/CLTV can be used to recover funds if the other party is not cooperative. These scripts are structured with a [HASHOP] OP_EQUAL followed by an OP_IF and an OP_ELSE with a [TIMEOUTOP] OP_DROP in between. Ultimately, the script ends with an OP_CHECKSIG. Todd notes that these scripts are malleable, as the top stack item can be changed in the digest-not-provided case and the script still passes. Additionally, Todd suggests using the OP_SIZE opcode as a way to make it difficult for attackers to manipulate the transaction. This would involve adding an extra conditional requirement to the script: OP_SIZE OP_2 OP_PICK OP_HASH160 [PUBKEYHASH] OP_EQUALVERIFY. Todd also highlights the importance of taking into account different scenarios, such as a malicious party attempting to execute a double-spend attack. The discussion presents a thorough examination of the potential vulnerabilities of HTLC transactions and offers suggestions for improving their security.
Updated on: 2023-06-11T19:09:33.528873+00:00