Skip to main content
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
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
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,727
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.9k
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,106
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,334
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
4 votes
Accepted

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

Timestamps in Bitcoin, including block timestamps and nLocktime values, are unsigned 32-bit. The last possible timestamp is Feb 7th 2106, at 06:28:15 UTC.
Pieter Wuille's user avatar
4 votes
Accepted

Why is my P2WSH OP_IF/NOTIF argument not minimal?

In SegWit (by standardness) and Taproot (by consensus), the arguments to OP_IF and OP_NOTIF must be minimal, i.e. be either the empty vector or the one-byte vector 01. Your transaction uses 00, which ...
Vojtěch Strnad'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

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 ...
Ava Chow's user avatar
  • 71.1k
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,521
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,864
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,521
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.9k
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
  • 76.1k
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
  • 452
3 votes

Can a spend before a timestamp condition be put on a Bitcoin UTXO?

You can do this by creating a P2WSH output with the following script: OP_IF <condition 1> OP_ELSE <timestamp> OP_CHECKLOCKTIMEVERIFY OP_DROP <condition 2> OP_ENDIF Then ...
Vojtěch Strnad's user avatar
3 votes
Accepted

What happens if HTLC value is below dust limit

Any output in a commitment transaction, not only HTLCs, may have a value below the dust limit. Any output whose value would be below the dust limit does not get created in the commitment transaction. ...
Antoine Poinsot's user avatar
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.4k
2 votes

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

As you have said yourself, CSV is relative to when the transaction appears in the blockchain, while CLTV is absolute. They just have different meanings, which are useful for different things: The ...
stefanwouldgo's user avatar

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