Atomic exchanges of chain coins and Ripple IOUs

Bitcoins (or other proof of work chain currencies) can be traded atomically for ripple IOUs in a trust-less and p2p way. There are more ways to implement this use case. First we explain how to do it using this protocol and this commit method. Other approaches are discussed in the following sections.

1) The Ripple payer sets the "dest_address" and minimum "amount" for the blockchain commit.

2) When the rest of the ripple transaction is completed, the ripple recipient should send the agreed amount of coins to the specified address.

3) If this occurs before the block "deadline" the Ripple transaction is valid, otherwise it did't happened, it is rolled back.

Ripple nodes could be companies accepting deposits and withdrawals of the currency represented by its IOUs (which can, in fact represent many other assets), for example, USD. With this you would have a p2p bitcoin exchange, but you will always have to trust an issuer. The credit could be certified through legal contracts so that users could hold their crypto-IOUs as legal proofs.

Since btc would not need to be deposited anymore, current exchanges could offer a more secure service. With ripple, all the separate markets could be one, even if actors trust different issuers. Consider this ripple trade, for example:

A(10 mtgoxUSD) -> B(10 intrsngUSD) -> C(7 intrsngEUR) -> D(1 btc) -> A

Or with people which share a trust path that doesn't involve any company, just:

A(10 usd) -> B(10 usd) -> C(7 eur) -> D(1 btc) -> A


The bitcoin wiki describes a way to do this same thing using a blockchain implementation of ripple, very similar to RippleCoin. It has the advantage over the ripple distributed protocol described here that nodes don't need to be always connected and average users don't need to delegate in a server that's always connected like they usually do for e-mail, for example.

On the other hand, RippleCoin can't be instant as this protocol using the registry commit method and the financial infromation is published in the chain, something that never happens to this protocol (not even with this commit method). It can be obfuscated like in Bitcoin, but it is harder in RippleCoin due to the lines of credit that would need to be recycled often. This approach of implementing Ripple inside a blockchain uses the trade across chains contracts use case to make the trust-less trade for bitcoins. The chain currency that hosts ripplecoin (a cash chain currency is still needed to pay for the chain with fees) can be traded atomically for ripple credit inside the same chain without the need of such a contract, the default SIGHASH_ALL described in the bitcoin contracts page is enough.

The public accounting may be actually an advantage too for some use cases, like a smart propery car.

Colored coins

Something similar to Ripplecoin can be implemented in the existing bitcoin chain without changing the protocol. You need to use a concept often reffered to as "colored coins". You use small bitcoin units (for example, a Satoshi) to represent the credit IOUs (or any other crypto-asset). The participants in the "ripple coloring protocol" trace the satoshis back to their source and each address is an issuer or a color.

This is an example of a ripple transaction using colored coins:

A -> B -> C

Inputs: [10 srcA, 10 srcB, 0 srcC]
Outputs: [10 destB, 10 destC]

srcA, srcB, srcC are bitcoin public keys. destB and destC are bitcoin public adresses.

A Ripple trade for bitcoins within a single transaction with each satoshis representing 1 USD could look like this:

A(10 usd) -> B(10 usd) -> C(1 btc) -> A

Inputs: [10 srcA, 10 srcB, 10^8 uncolored]
Outputs: [10 destB, 10 destC, 10^8 destA]

The disadvantage of colored coins compared to ripplecoin is that the underlying satoshis represent an artificial limitation to the divisibility of the crypto-assets issued. Although some argue that this can be useful to prevent spam. The obvious advantage is that there's no need to modify the bitcoin protocol. With ripplecoin you would use bigger numbers instead of satoshis, so you could use fractions as you do with bitcoin (1 satoshi can also represent a fraction, 1 cent, for example). But the chain would enforce the coloring rules as well as keep real bitcoins separate from the credit. With the current approach, when the credit doesn't follow the coloring rules, the coins get "decolored".

You can find a project that's being developed to implement colored coins here:

For more information on colored coins, you can start with this thread.