Questions tagged [hash-time-locked-contract]

A Hash Time Locked Contract (HTLC) is a conditional payment that requires the recipient to reveal a hash preimage. It also includes a time lock clause that allows the payment to be refunded after a certain time. HTLCs are used in Lightning Network channels, atomic swaps and other protocols.

Filter by
Sorted by
Tagged with
11 votes
3 answers
2k views

"HTLCs don't work for micropayments"?

I read this tweet by Tadge Dryja recently. What exactly did he mean? Is this an issue? If so, is this issue fixable?
Chris Chen's user avatar
10 votes
1 answer
2k views

How is a node in the middle prohibited from keeping the money in a routed Payment in Lightning network?

It is my understanding that Lightning is to scale with users having only few payment channels by leveraging the six degrees of separation theory to facilitate payment routing. I understand how onion ...
Murch's user avatar
  • 69.7k
9 votes
1 answer
443 views

Can PTLCs and HTLCs be mixed along a route?

When PTLCs get introduced on the Lightning Network, do all hops along a route need to use just one of either HTLCs or PTLCs, or would it be possible to create a route where some nodes use PTLCs and ...
Murch's user avatar
  • 69.7k
8 votes
1 answer
3k views

What is a hash pre-image as it is used for the breach remedy?

Until this afternoon I thought the anti-cheat transactions or breach remedies built on the exit-transaction of the counterparty. Apparently, they build on something called a "hash pre-image". What is ...
Murch's user avatar
  • 69.7k
7 votes
2 answers
2k views

HTLC (Hash Time Lock Contract) using bitcoin-qt

Is it possible to manually create a HTLC using the bitcoin-qt command line? I know how to manually creating createrawtransaction/sendrawtransaction using the bitcoin-qt clients command line, and ...
oshirowanen's user avatar
7 votes
2 answers
230 views

What does the abbreviation "HTLC" stand for?

An HTLC is a contract making use of both a hashlock and a timelock. I noticed a discrepancy in what various sources state the abbreviation HTLC is short for. I've found: "Hashed Timelock ...
Murch's user avatar
  • 69.7k
5 votes
1 answer
342 views

Unilateral close because of HTLC in remote commitment

I run lnd on my node and sometimes see messages like this: [INF] CNCT: ChannelArbitrator(CHANPOINT): immediately failing htlc=HTLCID from remote commitment The corresponding close transaction sent ...
C-Otto's user avatar
  • 335
4 votes
2 answers
955 views

Single-hop Payment vs Multi-hop payments

I am beginner of lightning network. When i am looking roughly lightning network whitepaper, i was confused about the types of contracts used in single-hop and multi-hop. As far as I understand, In ...
Hoonki's user avatar
  • 43
4 votes
2 answers
384 views

Why do we need revocation in both the offered/received HTLC outputs and HTLC timeout/success outputs?

The witness script for the output in the HTLC success/timeout transaction is: OP_IF # Penalty transaction <revocationpubkey> OP_ELSE `to_self_delay` OP_CHECKSEQUENCEVERIFY ...
yyforyongyu's user avatar
4 votes
1 answer
351 views

Lightning: why do we need decrementing timelocks in multi-hop payments?

The video (at 28:25) from the official Lightning website describes a multi-hop payment. I understand what a hash-locked contract is, but I still don't understand why we need a timelock aspect here. As ...
Sergei Tikhomirov's user avatar
4 votes
1 answer
34 views

Is there anyway to find a lighting payment request preimage after it is paid if you aren’t the sending or receiving node?

From what I understand, the preimage is publicly revealed when the lightning payment request is paid as a part of the transaction. Is there any way to find that transaction and therefore the preimage ...
cool171's user avatar
  • 41
4 votes
1 answer
71 views

What is "Link-Level Multiplexing"?

In a discussion about private channels, Conner Fromknecht mentioned a concept called Link-Level Multiplexing. What is this and what is it useful for? How does it work?
Murch's user avatar
  • 69.7k
4 votes
2 answers
83 views

Using multiple penalty transactions to increase max HTLCs per LN channel

BOLT#2 states the below as one rationale to limit a Lighting Network channel to 483 HTLCs: It also ensures that a single penalty transaction can spend the entire commitment transaction, as calculated ...
stickies-v's user avatar
3 votes
1 answer
54 views

What is involved in the "database compaction" of a LND node?

As lightning network channels route payments, channel updates require the 2 channel peers (Alice & Bob) to do a round of signing and trade commitment transactions for the most up-to-date channel ...
otech47's user avatar
  • 75
3 votes
1 answer
388 views

Why does every HTLC in a commitment transaction require its own signature?

From BOLT 02 we can learn When a node has changes for the remote commitment, it can apply them, sign the resulting transaction (as defined in BOLT #3), and send a commitment_signed message. 1. type: ...
Rene Pickhardt's user avatar
3 votes
1 answer
112 views

In which cases could I find funds locked in a failed route?

I received an invoice from node Z and my node (A) suggests me 4 possible routes. If the first two routes fail, are there cases in which funds can get stuck in one of these routes until the HTLC ...
Gabriele Domenichini's user avatar
3 votes
1 answer
54 views

What Lightning Network transaction information is usable to provide a verifiable public index of received payments?

I have in mind a protocol architecture that includes value transfer, where BTC is the unit of account. To make the protocol scalable I could specify use of the Lightning Network protocol. In this case,...
Lee's user avatar
  • 356
3 votes
2 answers
120 views

Why do multihop LN payments start settling from the recipient's end?

In HTLC, after all the parties have locked their funds in the contract, claiming payment happens in a reverse way, starting with the receiver who reveals the preimage of the corresponding payment hash....
Subhra Mazumdar's user avatar
3 votes
1 answer
109 views

Difference between capacity and max_htlc in Lightning Network?

What is the difference between capacity and max_htlc in the routing of payments in the network?
Jack's user avatar
  • 31
3 votes
1 answer
92 views

How would PTLC's change invoices?

I am wondering how would switching from HTLCs to PTLCs change invoices? I assume there would not be a payment-hash anymore, but what would replace it. A payment-point? Also, is there already support ...
PyrolitePancake's user avatar
3 votes
1 answer
66 views

Do BIP199's HTLCs suffer from script malleability?

Do BIP199 HTLCs suffer from sigscript malleability like multisigs do due to OP_CHECKMULTISIG?
arshbot's user avatar
  • 1,628
3 votes
1 answer
64 views

Lightning Network state deprecation secret keeping

When using a lightning channel, two sides are sending transactions representing the current state (or balance) between them, and for each state sent, they invalidate the previous state by sending a ...
user107511's user avatar
2 votes
1 answer
225 views

What happens if R is not revealed by one of Lightning Network nodes? (Payment cancelation)

Let's say we have route of 3 hops A -> B -> C -> D (A pays D). And in the middle of payment (revealing secret R stage) node C disappear from network. In this case B will be not able to finalise ...
Jaro's user avatar
  • 123
2 votes
1 answer
155 views

Signing taproot key-path transaction from rust-bitcoin

I'm trying to make a taproot HTLC using rust-bitcoin for an atomic swap protocol. My plan is that in the "happy case" of my protocol, the coins are spent with the key-path, and then there is ...
rijndael's user avatar
2 votes
1 answer
164 views

Who bears the transaction fee for settling HTLC in Lightning Network?

Given a channel that exist between Alice and Bob, where Alice wants to transfer 0.0001 BTC to Bob. Alice makes HTLC payment to Bob contingent to the secret for the payment hash within a timelock of ...
Subhra Mazumdar's user avatar
2 votes
1 answer
190 views

Possible race condition(double spend) on HTLC-Timeout in the lightning network?

From the offered HTLC Outputs, # To remote node with revocation key OP_DUP OP_HASH160 <RIPEMD160(SHA256(revocationpubkey))> OP_EQUAL OP_IF OP_CHECKSIG OP_ELSE <remote_htlcpubkey> ...
yyforyongyu's user avatar
2 votes
2 answers
777 views

Why do we use CLTV instead of CSV in the HTLC output of the commitment transaction?

In lightning network commitment transactions, the HTLC offered/received outputs generally pay the offering node after a timeout which is scripted using CLTV. In other parts of the commitment ...
Ugam Kamat's user avatar
  • 7,203
2 votes
1 answer
180 views

What is the relation between a Hash Time Lock Contract(HTLC) and a Commitment transaction?

I want to know about what happens to the commitment transactions as the HTLC's are sent and cleared along to peers in a route.
sk_58's user avatar
  • 45
2 votes
1 answer
489 views

Basic questions about lightning network HTLC

I'm reading about lightning and I have a few questions: The HTLC contract seems to be different at each new path payment channel is opened (due to a different Hash value that needs to be provided), ...
user1387682's user avatar
2 votes
1 answer
41 views

Script for Success of HTLC in the Lightning Network

BOLT #3 specifies that an HTLC success transaction (the second-stage transaction that spends an HTLC by providing the preimage) has the witness script 0 <remotehtlcsig> <localhtlcsig> <...
matthias's user avatar
  • 125
2 votes
1 answer
73 views

settling timelocked contracts based on amount of time elapsed in Lightning network

Suppose in a payment route A->B->C, A desires to pay 0.01 BTC to C. It locks in 0.01 BTC with B in the HTLC having timeout period of say 2 days and B locks 0.01 BTC with C in HTLC having timeout ...
Subhra Mazumdar's user avatar
2 votes
1 answer
204 views

Remote node signature for HTLC-success and HTLC-timeout transactions

According to BOLT #3, when constructing a HTLC output in the version of the local node (both received and offered HTLC), it requires that the payment to the local node is locked with CHECKMULTISIG ...
Ugam Kamat's user avatar
  • 7,203
2 votes
1 answer
598 views

Lightning Network: hashlocks vs private keys exchange

I am reading the Lightning Network paper and noticed that when describing bidirectional payment channels, the authors used "Breach Remedy transactions" and the exchange of the two parties' private ...
Simone Bronzini's user avatar
2 votes
1 answer
62 views

Automatic force closure and on chain settlement of expired HTLC

After roughly a month of mostly smooth operation a lightning node (LND 0.16.2-beta) automatically initiated a force closure of a channel. Two days later an expired HTLC was settled on-chain. In both ...
Andreas's user avatar
  • 21
2 votes
1 answer
173 views

HTLCs and commitment transactions

Why commitment transactions can't simply be HTLCs instead of contracts revocable by having the second half of the Revocable Private Key? I mean, why bother to create a Revocable Public Key from two ...
spacemonkey's user avatar
1 vote
2 answers
91 views

What would happen to Bitcoin if GPS/Galileo timing ceased to be available?

According to this web site, the timing from a system like GPS is essential to "financial networks [which] rely on precision timing for synchronization and operational efficiency." Is the ...
brethvoice's user avatar
1 vote
1 answer
168 views

Taproot PTLC: Non-Multisig partly timelocked spending conditions

(Taproot environment) What I came up with is the following logic: $alice = A; $bob = B; pk($bob) || (pk($alice) && older(10)) (See on Minsc). I looked at the generated / resulting Bitcoin ...
ByteFlowr's user avatar
  • 133
1 vote
2 answers
364 views

Can someone explain how an HTLC is redeemed?

I'm looking at Bolt 3 in the Lightning rfc. My question is about how a HTLC is redeemed. Example HTLC script for reference: # To remote node with revocation key OP_DUP OP_HASH160 <RIPEMD160(SHA256(...
Darius's user avatar
  • 779
1 vote
1 answer
75 views

Security implications of removing CHECKSIG in a test

If I conduct an htlc transaction on testnet that does not include OP_CHECKSIG will it still cost an attacker more than (say) $10 in processing power or storage to subvert my tests? Details: I'm ...
Alistair Mann's user avatar
1 vote
1 answer
55 views

Decode script return different value from my relative timelock

I want to lock a UTXO for 90 days. My Binary is: 00000000010000000011101101010011 And my sequence is: 533B40 When I decode the witness script with bitcoin-cli decodescript I can see 4209491. Where ...
monkeyUser's user avatar
1 vote
1 answer
24 views

LN-Channel: Do I have to use new private keys for each HTLCs out of security?

I have a question regarding the security of HTLCs in a LN-channel. In a LN-transaction with multiple HTLCs (routings) to the destination one is using the signature of each node provider so that the ...
Robee's user avatar
  • 11
1 vote
1 answer
78 views

Can eltoo's no-penalty design be exploited by malicious submissions of old state?

Eltoo uses the no-penalty submission mechanism, where the cost for an adversary to submit an old state is the transaction fee. This action seems unprofitable, but if we add HTLC to Eltoo, things seem ...
sphpmp's user avatar
  • 127
1 vote
1 answer
60 views

Is it possible to run a Lightning Network node with multiple entities holding parts of the private key?

What's the technical limitation stopping multiple entities from collectively managing an LN node? I understand all parties (entities that share the Node private key) need to be online to sign routing/...
pseudozach's user avatar
1 vote
1 answer
209 views

how many htlcs can a lightning channel have pending at a given time

Channels can have pending HTLCs, or even handle multiple payments concurrently. Is there a max number of pending HTLCs a channel can entertain? What is that max, why is it set to that number, and what ...
arshbot's user avatar
  • 1,628
1 vote
1 answer
323 views

Reuse of payment hash in Lightning Network

Suppose there exist two such payment transfer request: A transfers 1 msat to R via A->B->C->R and S transfers 5 msat to R via S->B->C->R. Let the two HTLCs be formed across both the paths ...
Subhra Mazumdar's user avatar
1 vote
1 answer
85 views

Do HTLCs get "carried over" in the subsequent commitment transactions?

With regular commitment transactions, current transaction invalidates the previous one. This is fine, since TXs between A and B in their channel happen one after another. However, HTLCs are sort of ...
spacemonkey's user avatar
1 vote
1 answer
201 views

Do HTLC transactions work today or do they need a new soft-fork?

I thought that HTLCs were just a kind of a script construct that would allow to unlock funds for a period of time, which can be unlocked to anyone that provides the original string that matches the ...
knocte's user avatar
  • 1,756
1 vote
0 answers
22 views

Opportunity cost of coins locked in HTLC

If a party agrees to lock coins in HTLC for payment (having hashlock for time T), and it receives a fee f if the HTLC succeeds, then does it mean that the opportunity cost of coins locked in HTLC is f?...
Subhra Mazumdar's user avatar
0 votes
2 answers
47 views

In the Lightning Network, what risks if any are associated with allowing a remote node to be offline for too long?

In a given lightning channel what are the risks of allowing the remote node to be offline for an extended period of time? The obvious being the funds in the channel would be inaccessible, but if we ...
Poseidon's user avatar
  • 438
0 votes
1 answer
96 views

UNIX END TIME January 19, 2038 - Will it affect Timelock nLOCKTIME smart contracts past that date?

So UNIX END TIME is January 19, 2038. What will happen then to the btc TX that looks at Unixtime for nLOCKTIME transactions? Will any Locktime transaction past that date, say to 2040 be an issue? Or ...
krogoth's user avatar