Colored coins work by “coloring” Bitcoin transaction outputs with an asset ID. One of the side effects of that is that if a colored output is spent without following the requirement of the colored coins protocol, the resulting outputs will be uncolored, which usually means that the incorrectly spent colored coins have been destroyed.
In a way, this is a feature: firstly this allow for completely elastic supply, and secondly, it means anyone can recover the “dust” that was used to create the colored coins, by uncoloring them.
But there is a risk associated to that characteristic: if you send colored coins to a wallet that doesn’t understand them (Blockchain.info, Coinbase, Coinkite, etc…), that wallet won’t know how to spend them correctly, and will probably destroy the colored coins when you will try to send bitcoins from that wallet, because they will treat the colored coins as regular bitcoins.
A special address format for colored coins
Fortunately, there is a simple solution to that problem, and we are happy to announce it has now been fully deployed across the ecosystem. The solution is to use a special format of address for colored coins wallets.
The way this works is quite simple: each Bitcoin address can be represented differently than it usually is. As always, the specification of the Open Assets address format is open and available on GitHub, but the idea is simple.
Regular Bitcoin addresses (and alt-coin addresses, for that matter) use the following pattern, encoded in base-58:
[one-byte version][payload][4-byte checksum]
To convert it into a colored coins address, you simply change it to this format:
[one-byte namespace][one-byte version][payload][4-byte checksum]
Where the [one-byte namespace] is 19 for Open Assets. Normal pay-to-pubkey-hash addresses will start with “ak” instead of “1” and pay-to-script-hash addresses will start with “an” instead of “3”.
Finally, well-behaving wallets supporting colored coins must follow these rules:
- Provide both the old format and new format to users of the wallet
- Never send colored coins to an address that doesn’t follow that new format
Of course, people can still use the old address format to receive Bitcoins from legacy wallets.
The benefits of this scheme are quite clear. You can no longer send colored coins by mistake to a wallet that won’t be able to understand them. That stops the user before he makes the mistake.
This is similar to how Bitcoin wallets will stop you from sending Bitcoins to an address with a typo (because of the checksum).
An interesting characteristics of that system is that it prevents you from sending colored coins to services like Coinbase, BitStamp, or any other exchange, where you don’t have access to the private key holding your funds. Other systems like Counterparty or Mastercoin would let you do that, resulting in your assets being stuck in an address you don’t control. When that happens, the assets are as good as lost. Using a special format of addresses prevents this.
What if I want to use a non-colored coins service to store my colored coins?
There is certainly a valid scenario where someone might want to store their colored coins assets on a regular Bitcoin paper wallet, Armory, or even on Blockchain.info. Those wallets don’t expose an asset address. Of course, it is still possible to store your assets there, but that requires a bit more works. Requiring “more work” ensures users don’t do it by mistake.
To do this, you would just import the public key in Coinprism as an “offline address”. Coinprism will then show you the corresponding asset address, and sending colored coins to that address will effectively send it to the “other wallet” you got the public key from.
You have then two options to transfer these assets:
- When needed, you can import the private key into Coinprism, and Coinprism will then be able to transfer the colored coins.
- Even with the public key only, Coinprism will know how to spend funds from that wallet, and will be able to generate unsigned transactions that correctly transfer colored coins without destroying them. You can then have the “other wallet” (for example Armory) sign the transaction.
In conclusion, we have deployed that change on web-based Coinprism, as well as on the latest version of the mobile application. We worked with third party services such as MasterXchange.com to make sure they were up to date as well. The open source client Colorcore is also up to date with the new address format as of version 1.3.