Skip to main content

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
0 votes
1 answer
34 views

Can You Create a Time-Locked PSBT in Bitcoin?

I am exploring the capabilities of Partially Signed Bitcoin Transactions (PSBTs) and am particularly interested in incorporating time locks. Is it possible to create a PSBT that includes a time lock ...
Nerses Asaturyan's user avatar
1 vote
1 answer
51 views

Implementing Conditional Fund Locking in Bitcoin Similar to Ethereum's Smart Contracts

I'm familiar with how Ethereum allows users to lock funds in smart contracts, which can then be released under specific conditions using mechanisms like the Hashed TimeLock Contract (HTLC) protocol. I'...
Nerses Asaturyan's user avatar
0 votes
1 answer
59 views

modified Hash Time Locked Contracts

I'm currently working on implementing a modified version of Hash Time Locked Contracts (HTLC) in Bitcoin and would greatly appreciate any guidance or best practices from the community. Objective: I ...
Nerses Asaturyan's user avatar
2 votes
1 answer
95 views

What happens if HTLC value is below dust limit

What happens if the HTLC value is less than the dust limit? Logic tells me that you cannot create an HTLC output because the transaction would be rarely propagated. How do you make multi-hop payments ...
polespinasa's user avatar
3 votes
1 answer
81 views

Why is my P2WSH OP_IF/NOTIF argument not minimal?

I have created an HTLC with the following Bitcoin script using bitcoinlib-js: const redeemScript = bitcoin.script.compile([ bitcoin.opcodes.OP_IF, bitcoin.opcodes.OP_SHA256, ...
Oscar Chambers's user avatar
0 votes
1 answer
76 views

Why does my PSBT's input script not have a pub key?

I have created a PSBT to sign an HTLC using a funded P2WSH, that I wish to sign with my xverse wallet. This is my decoded PSBT which I have created using bitcoin-cli o@OscarPC:~/bitcoin-htlc$ bitcoin-...
Oscar Chambers's user avatar
0 votes
0 answers
30 views

How to sign P2WSH PSBT with sats-connect?

I have created a funded P2WSH script, which is an HTLC. I now want to create a PSBT which will be signed by another wallet to withdraw the funds. The problem is that the PSBT signing is throwing the ...
Oscar Chambers's user avatar
1 vote
0 answers
18 views

Why does a single expired HTLC with an unresponsive peer cause automatic force closure of the whole channel?

As far as I understand: the expiration of a single HTLC in a payment channel with an unresponsive partner causes the whole payment channel to force close (Behaviour A). This has been discussed, for ...
user141713's user avatar
2 votes
2 answers
58 views

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

How to make spending conditions of a UTXO in Bitcoin such that before a particular timestamp, say t, it can be spent only in one way and, after t, it can be spent only in another way.
Kirti Singh's user avatar
2 votes
0 answers
62 views

What determines how long a HOLD invoice will be held before it times out and is forced on chain?

How long can a HOLD invoice be held before it times out and is forced on chain? Is there a way for the receiver to define a minimum timeout requirement in the invoice in order for it to be ...
user1748155's user avatar
0 votes
1 answer
81 views

What are the default timelocks in Lightning implementations today? How are they negotiated on channel opening?

There are two timelocks in Lightning that both channel counterparties must agree to if a channel is going to be opened between them. These are (from BOLT5) to_self_delay (a CSV relative timelock) ...
Michael Folkson's user avatar
3 votes
0 answers
41 views

Timelocked bribing

Did anyone observe any instance of Timelocked Bribing in Bitcoin transaction? Are there any specific articles that points out that the attack has been mounted in reality?
Subhra Mazumdar's user avatar
3 votes
1 answer
99 views

Do any browser wallets support custom bitcoin scripts?

I am creating an atomic swap interface between Bitcoin and EVM using hashed timelock contracts as the underlying swapping mechanism. The idea is to support atomic swaps via the browser, using browser-...
Oscar Chambers's user avatar
1 vote
0 answers
27 views

Can Pending HTLC's drop my balance?

I just noticed that 2 million sat's disappeared from my balance in thunderhub. No payments or transactions have been made. Can pending HTLC's effect my balance? If Not what else could drop my balance ...
Ryan's user avatar
  • 11
2 votes
1 answer
113 views

Is a channel's 'max_htlc_msat' setting only for outbound HTLCs, or for both sides?

I'm currently setting max_htlc_msat value of my channels to a value similar to their curent local balance, in order to get hints about the max it can curently route (outbound). Indeed, this made ...
bartoli's user avatar
  • 43
5 votes
1 answer
225 views

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

When I input the following miniscript into https://bitcoin.sipa.be/miniscript/: and(pk(claimant_pk),sha256(H)) I get the following Script: <claimant_pk> OP_CHECKSIGVERIFY OP_SIZE <20> ...
Sachin Meier's user avatar
0 votes
0 answers
61 views

What made the HTLCs pending here?

So today, i had 4 pending HTLCs to 2 nodes. The first 2 expired (i think i still had a connection to the peer), and the channel is now in force close state. The last 2 are still pending until expiry ...
bartoli's user avatar
  • 43
0 votes
1 answer
61 views

HTLC routing issues in custom LN plugin (c-lightning) on regtest network

I am working on a custom routing plugin for CLN on a regtest network. My goal is to compare its performance against the classical rebalancing plugin provided by the CLN community. Now I am trying to ...
dancingsushi's user avatar
2 votes
1 answer
66 views

How to check the last commited transaction in c-lightning?

Playing with c-lightning on regtest I would like to see the last valid transaction for a channel. The closest related developer command I found to do that was dev-sign-last-tx. It seems to produce ...
Lagrang3's user avatar
  • 130
0 votes
2 answers
85 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
  • 653
3 votes
2 answers
325 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
  • 41
4 votes
1 answer
301 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
2 votes
1 answer
115 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
4 votes
2 answers
109 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
1 vote
0 answers
31 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
4 votes
2 answers
687 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
1 vote
1 answer
33 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
3 votes
1 answer
97 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 ...
oz21m's user avatar
  • 107
3 votes
1 answer
85 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
  • 958
0 votes
1 answer
77 views

What prevent users from cheating in an HTLC contract

I was reading about HTLC and how Charlie have to create a random number and generates its SHA256 hash that is supposed to be used by Bob in the end to finalize the payment he has received from Alice. ...
Saxtheowl's user avatar
  • 2,810
1 vote
1 answer
92 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
  • 137
5 votes
1 answer
463 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
  • 452
0 votes
1 answer
35 views

Lightning protocol modification for app

I'm currently building a Lightning platform for online sellers. I have found that timing can be very problematic: For example, two people want to buy the last item in stock or a unique item like a ...
Olympus's user avatar
  • 13
3 votes
1 answer
196 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
117 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
2 votes
1 answer
173 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
  • 23
1 vote
1 answer
77 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
252 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
8 votes
2 answers
250 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
  • 76.1k
9 votes
1 answer
480 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
  • 76.1k
1 vote
2 answers
110 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 ...
tdMJN6B2JtUe's user avatar
1 vote
1 answer
262 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,798
3 votes
1 answer
78 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,798
0 votes
1 answer
199 views

Atomicity on HTLC payment chain

I have a doubt about HTLC on a lightning network payment. I have this scenario: Alice wants to pay 100 sats to David using a route she found with Bob and Chad, this would be: Alice -> Bob -> ...
Grunch's user avatar
  • 1
0 votes
1 answer
138 views

Why, how, and when should an intermediate LN node terminate/resolve its HTLC(s) off-chain?

I once heard an attack against LN, which was called "flood & loot": https://medium.com/blockchains-huji/flood-loot-a-systemic-attack-on-the-lightning-network-5c3dac7bba24 The 3rd step of ...
Chris Chen's user avatar
1 vote
1 answer
59 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
4 votes
1 answer
86 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
  • 76.1k
0 votes
0 answers
78 views

Time locked puzzle for payment in Lightning Network

Currently HTLC's timeout transaction relies on absolute timelock enforced on the script. It allows a counterparty to withdraw the money from the contract if the other party doesn't release the ...
Subhra Mazumdar's user avatar
3 votes
1 answer
69 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
0 votes
1 answer
61 views

Simulate HTLC in regtest c-lightning

I have three nodes in regtest environment l1, l2, and l3 l1 create a channel with l2 l2 create a channel with l3 l3 create an invoice for l1. l1 can pays it because use the route l1-l2-l3 I presume ...
monkeyUser's user avatar