From rusty at rustcorp.com.au Wed Dec 16 00:04:00 2015 From: rusty at rustcorp.com.au (Rusty Russell) Date: Wed, 16 Dec 2015 10:34:00 +1030 Subject: [Lightning-dev] Transaction time In-Reply-To: References: Message-ID: <87a8pbxnrj.fsf@rustcorp.com.au> Denis Gorbachev writes: > Assuming a simple case of "Consumer - Relay - Provider" (2 hops), how long > should it take for provider to receive the payment? Assuming established channels already (assuming CPU is instant, so we're just paying for network latency): Consumer offers Relay a contract: C -> R: update_add_htlc R -> C: update_accept C -> R: update_signature R -> C: update_complete* Relay offers Provider a contract: R -> P: update_add_htlc P -> R: update_accept R -> P: update_signature P -> R: update_complete* Provider closes contract with relay: P -> R: update_fulfill_htlc R -> P: update_accept P -> R: update_signature R -> P: update_complete* Relay closes contract with Client: R -> C: update_fulfill_htlc C -> R: update_accept R -> C: update_signature C -> R: update_complete* You don't need to wait for the update_complete packets to arrive, so that works out to 3 RTTs per hop. You might expect up to 10 hops in a large lightning network, so 30 RTTs. I'm in Australia, and my bitcoin node latency averages 330ms (ouch!). So that would be 10 seconds. Hope that helps! Rusty.