15 votes
Accepted

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

In the image below from Rusty Russell's Deployable Lightning paper, you can see a visualization of the commitment transactions and their outputs: For each payment in a channel, there are two ...
David A. Harding's user avatar
15 votes
Accepted

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

Lightning forwards payments using a construction called a "hashed timelock contract" (HTLC), which allows the payee to redeem the transaction if they know the preimage to a given hash, or allows the ...
Anthony Towns's user avatar
15 votes
Accepted

"HTLCs don't work for micropayments"?

It takes about 200 vbytes to spend from a Lightning Network (LN) Hashed Time-Locked Contract (HTLC) output used for routing a payment. At the default minimum feerate of 10 nBTC/vbyte, that makes it ...
David A. Harding's user avatar
8 votes

"HTLCs don't work for micropayments"?

A very low value output in Bitcoin (or any similar system) has zero actual value because the cost in fees to spend it would be equal to or greater than the coins it provides. Like someone writing you ...
G. Maxwell's user avatar
  • 7,696
6 votes
Accepted

Single-hop Payment vs Multi-hop payments

First of all at this point in time the whitepaper is pretty outdated and should only be considered as a rough conceptual guide. The Lightning Network Protocol itself is better and more accurately ...
Rene Pickhardt's user avatar
6 votes
Accepted

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

The situation is less worse than you seem to assume. If node C disappears the channel A,B won't be affected. Also there is no direct need to affect the channel B, C and C, D. So most channels will ...
Rene Pickhardt's user avatar
6 votes

HTLC (Hash Time Lock Contract) using bitcoin-qt

The HTLC isn't really a specific type of bitcoin transaction, it is more a specific output script with the required spend conditions. Thus to make an HTLC, you really need to create a custom script ...
meshcollider's user avatar
  • 11.8k
6 votes
Accepted

Why does Miniscript add an extra size check for hash preimage comparisons?

This is to avoid a preimage too large to be claimed by one of the parties in a contract. For instance without this check it would be possible to create a Lightning HTLC that is only claimable by a ...
Antoine Poinsot's user avatar
5 votes
Accepted

Signing taproot key-path transaction from rust-bitcoin

It looks like you're using the Transaction::signature_hash method to compute your signature hash -- this is used to compute legacy (pre-segwit!) signature hashes, and we've been unfortunately very ...
Andrew Poelstra's user avatar
4 votes
Accepted

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

I use the following scenario for both questions: Alice wants to pay 1 BTC to Dave via the route: Alice -> Bob -> Carol -> Dave Why do we need timelocks? Lets assume that the payment route has just ...
Thomas Braunberger's user avatar
4 votes
Accepted

HTLC (Hash Time Lock Contract) using bitcoin-qt

I haven’t played the whole HTLC thing through, but was starting easy: try to create a redeem script, and the condition shall be, that a hash is checked with „equal verify“. Only play on testnet/...
pebwindkraft's user avatar
  • 5,086
4 votes

"HTLCs don't work for micropayments"?

An htlc is a small output in the commitment transaction. As with any output it needs to be bigger than the dust limit. In particular if the amount is smaller than the expected on chain transaction ...
Rene Pickhardt's user avatar
4 votes

Single-hop Payment vs Multi-hop payments

One reason to use HTLCs for single-hop payments in the Lightning Network would be to make them indistinguishable from multi-hop payments to the receiver. This way, the receiver does not know whether ...
Mark H's user avatar
  • 3,324
4 votes
Accepted

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

TL;DR answer: The fee for the HTLC is covered by whoever claims the output The fee for the commitment transaction are always covered by the party who opened the channel Sorry to say that but I ...
Rene Pickhardt's user avatar
4 votes

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

Bitcoin needs approximately sundial time accuracy to operate. Computers have their own free running clocks which provide more than enough accuracy in the absence of other references, and NTP sources ...
Claris's user avatar
  • 15.4k
4 votes
Accepted

Can PTLCs and HTLCs be mixed along a route?

My first instinct was to write that we don't know this as we don't know how the exact protocol for PTLCs looks like but then I realized that unless someone finds a cool trick it will probably be hard ...
Rene Pickhardt's user avatar
3 votes

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

First of all I think there seems to be a small confusion about the notation. One does not spend a transaction but transaction outputs. In the case of offered htlcs the output is only one (of ...
Rene Pickhardt's user avatar
3 votes

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

The funds in the respective HTLC's get stuck for a time-out period if the payment_pre-image doesn't propagate back along the route to your originating channel. There is no guarantee beforehand that ...
James C.'s user avatar
  • 2,501
3 votes
Accepted

Security implications of removing CHECKSIG in a test

The security implication of removing a checksig operation from the encumbrance script is that the coins can be stolen while in flight by anybody, and especially by miners. Obviously, on testnet, only ...
arubi's user avatar
  • 1,854
3 votes
Accepted

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

When a HTLC is created, a new commitment transaction is created. The HTLC is an additional output (script) in this new commitment transaction, in addition to the RSMC and “regular” outputs, and ...
James C.'s user avatar
  • 2,501
3 votes

Basic questions about lightning network HTLC

How is it possible? Does the HTLC is not written on the blockchain? In the Lightning Network, HTLCs are part of the commitment transactions which are not broadcast to the network. This means that the ...
Andrew Chow's user avatar
  • 68.5k
3 votes
Accepted

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

Why isn't the signature for the entire commitment transaction enough? Because the htlc_signature field contains the signature for the HTLC transactions spending from the htlc output(s) (either ...
Antoine Poinsot's user avatar
3 votes
Accepted

What does the abbreviation "HTLC" stand for?

Using "hashed" makes it sound like the contract itself is hashed. Because the contract uses a hash, but is not itself hashed, I would say the H should stand for "hash". Secondly, ...
meshcollider's user avatar
  • 11.8k
3 votes
Accepted

Taproot PTLC: Non-Multisig partly timelocked spending conditions

Yes, assuming James sends Bob two outputs with the following spending conditions: pk($bob) || (pk($alice) && older(10)) pk($bob) || (pk($carol) && older(10)) Bob can spend these ...
Murch's user avatar
  • 72.6k
3 votes
Accepted

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

The compaction is only relevant for bbolt database files, which are very common with lnd. In this case, the channel database is stored as a bbolt file named channel.db. Note that you can also use ...
C-Otto's user avatar
  • 375
2 votes
Accepted

Lightning Network: hashlocks vs private keys exchange

So the question is: are commitment transactions between two nodes revoked through hashlocks or through private keys exchange? Either way will work, but hashlocks are simpler. They're described in ...
Nick ODell's user avatar
  • 29.3k
2 votes
Accepted

How can I create HTLCs below dust_limit_satoshi in Lightning Network?

The dust limit is an externality to lightning wich the protocol has to respect. In fact if a commitment transaction would encode an htlc below the dustlimit you could not force close the channel as ...
Rene Pickhardt's user avatar
2 votes
Accepted

Can someone explain how an HTLC is redeemed?

There are three ways in which that offered HTLC output can be redeemed: Revocation using the revocation public key (the example you mentioned), redeemed using a valid payment preimage or back to the ...
Ugam Kamat's user avatar
  • 7,348
2 votes

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

TL;DR Because it would create a nasty dependency of the CLTV deltas over the CSV delay or a reduced security for HTLCs. Having the revocation path in the second-stage transaction allows to be able to ...
Antoine Poinsot's user avatar
2 votes

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

HTLCs have a different timeout (cltv_expiry) than the regular timeout that we use for penalty transactions (to_self_delay). That is the reason why we use a separate transaction stage (HTLC success/...
Ugam Kamat's user avatar
  • 7,348

Only top scored, non community-wiki answers of a minimum length are eligible