[Lightning-dev] Atomic swap

Rusty Russell rusty at rustcorp.com.au
Mon Sep 14 18:46:10 UTC 2015


Pierre <pm+lists at acinq.fr> 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.


More information about the Lightning-dev mailing list