<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gunar</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gunar"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Gunar"/>
	<updated>2026-05-04T11:41:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Hash_Time_Locked_Contracts&amp;diff=63977</id>
		<title>Hash Time Locked Contracts</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Hash_Time_Locked_Contracts&amp;diff=63977"/>
		<updated>2017-09-26T21:20:23Z</updated>

		<summary type="html">&lt;p&gt;Gunar: Fix: Bob -&amp;gt; Charlie&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;Hashed TimeLock Contract&#039;&#039;&#039; or &#039;&#039;&#039;HTLC&#039;&#039;&#039; is a class of payments that use [[hashlock]]s and [[timelock]]s to require that the receiver of a payment either acknowledge receiving the payment prior to a deadline by generating cryptographic proof of payment or forfeit the ability to claim the payment, returning it to the payer.&amp;lt;ref name=&amp;quot;russell_htlc&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cryptographic proof of payment the receiver generates can then be used to trigger other actions in other payments, making HTLCs a powerful technique for producing&lt;br /&gt;
conditional payments in Bitcoin.&lt;br /&gt;
&lt;br /&gt;
== HTLCs in cross-chain atomic swaps ==&lt;br /&gt;
&lt;br /&gt;
[[Atomic cross-chain trading]] allows some amount of one cryptocurrency (such as bitcoin on [[mainnet]]) to be traded for some amount of cryptocurrency on another block chain (such as bitcoin on a [[sidechain]]).&lt;br /&gt;
&lt;br /&gt;
Descriptions of cross-chain atomic swaps are probably the origin of the technique now called HTLCs.{{citation needed}}&lt;br /&gt;
&lt;br /&gt;
== HTLCs in payment channels ==&lt;br /&gt;
&lt;br /&gt;
[[Payment channels]] already use timelocks, and it can be relatively simple conceptually to extend them with hashlocks.  This provides the useful benefit of making payments routable across two or more payment channels.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
# Alice opens a payment channel to Bob, and Bob opens a payment channel to Charlie.  &lt;br /&gt;
# Alice wants to buy something from Charlie for 1000 satoshis.&lt;br /&gt;
# Charlie generates a random number and generates its SHA256 hash.  Charlie gives that hash to Alice.&lt;br /&gt;
# Alice uses her payment channel to Bob to pay him 1,000 satoshis, but she adds the hash Charlie gave her to the payment along with an extra condition: in order for Bob to claim the payment, he has to provide the data which was used to produce that hash.&lt;br /&gt;
# Bob uses his payment channel to Charlie to pay Charlie 1,000 satoshis, and Bob adds a copy of the same condition that Alice put on the payment she gave Bob.&lt;br /&gt;
# Charlie has the original data that was used to produce the hash (called a pre-image), so Charlie can use it to finalize his payment and fully receive the payment from Bob.  By doing so, Charlie necessarily makes the pre-image available to Bob.&lt;br /&gt;
# Bob uses the pre-image to finalize his payment from Alice&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;russell_htlc&amp;quot;&amp;gt;[https://rusty.ozlabs.org/?p=462 Lightning Networks Part II: Hashed Timelock Contracts (HTLCs)]&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gunar</name></author>
	</entry>
</feed>