From rusty at rustcorp.com.au Mon Sep 14 18:46:10 2015 From: rusty at rustcorp.com.au (Rusty Russell) Date: Tue, 15 Sep 2015 04:16:10 +0930 Subject: [Lightning-dev] Atomic swap In-Reply-To: References: Message-ID: <87613cltzh.fsf@rustcorp.com.au> Pierre writes: > Hello there, > > I've been thinking about how we could implement the idea some brilliant > people had here : > https://bitcointalk.org/index.php?topic=1134319.msg11966748#msg11966748. Yes! Caveats: 1) We still need some way of adding another anchor to a channel, since the atomic swap can't increase channel *capacity*. 2) This is a routing question :) So, they're normal HTLCs, but the "next hop" is not "lightning node X" but "bitcoin address X". No protocol changes required, except the FIXME here: // Start a new commitment tx to add an HTLC me -> you. message update_add_htlc { // Hash for which I will supply preimage to revoke this commitment tx. required sha256_hash revocation_hash = 1; // Amount for htlc required uint32 amount = 2; // Hash for HTLC R value. required sha256_hash r_hash = 3; // Time at which HTLC expires (absolute) required locktime expiry = 4; // FIXME: Routing information. } :) Cheers, Rusty.