Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

How to exchange of Revocation preimage atomically ?

3 messages, Nov 24, 2015. Started by Nicolas Dorier.

Nicolas Dorier, Tadge Dryja, Rusty Russell

Permalink First message in the Wayback Machine

Nicolas Dorier permalink original

I am still learrning about Lightning Network, slowly but surely. As I was reviewing bip 112 ( https://github.com/btcdrak/bips/blob/bip112sync/bip-0112.mediawiki) I noticed that HLTC seems to have a potential attack.

When both parties want to revoke a commitment, they need to send one to another the revocation preimage. However, if not done atomically, Alice intentionally not send her revocation after receiving Bob's thus preventing Bob to withdraw his funds.

Am I missing something ?

The only way I see of fixing as is, is to require a third party expecting he does not collude, but this defeat the whole purpose.

Nicolas,

Tadge Dryja in reply to Nicolas Dorier permalink original

If I understand your question, it's that the both Alice and Bob must revoke their previous transaction states and share their revocations, but someone has to go first.

I don't think there's a good way to make this atomic (fair exchange schemes based on hash functions instead of signatures *sounds* sortof impossible, but who knows). But in practice there's not really an attack, in that every update of a channel state has an initiator.

All the payments are "push" payments; if Alice wants to allocate more to Bob, she initiates, and if Bob wants to allocate more to Alice, he initiates. With revocations, the user initiating the channel state change goes first.

In the case where Alice is sending more coin to Bob:

Alice signs new state, sends half signed tx to Bob. Bob signs new state, sends half signed tx to Alice. Alice revokes old state by sending preimage to Bob. Bob revokes old state by sending preimage to Alice. Done.

If Bob fails to perform the last step, the payment can be considered to not have gone through. But Bob doesn't have much motivation to fail there. He can leave the channel in an indeterminate state by failing to revoke with Alice, but that indeterminate state is worse for him than a fully determined state where he has more money.

TLDR It's not atomic so payer goes first.

Hope this helps! If not, let me know, say a bit more about what you think the attack would be.

-Tadge

On Mon, Nov 23, 2015 at 6:36 PM, Nicolas Dorier <nicolas.dorier at gmail.com> wrote:

Quoted text (23 lines)
> I am still learrning about Lightning Network, slowly but surely.
> As I was reviewing bip 112 (
> https://github.com/btcdrak/bips/blob/bip112sync/bip-0112.mediawiki) I
> noticed that HLTC seems to have a potential attack.
>
> When both parties want to revoke a commitment, they need to send one to
> another the revocation preimage.
> However, if not done atomically, Alice intentionally not send her
> revocation after receiving Bob's thus preventing Bob to withdraw his funds.
>
> Am I missing something ?
>
> The only way I see of fixing as is, is to require a third party expecting
> he does not collude, but this defeat the whole purpose.
>
> Nicolas,
>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
>
Rusty Russell in reply to Nicolas Dorier permalink original

Nicolas Dorier <nicolas.dorier at gmail.com> writes:

Quoted text (11 lines)
> I am still learrning about Lightning Network, slowly but surely.
> As I was reviewing bip 112 (
> https://github.com/btcdrak/bips/blob/bip112sync/bip-0112.mediawiki) I
> noticed that HLTC seems to have a potential attack.
>
> When both parties want to revoke a commitment, they need to send one to
> another the revocation preimage.
> However, if not done atomically, Alice intentionally not send her
> revocation after receiving Bob's thus preventing Bob to withdraw his funds.
>
> Am I missing something ?

The order is:

1. Exchange new commit tx signatures.
2. Exchange revocation of old commit tx.

If Alice doesn't do #2, Bob still has the new commit tx he can drop on the blockchain.

Cheers, Rusty.