Bitcoin Institute

Atomic coin swapping

1 messages BitcoinTalk Jeff Garzik September 22, 2012 — September 22, 2012

gmaxwell was talking about colored coins (https://bitcointalk.org/index.php?topic=106449.msg1203918#msg1203918) in IRC recently. They are potentially interesting in the context of distributed bonds (https://bitcointalk.org/index.php?topic=92421.0), which I am currently pursuing with pybond (https://github.com/jgarzik/pybond).

Here is the problem I am trying to solve, does the crowd have an answer?

  1. Alice transfers a 1-satoshi colored coin to Bob.
  2. Bob transfers 100 BTC to Alice. May be restricted to 1 txout, if that eases implementation details.
  3. Steps #1 and #2 happen as a logically atomic unit, all-or-none.
  4. Alice and Bob must both approve this atomic transfer of coins, with appropriate signatures.

Is this possible within the current bitcoin system? As far as I can see, the answer is “no” but maybe I’m missing something.

My best guess to the answer is “possible, but requires a new SIGHASH_* type”?

It seems like atomic coin swapping has great potential.

Edit: thanks, crowd 😊 See below.