From rusty at rustcorp.com.au Fri Aug 14 01:28:30 2015 From: rusty at rustcorp.com.au (Rusty Russell) Date: Fri, 14 Aug 2015 10:58:30 +0930 Subject: [Lightning-dev] Python LightningNetwork implementation In-Reply-To: References: <20150811175827.GB8380@lightning.network> Message-ID: <87io8ik69t.fsf@rustcorp.com.au> Jasper Hugunin writes: > The routing protocol is a variant of distance-vector routing > . The idea > is that nodes tell their peers beforehand "I know how to get to node X, and > it will cost you this much." Nodes use this information to build a routing > table saying "If I want to send payment to node X, I should forward payment > to node B." Then when payment needs to be sent, the node looks up "Which of > my peers do I forward to?" That is done by the "SELECT nexthop, cost FROM > ROUTES WHERE address = ?" query. If the peer you select does not know the > destination, they lied to you. If you have more than one peer, you choose > the cheapest one. > That said, the current routing protocol is something of a hack to > demonstrate potential, rather than a final solution. Hi Jasper, Yeah, routing is going to be hard, this seems perfectly workable for bootstrapping. I'm hoping to review your code next week, once I've got my own protocol state machine tested. Cheers! Rusty.