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.

Here are the steps from https://en.bitcoin.it/wiki/Hash_Time_Locked_Contracts

  1. Alice opens a payment channel to Bob, and Bob opens a payment channel to Charlie.
  2. Alice wants to buy something from Charlie for 1,000 satoshis.
  3. Charlie generates a random number and generates its SHA256 hash. Charlie gives that hash to Alice.
  4. 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.
  5. 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.
  6. 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.
  7. Bob uses the pre-image to finalize his payment from Alice

But what would happen if Bob and Charlie decided to cheat and at the step 4 just after Alice send the 1000 sats Charlie give to Bob the secret number that was supposed to be used in step 7 share the sats between them and then Bob said that Alice payment was wrong and she have to do it again or something else.

I suppose this kind of attack would not be worth because

  1. you have to wait for Alice to pick a cheating peer Bob and Charlie.
  2. the attack would not bring many benefit since lightning is not made for big payment.
  3. Bob and Charlie would become suspect and loose reputation in the network.

I was wondering if I was missing something here or this kind of attack can happen

1 Answer 1


The process of saying that the payment failed and having to redo it means that the channel is first updated to a state where Alice hadn't sent the 1000 sats. The money is not gone. So if Bob were to do that, then he would be the one that is out 1000 sats because Charlie can claim the HTLC to him.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.