Research/Bitcoin Dev Archive / lightning-dev list
Payment Re-routing
12 messages, Jun 27 to Jul 2, 2015. Started by Stephen Morse.
Rusty Russell (4), Kevin Greene (3), Stephen Morse (2), Nick ODell (2), Joseph Poon
Quick question on the security of the Lightning Network when rerouting payments.
Say A wants to make a payment to E, and they find a payment channel route through A->B->C->E. The payment is done in increments of 0.01 BTC until the full 1 BTC has been paid. However, part way through the payments, C becomes unresponsive. The contract has already been given to C that guarantees payment if C can produce the pre-image of a certain hash, and C does receive the pre-image from E. They do not share that pre-image with B, though. C must reveal the pre-image, either to B directly or on the blockchain, before B's contract times out, which guarantees B will receive payment.
But A has not paid the full amount to E yet when C became unresponsive. A wants to re-route her payment to avoid delays, so she re-routes the rest of the payments through A->B->D->E. A finishes the payments through this alternate route. But now, can't C reveal the pre-image to B, who then reveals it to A? Which, will effectively steal an extra 0.01 BTC from Alice and give it to E. (C and E could have been colluding to do this, splitting the profits).
Is there something that prevents this that I do not see yet, or is this just the risk one takes with payment re-routing?
Thanks! Stephen
Stephen <stephencalebmorse at gmail.com> writes:
Quoted text (1 line)
> Quick question on the security of the Lightning Network when rerouting payments.
Hi Stephen,
This is a good question!
Quoted text (3 lines)
> Say A wants to make a payment to E, and they find a payment channel route through A->B->C->E. The payment is done in increments of 0.01 BTC until the full 1 BTC has been paid. However, part way through the payments, C becomes unresponsive. The contract has already been given to C that guarantees payment if C can produce the pre-image of a certain hash, and C does receive the pre-image from E. They do not share that pre-image with B, though. C must reveal the pre-image, either to B directly or on the blockchain, before B's contract times out, which guarantees B will receive payment. > > But A has not paid the full amount to E yet when C became unresponsive. A wants to re-route her payment to avoid delays, so she re-routes the rest of the payments through A->B->D->E. A finishes the payments through this alternate route. But now, can't C reveal the pre-image to B, who then reveals it to A? Which, will effectively steal an extra 0.01 BTC from Alice and give it to E. (C and E could have been colluding to do this, splitting the profits).
Each of the messages needs a separate preimage.
The simplest method is for E to simply provide A with (say) 100 hashes to use as she wishes.
Though I think we can do better than this using crypto rather than hashes, in practice producing 100 preimages is pretty easy (hash a per-payment secret + counter).
Cheers, Rusty.
Rusty Russell <rusty at rustcorp.com.au> writes:
Quoted text (12 lines)
> Stephen <stephencalebmorse at gmail.com> writes: >> Quick question on the security of the Lightning Network when rerouting payments. > > Hi Stephen, > > This is a good question! > >> Say A wants to make a payment to E, and they find a payment channel route through A->B->C->E. The payment is done in increments of 0.01 BTC until the full 1 BTC has been paid. However, part way through the payments, C becomes unresponsive. The contract has already been given to C that guarantees payment if C can produce the pre-image of a certain hash, and C does receive the pre-image from E. They do not share that pre-image with B, though. C must reveal the pre-image, either to B directly or on the blockchain, before B's contract times out, which guarantees B will receive payment. >> >> But A has not paid the full amount to E yet when C became unresponsive. A wants to re-route her payment to avoid delays, so she re-routes the rest of the payments through A->B->D->E. A finishes the payments through this alternate route. But now, can't C reveal the pre-image to B, who then reveals it to A? Which, will effectively steal an extra 0.01 BTC from Alice and give it to E. (C and E could have been colluding to do this, splitting the profits). > > Each of the messages needs a separate preimage.
Oops, sorry. Scrap my dumb non-answer, I read your post properly now.
Yes, C can just get the preimage from E and collude to steal the funds, which is a nasty failure mode.
Delaying the entire payment is a poor option; can anyone see a better one?
Cheers, Rusty.
Hi Rusty,
On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au> wrote:
Quoted text (5 lines)
> > Yes, C can just get the preimage from E and collude to steal the funds, > which is a nasty failure mode. > >
This scenario may even happen non-maliciously, if C has an honest outage and attempts to pick up where it left off on each of its channels. To fix the non-malicious case, C could get a refund from E (a new signed transaction with a lower lock time), if C knows he has been offline for longer than B's willingness to wait before re-routing. But this isn't perfect, or even good, because E cannot know that C isn't just trying to get a refund even though they have taken the payment from B. In fact, C is guaranteed the payment from B, since they have the pre-image.
Quoted text (3 lines)
> Delaying the entire payment is a poor option; can anyone see a better > one? >
Like you say, delaying the payment seems like a bad way to go, as then the payments wouldn't be quite "Lightning" fast anymore. 99% of the payment could be re-routed though. Perhaps the 99% could be re-routed, while A waits for C to rejoin. Or if multiple paths are being used to process the payment, just redistribute the remaining payments allotted for the broken path among the other functioning paths.
The bigger problem here seems to be that the incentives are slightly skewed in favor of dishonestly. One can minimize the impact of that dishonesty by breaking the payment into smaller chunks and across diverse paths, but this comes at the cost of bandwidth and speed. Some sort of a rating system could come into play possibly, if nothing can be cryptographically worked out.
Best, Stephen
Stephen Morse <stephencalebmorse at gmail.com> writes:
Quoted text (10 lines)
> Hi Rusty, > > On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au> > wrote: > >> Yes, C can just get the preimage from E and collude to steal the funds, >> which is a nasty failure mode. >> > This scenario may even happen non-maliciously, if C has an honest outage > and attempts to pick up where it left off on each of its channels.
Indeed.
Off-list, Joseph Poon suggested a solution, which I urged him to post here. As he hasn't done so, I'll try to paraphrase.
So the basic problem is that A -> C -> E fails because C is unresponsive: A is waiting (say) 2 days before the HTLC to C times out.
Joseph's solution is that E can route a conditional refund back to A with a larger timeout (say 3 days) via some other route: this pays back the amount to A if they present the preimage for the initial stalled payment and another preimage A only has. This serves as a guarantee that E will not reveal the preimage required to take the stalled payment.
This raises other questions, such as who would pay E (and any other intermediate nodes) for locking up their money for such a time. Could A provide evidence that the route really had timed out? How many times can A claim "payment failed"? etc.
In general, how nodes get paid is an open question; I'll add this to the pile. One problem at a time though...
Cheers, Rusty.
Blargh. The dumb solution here is to just shrug and say that you have to trust these processors to be highly available, and never try to do re-routing. That's pretty much equivalent to what would happen if one of the banks in the visa network had networking issues for example.
The big difference here though is that visa will kick you out of the network if you're a bank that's consistently not meeting their strict SLA's, and that keeps the network honest. There is no such central processor though in this case to enforce the reputation of lightening nodes.
On Monday, June 29, 2015, Stephen Morse <stephencalebmorse at gmail.com> wrote:
Quoted text (41 lines)
> Hi Rusty, > > On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au > <javascript:_e(%7B%7D,'cvml','rusty at rustcorp.com.au');>> wrote: > >> >> Yes, C can just get the preimage from E and collude to steal the funds, >> which is a nasty failure mode. >> >> > This scenario may even happen non-maliciously, if C has an honest outage > and attempts to pick up where it left off on each of its channels. To fix > the non-malicious case, C could get a refund from E (a new signed > transaction with a lower lock time), if C knows he has been offline for > longer than B's willingness to wait before re-routing. But this isn't > perfect, or even good, because E cannot know that C isn't just trying to > get a refund even though they have taken the payment from B. In fact, C is > guaranteed the payment from B, since they have the pre-image. > > >> Delaying the entire payment is a poor option; can anyone see a better >> one? >> > > Like you say, delaying the payment seems like a bad way to go, as then the > payments wouldn't be quite "Lightning" fast anymore. 99% of the payment > could be re-routed though. Perhaps the 99% could be re-routed, while A > waits for C to rejoin. Or if multiple paths are being used to process the > payment, just redistribute the remaining payments allotted for the broken > path among the other functioning paths. > > The bigger problem here seems to be that the incentives are slightly > skewed in favor of dishonestly. One can minimize the impact of that > dishonesty by breaking the payment into smaller chunks and across diverse > paths, but this comes at the cost of bandwidth and speed. Some sort of a > rating system could come into play possibly, if nothing can be > cryptographically worked out. > > Best, > Stephen >
Quoted text (2 lines)
>There is no such central processor though in this case to enforce the reputation of lightening nodes.
There's no reason why there couldn't be.
Tor, for example, has nine "directory authorities." They attempt to reach nodes in the Tor network, and record whether they're available. Then, they vote among themselves to produce a directory consensus, and they all sign it. Lightning could use a similar system. Unlike Tor, we don't need to require everyone to use the same directory authorities, either.
On Wed, Jul 1, 2015 at 10:53 AM, Nick ODell <nickodell at gmail.com> wrote:
Quoted text (78 lines)
> >There is no such central processor though in this case to enforce the > reputation of lightening nodes. > > There's no reason why there couldn't be. > > Tor, for example, has nine "directory authorities." They attempt to reach > nodes in the Tor network, and record whether they're available. Then, they > vote among themselves to produce a directory consensus, and they all sign > it. Lightning could use a similar system. Unlike Tor, we don't need to > require everyone to use the same directory authority, either. > > On Wed, Jul 1, 2015 at 10:31 AM, Kevin Greene <kgreenek at gmail.com> wrote: > >> Blargh. The dumb solution here is to just shrug and say that you have to >> trust these processors to be highly available, and never try to do >> re-routing. That's pretty much equivalent to what would happen if one of >> the banks in the visa network had networking issues for example. >> >> The big difference here though is that visa will kick you out of the >> network if you're a bank that's consistently not meeting their >> strict SLA's, and that keeps the network honest. There is no such central >> processor though in this case to enforce the reputation of lightening >> nodes. >> >> >> >> On Monday, June 29, 2015, Stephen Morse <stephencalebmorse at gmail.com> >> wrote: >> >>> Hi Rusty, >>> >>> On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au> >>> wrote: >>> >>>> >>>> Yes, C can just get the preimage from E and collude to steal the funds, >>>> which is a nasty failure mode. >>>> >>>> >>> This scenario may even happen non-maliciously, if C has an honest outage >>> and attempts to pick up where it left off on each of its channels. To fix >>> the non-malicious case, C could get a refund from E (a new signed >>> transaction with a lower lock time), if C knows he has been offline for >>> longer than B's willingness to wait before re-routing. But this isn't >>> perfect, or even good, because E cannot know that C isn't just trying to >>> get a refund even though they have taken the payment from B. In fact, C is >>> guaranteed the payment from B, since they have the pre-image. >>> >>> >>>> Delaying the entire payment is a poor option; can anyone see a better >>>> one? >>>> >>> >>> Like you say, delaying the payment seems like a bad way to go, as then >>> the payments wouldn't be quite "Lightning" fast anymore. 99% of the payment >>> could be re-routed though. Perhaps the 99% could be re-routed, while A >>> waits for C to rejoin. Or if multiple paths are being used to process the >>> payment, just redistribute the remaining payments allotted for the broken >>> path among the other functioning paths. >>> >>> The bigger problem here seems to be that the incentives are slightly >>> skewed in favor of dishonestly. One can minimize the impact of that >>> dishonesty by breaking the payment into smaller chunks and across diverse >>> paths, but this comes at the cost of bandwidth and speed. Some sort of a >>> rating system could come into play possibly, if nothing can be >>> cryptographically worked out. >>> >>> Best, >>> Stephen >>> >> >> _______________________________________________ >> Lightning-dev mailing list >> Lightning-dev at lists.linuxfoundation.org >> https://www.learnbitcoin.com/archive/lists/lightning-dev >> >> >
Interesting. It sounds like Joseph may have a solution already, but as a thought experiment I'm curious how directory nodes could work with the lightening network. I guess you would have a set of such authorities that open payment channels with all known lightening processors (how would they be discovered?), and have a protocol for periodically moving money back and forth to verify connectivity. One difference here between Tor and Lightening is that "verifying connectivity" on the Lightening network is not as simple as connecting to a Tor node. For example, in the ABCD example, what if C decides to attack only payments that come from B? It could be non-malicious if C just had a datacenter fire or something that took out the keys and tx data associated with their channel with B. Anyways, if the directory nodes didn't test every possible route through the network (which has exponential complexity), then I don't think they could reliably tell you if C is trustworthy or not.
On Wed, Jul 1, 2015 at 9:55 AM, Nick ODell <nickodell at gmail.com> wrote:
Quoted text (92 lines)
> >There is no such central processor though in this case to enforce the > reputation of lightening nodes. > > There's no reason why there couldn't be. > > Tor, for example, has nine "directory authorities." They attempt to reach > nodes in the Tor network, and record whether they're available. Then, they > vote among themselves to produce a directory consensus, and they all sign > it. Lightning could use a similar system. Unlike Tor, we don't need to > require everyone to use the same directory authorities, either. > > On Wed, Jul 1, 2015 at 10:53 AM, Nick ODell <nickodell at gmail.com> wrote: > >> >There is no such central processor though in this case to enforce the >> reputation of lightening nodes. >> >> There's no reason why there couldn't be. >> >> Tor, for example, has nine "directory authorities." They attempt to reach >> nodes in the Tor network, and record whether they're available. Then, they >> vote among themselves to produce a directory consensus, and they all sign >> it. Lightning could use a similar system. Unlike Tor, we don't need to >> require everyone to use the same directory authority, either. >> >> On Wed, Jul 1, 2015 at 10:31 AM, Kevin Greene <kgreenek at gmail.com> wrote: >> >>> Blargh. The dumb solution here is to just shrug and say that you have to >>> trust these processors to be highly available, and never try to do >>> re-routing. That's pretty much equivalent to what would happen if one of >>> the banks in the visa network had networking issues for example. >>> >>> The big difference here though is that visa will kick you out of the >>> network if you're a bank that's consistently not meeting their >>> strict SLA's, and that keeps the network honest. There is no such central >>> processor though in this case to enforce the reputation of lightening >>> nodes. >>> >>> >>> >>> On Monday, June 29, 2015, Stephen Morse <stephencalebmorse at gmail.com> >>> wrote: >>> >>>> Hi Rusty, >>>> >>>> On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au> >>>> wrote: >>>> >>>>> >>>>> Yes, C can just get the preimage from E and collude to steal the funds, >>>>> which is a nasty failure mode. >>>>> >>>>> >>>> This scenario may even happen non-maliciously, if C has an honest >>>> outage and attempts to pick up where it left off on each of its channels. >>>> To fix the non-malicious case, C could get a refund from E (a new signed >>>> transaction with a lower lock time), if C knows he has been offline for >>>> longer than B's willingness to wait before re-routing. But this isn't >>>> perfect, or even good, because E cannot know that C isn't just trying to >>>> get a refund even though they have taken the payment from B. In fact, C is >>>> guaranteed the payment from B, since they have the pre-image. >>>> >>>> >>>>> Delaying the entire payment is a poor option; can anyone see a better >>>>> one? >>>>> >>>> >>>> Like you say, delaying the payment seems like a bad way to go, as then >>>> the payments wouldn't be quite "Lightning" fast anymore. 99% of the payment >>>> could be re-routed though. Perhaps the 99% could be re-routed, while A >>>> waits for C to rejoin. Or if multiple paths are being used to process the >>>> payment, just redistribute the remaining payments allotted for the broken >>>> path among the other functioning paths. >>>> >>>> The bigger problem here seems to be that the incentives are slightly >>>> skewed in favor of dishonestly. One can minimize the impact of that >>>> dishonesty by breaking the payment into smaller chunks and across diverse >>>> paths, but this comes at the cost of bandwidth and speed. Some sort of a >>>> rating system could come into play possibly, if nothing can be >>>> cryptographically worked out. >>>> >>>> Best, >>>> Stephen >>>> >>> >>> _______________________________________________ >>> Lightning-dev mailing list >>> Lightning-dev at lists.linuxfoundation.org >>> https://www.learnbitcoin.com/archive/lists/lightning-dev >>> >>> >> >
Quoted text (1 line)
>(how would they be discovered?)
Two major ways I can see: * Each Lightning node keeps track of peers it has seen, and provides part of this list to anyone who asks. Directory authorities run spiders, like the one at getaddr.bitnodes.io. This could be overlaid onto the Bitcoin protocol by setting one of the service bits when the node is an active lightning processor. (getaddr approach) * Your node tells all of the directory authorities it knows about itself. (Tor approach)
Quoted text (3 lines)
>One difference here between Tor and Lightening is that "verifying connectivity" on the Lightening network is not as simple as connecting to a Tor node.
I think the two of those are similar. Tor can detect various sorts of accidental connectivity issues. For example, if you tell Tor in its config file that it has a gigabit connection, and it doesn't, it will figure that out by itself. However, the most important kind of intentional misbehavior, logging connections, cannot be detected remotely.
Lightning is similar. We can detect when someone's internet connection goes down. We can detect (with some plumbing) when their Bitcoin node is not synchronized yet. But we can't detect the most important kind of intentional misbehavior, stealing money, without actually sending money through the network.
(Or someone else trying to send money, and complaining when it doesn't go through. That would work better if the sender of the payment had some kind of log of signed statements made by the nodes involved, though.)
Quoted text (1 line)
>From a privacy perspective, active scanning (sending money through the
network yourself) is much easier to secure than passive scanning (acting on an audit log of someone whose payments got stolen.)
Quoted text (4 lines)
>For example, in the ABCD example, what if C decides to attack only payments that come from B? It could be non-malicious if C just had a datacenter fire or something that took out the keys and tx data associated with their channel with B.
It doesn't seem like you can catch everybody who's selectively scamming through active scanning. For example, if someone stole one out of every million payments, the directories would never notice. Personally, I'd more worried about someone trying to defeat active scanning by fingerprinting wallet software. (e.g. this wallet software always puts zero in this field, or this directory authority always connects from Tor addresses.)
WRT the non-malicious example: It seems like a non-malicious node would ask for the channel to be closed ASAP, if it no longer remembered the data that would show who owned what. This would still leave the payments that it was processing just before the data loss in limbo, though, so that's not a cure-all.
Quoted text (3 lines)
>Anyways, if the directory nodes didn't test every possible route through the network (which has exponential complexity), then I don't think they could reliably tell you if C is trustworthy or not.
I don't think they need to test every route. In the ABCD example, the only nodes that C should know about are B and D. Therefore, the routes EBCD and ABCD are equivalent from C's point of view.
That's still superlinear, though.
On Wed, Jul 1, 2015 at 12:19 PM, Kevin Greene <kgreenek at gmail.com> wrote:
Quoted text (112 lines)
> Interesting. It sounds like Joseph may have a solution already, but as a > thought experiment I'm curious how directory nodes could work with the > lightening network. I guess you would have a set of such authorities that > open payment channels with all known lightening processors (how would they > be discovered?), and have a protocol for periodically moving money back and > forth to verify connectivity. One difference here between Tor and > Lightening is that "verifying connectivity" on the Lightening network is > not as simple as connecting to a Tor node. For example, in the ABCD > example, what if C decides to attack only payments that come from B? It > could be non-malicious if C just had a datacenter fire or something that > took out the keys and tx data associated with their channel with B. > Anyways, if the directory nodes didn't test every possible route through > the network (which has exponential complexity), then I don't think they > could reliably tell you if C is trustworthy or not. > > On Wed, Jul 1, 2015 at 9:55 AM, Nick ODell <nickodell at gmail.com> wrote: > >> >There is no such central processor though in this case to enforce the >> reputation of lightening nodes. >> >> There's no reason why there couldn't be. >> >> Tor, for example, has nine "directory authorities." They attempt to reach >> nodes in the Tor network, and record whether they're available. Then, they >> vote among themselves to produce a directory consensus, and they all sign >> it. Lightning could use a similar system. Unlike Tor, we don't need to >> require everyone to use the same directory authorities, either. >> >> On Wed, Jul 1, 2015 at 10:53 AM, Nick ODell <nickodell at gmail.com> wrote: >> >>> >There is no such central processor though in this case to enforce the >>> reputation of lightening nodes. >>> >>> There's no reason why there couldn't be. >>> >>> Tor, for example, has nine "directory authorities." They attempt to >>> reach nodes in the Tor network, and record whether they're available. Then, >>> they vote among themselves to produce a directory consensus, and they all >>> sign it. Lightning could use a similar system. Unlike Tor, we don't need to >>> require everyone to use the same directory authority, either. >>> >>> On Wed, Jul 1, 2015 at 10:31 AM, Kevin Greene <kgreenek at gmail.com> >>> wrote: >>> >>>> Blargh. The dumb solution here is to just shrug and say that you have >>>> to trust these processors to be highly available, and never try to do >>>> re-routing. That's pretty much equivalent to what would happen if one of >>>> the banks in the visa network had networking issues for example. >>>> >>>> The big difference here though is that visa will kick you out of the >>>> network if you're a bank that's consistently not meeting their >>>> strict SLA's, and that keeps the network honest. There is no such central >>>> processor though in this case to enforce the reputation of lightening >>>> nodes. >>>> >>>> >>>> >>>> On Monday, June 29, 2015, Stephen Morse <stephencalebmorse at gmail.com> >>>> wrote: >>>> >>>>> Hi Rusty, >>>>> >>>>> On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au> >>>>> wrote: >>>>> >>>>>> >>>>>> Yes, C can just get the preimage from E and collude to steal the >>>>>> funds, >>>>>> which is a nasty failure mode. >>>>>> >>>>>> >>>>> This scenario may even happen non-maliciously, if C has an honest >>>>> outage and attempts to pick up where it left off on each of its channels. >>>>> To fix the non-malicious case, C could get a refund from E (a new signed >>>>> transaction with a lower lock time), if C knows he has been offline for >>>>> longer than B's willingness to wait before re-routing. But this isn't >>>>> perfect, or even good, because E cannot know that C isn't just trying to >>>>> get a refund even though they have taken the payment from B. In fact, C is >>>>> guaranteed the payment from B, since they have the pre-image. >>>>> >>>>> >>>>>> Delaying the entire payment is a poor option; can anyone see a better >>>>>> one? >>>>>> >>>>> >>>>> Like you say, delaying the payment seems like a bad way to go, as then >>>>> the payments wouldn't be quite "Lightning" fast anymore. 99% of the payment >>>>> could be re-routed though. Perhaps the 99% could be re-routed, while A >>>>> waits for C to rejoin. Or if multiple paths are being used to process the >>>>> payment, just redistribute the remaining payments allotted for the broken >>>>> path among the other functioning paths. >>>>> >>>>> The bigger problem here seems to be that the incentives are slightly >>>>> skewed in favor of dishonestly. One can minimize the impact of that >>>>> dishonesty by breaking the payment into smaller chunks and across diverse >>>>> paths, but this comes at the cost of bandwidth and speed. Some sort of a >>>>> rating system could come into play possibly, if nothing can be >>>>> cryptographically worked out. >>>>> >>>>> Best, >>>>> Stephen >>>>> >>>> >>>> _______________________________________________ >>>> Lightning-dev mailing list >>>> Lightning-dev at lists.linuxfoundation.org >>>> https://www.learnbitcoin.com/archive/lists/lightning-dev >>>> >>>> >>> >> >
On Wed, Jul 1, 2015 at 3:35 PM, Nick ODell <nickodell at gmail.com> wrote:
Quoted text (60 lines)
> >(how would they be discovered?) > Two major ways I can see: > * Each Lightning node keeps track of peers it has seen, and provides part > of this list to anyone who asks. Directory authorities run spiders, like > the one at getaddr.bitnodes.io. This could be overlaid onto the Bitcoin > protocol by setting one of the service bits when the node is an active > lightning processor. (getaddr approach) > * Your node tells all of the directory authorities it knows about itself. > (Tor approach) > > > >One difference here between Tor and Lightening is that "verifying > connectivity" on the Lightening network is not as simple as connecting to a > Tor node. > I think the two of those are similar. Tor can detect various sorts of > accidental connectivity issues. For example, if you tell Tor in its config > file that it has a gigabit connection, and it doesn't, it will figure that > out by itself. However, the most important kind of intentional misbehavior, > logging connections, cannot be detected remotely. > > Lightning is similar. We can detect when someone's internet connection > goes down. We can detect (with some plumbing) when their Bitcoin node is > not synchronized yet. But we can't detect the most important kind of > intentional misbehavior, stealing money, without actually sending money > through the network. > > (Or someone else trying to send money, and complaining when it doesn't go > through. That would work better if the sender of the payment had some kind > of log of signed statements made by the nodes involved, though.) > > From a privacy perspective, active scanning (sending money through the > network yourself) is much easier to secure than passive scanning (acting on > an audit log of someone whose payments got stolen.) > > >For example, in the ABCD example, what if C decides to attack only > payments that come from B? It could be non-malicious if C just had a > datacenter fire or something that took out the keys and tx data associated > with their channel with B. > It doesn't seem like you can catch everybody who's selectively scamming > through active scanning. For example, if someone stole one out of every > million payments, the directories would never notice. Personally, I'd more > worried about someone trying to defeat active scanning by fingerprinting > wallet software. (e.g. this wallet software always puts zero in this field, > or this directory authority always connects from Tor addresses.) > > WRT the non-malicious example: It seems like a non-malicious node would > ask for the channel to be closed ASAP, if it no longer remembered the data > that would show who owned what. This would still leave the payments that it > was processing just before the data loss in limbo, though, so that's not a > cure-all. > > >Anyways, if the directory nodes didn't test every possible route through > the network (which has exponential complexity), then I don't think they > could reliably tell you if C is trustworthy or not. > I don't think they need to test every route. In the ABCD example, the only > nodes that C should know about are B and D. Therefore, the routes EBCD and > ABCD are equivalent from C's point of view. > > That's still superlinear, though. >
Yeah. Also, how will A know what nodes B is connected to? B could advertise its connected peers ala BGP AS-Paths.
Speaking of which, how does routing work in the lightening network? Forgive me if that's already documented somewhere. Is that designed already?
Quoted text (116 lines)
> > On Wed, Jul 1, 2015 at 12:19 PM, Kevin Greene <kgreenek at gmail.com> wrote: > >> Interesting. It sounds like Joseph may have a solution already, but as a >> thought experiment I'm curious how directory nodes could work with the >> lightening network. I guess you would have a set of such authorities that >> open payment channels with all known lightening processors (how would they >> be discovered?), and have a protocol for periodically moving money back and >> forth to verify connectivity. One difference here between Tor and >> Lightening is that "verifying connectivity" on the Lightening network is >> not as simple as connecting to a Tor node. For example, in the ABCD >> example, what if C decides to attack only payments that come from B? It >> could be non-malicious if C just had a datacenter fire or something that >> took out the keys and tx data associated with their channel with B. >> Anyways, if the directory nodes didn't test every possible route through >> the network (which has exponential complexity), then I don't think they >> could reliably tell you if C is trustworthy or not. >> >> On Wed, Jul 1, 2015 at 9:55 AM, Nick ODell <nickodell at gmail.com> wrote: >> >>> >There is no such central processor though in this case to enforce the >>> reputation of lightening nodes. >>> >>> There's no reason why there couldn't be. >>> >>> Tor, for example, has nine "directory authorities." They attempt to >>> reach nodes in the Tor network, and record whether they're available. Then, >>> they vote among themselves to produce a directory consensus, and they all >>> sign it. Lightning could use a similar system. Unlike Tor, we don't need to >>> require everyone to use the same directory authorities, either. >>> >>> On Wed, Jul 1, 2015 at 10:53 AM, Nick ODell <nickodell at gmail.com> wrote: >>> >>>> >There is no such central processor though in this case to enforce the >>>> reputation of lightening nodes. >>>> >>>> There's no reason why there couldn't be. >>>> >>>> Tor, for example, has nine "directory authorities." They attempt to >>>> reach nodes in the Tor network, and record whether they're available. Then, >>>> they vote among themselves to produce a directory consensus, and they all >>>> sign it. Lightning could use a similar system. Unlike Tor, we don't need to >>>> require everyone to use the same directory authority, either. >>>> >>>> On Wed, Jul 1, 2015 at 10:31 AM, Kevin Greene <kgreenek at gmail.com> >>>> wrote: >>>> >>>>> Blargh. The dumb solution here is to just shrug and say that you have >>>>> to trust these processors to be highly available, and never try to do >>>>> re-routing. That's pretty much equivalent to what would happen if one of >>>>> the banks in the visa network had networking issues for example. >>>>> >>>>> The big difference here though is that visa will kick you out of the >>>>> network if you're a bank that's consistently not meeting their >>>>> strict SLA's, and that keeps the network honest. There is no such central >>>>> processor though in this case to enforce the reputation of lightening >>>>> nodes. >>>>> >>>>> >>>>> >>>>> On Monday, June 29, 2015, Stephen Morse <stephencalebmorse at gmail.com> >>>>> wrote: >>>>> >>>>>> Hi Rusty, >>>>>> >>>>>> On Sat, Jun 27, 2015 at 2:41 AM, Rusty Russell <rusty at rustcorp.com.au >>>>>> > wrote: >>>>>> >>>>>>> >>>>>>> Yes, C can just get the preimage from E and collude to steal the >>>>>>> funds, >>>>>>> which is a nasty failure mode. >>>>>>> >>>>>>> >>>>>> This scenario may even happen non-maliciously, if C has an honest >>>>>> outage and attempts to pick up where it left off on each of its channels. >>>>>> To fix the non-malicious case, C could get a refund from E (a new signed >>>>>> transaction with a lower lock time), if C knows he has been offline for >>>>>> longer than B's willingness to wait before re-routing. But this isn't >>>>>> perfect, or even good, because E cannot know that C isn't just trying to >>>>>> get a refund even though they have taken the payment from B. In fact, C is >>>>>> guaranteed the payment from B, since they have the pre-image. >>>>>> >>>>>> >>>>>>> Delaying the entire payment is a poor option; can anyone see a better >>>>>>> one? >>>>>>> >>>>>> >>>>>> Like you say, delaying the payment seems like a bad way to go, as >>>>>> then the payments wouldn't be quite "Lightning" fast anymore. 99% of the >>>>>> payment could be re-routed though. Perhaps the 99% could be re-routed, >>>>>> while A waits for C to rejoin. Or if multiple paths are being used to >>>>>> process the payment, just redistribute the remaining payments allotted for >>>>>> the broken path among the other functioning paths. >>>>>> >>>>>> The bigger problem here seems to be that the incentives are slightly >>>>>> skewed in favor of dishonestly. One can minimize the impact of that >>>>>> dishonesty by breaking the payment into smaller chunks and across diverse >>>>>> paths, but this comes at the cost of bandwidth and speed. Some sort of a >>>>>> rating system could come into play possibly, if nothing can be >>>>>> cryptographically worked out. >>>>>> >>>>>> Best, >>>>>> Stephen >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Lightning-dev mailing list >>>>> Lightning-dev at lists.linuxfoundation.org >>>>> https://www.learnbitcoin.com/archive/lists/lightning-dev >>>>> >>>>> >>>> >>> >> >
Kevin Greene <kgreenek at gmail.com> writes:
Quoted text (6 lines)
> On Wed, Jul 1, 2015 at 3:35 PM, Nick ODell <nickodell at gmail.com> wrote: > Yeah. Also, how will A know what nodes B is connected to? B could > advertise its connected peers ala BGP AS-Paths. > > Speaking of which, how does routing work in the lightening network? Forgive > me if that's already documented somewhere. Is that designed already?
Nope, but it's worth its own thread. Let me start that now :)
Thanks, Rusty.
Hi Rusty and Stephen,
On Tue, Jun 30, 2015 at 05:33:00PM +0930, Rusty Russell wrote:
Quoted text (6 lines)
> Joseph's solution is that E can route a conditional refund back to A > with a larger timeout (say 3 days) via some other route: this pays > back the amount to A if they present the preimage for the initial > stalled payment and another preimage A only has. This serves as a > guarantee that E will not reveal the preimage required to take the > stalled payment.
To clarify, this is only necessary if there is a routing failure when a signed transaction has been sent but not acknowledged or cancellation is refused.
For example, presume the prior route A->B->C->E. If C acknowledges B's attempt to route but does not actually route after the signature has been sent by B to C, then A and B are unsure whether C's computer has gone offline or is acting maliciously. In that case, it's necessary for E to send a "conditional refund" back to A. The reason A requires an additional preimage/hash when doing the "conditional refund" is in case the conditional refund itself fails.
However, the most likely case is the routing fails cleanly. If B is unable to send to C because C has been offline or B otherwise refuses to route to C, B can undo the HTLC by cancelling the HTLC entirely (replacement with a new Commitment transaction state with A). This cancellation can cascade back to the sender to free up the money. In the event that the cancellation doesn't end up cascading back to the sender (should be fairly rare), then A can get E to do the same E->D->A with the same hash described in the previous example. Most routing failures should end up being rollbacks.
Quoted text (4 lines)
> This raises other questions, such as who would pay E (and any other > intermediate nodes) for locking up their money for such a time. Could > A provide evidence that the route really had timed out? How many > times can A claim "payment failed"? etc.
I'm assuming that the payment from A to E is split into many small payments. If the payment is too small to be split up, then it's probably cheap enough to not matter anyway (in most cases, waiting for expiration is no big deal). Resolving incomplete payments should be deferred until after the payment is sufficiently complete; E can have as a policy to only send "conditional refunds" when she has received sufficient funds from A (and A has paid for the time-value/fee of the refund). Since the payment is likely source-routed, it is the responsibility for the sender to pay for payment failure. The incentives are largely in favor of receiver being online and accepting -- the recipient, is after all, increasing the amount of bitcoin they own.