 How do colored coins work? I've been following the BISC, Decentralized Exchange and Organization experiment. They're using colored coins on the Bitcoin network to incentivize traders, contributors, and arbitrators. I understand how colored coins work at a very high level, but I haven't found a good technical explanation about how it's implemented. Can you explain how colored coins really work? There's a chapter in advanced transactions in mastering Bitcoin, which you can find for free on GitHub, that explains how colored coins really work. But the thing is colored coins are not a specific technology, it's a concept. It's implemented in a number of different ways. There are a number of implementations that implement the concept of colored coins. The idea of colored coins is really simple. You take a very small amount of Bitcoin, usually in the thousands of Satoshis, which doesn't have any real monetary value. What you do is you mark it in some way that can be recognized by a specially-configured wallet, so that that information can be tracked forward through transactions. You mark it as having special meaning in addition to its monetary value. In practical terms, think of me taking a dollar bill and stamping on this. This is redeemable for one copy of mastering Bitcoin with a little rubber stamp. It's still worth a dollar if you spend it at the grocery store, but now it's worth $34, if you get a free copy of mastering Bitcoin from a bookstore that's participating in my color dollar scheme. Of course, the stamp would be orange, because that's the Bitcoin color. That's a practical example of the colored coin concept. The underlying currency still has the same value, but that value is really small relative to the thing I've stamped on it. You need that, because otherwise people will spend it to buy gum, and then it's lost in circulation. People don't know that it's special. But the thing that's stamped on it can be stamped in a number of ways. There's a number of protocol implementations of colored coins. Some use special public key addresses that mean something. Some use special multi-sig addresses that mean something. Essentially, they construct scripts or put information into a transaction. When you initialize a colored coin, you first stamp all of the satoshis. From that transaction, which is the Genesis transaction of the colored coin, you can then spend small amounts with additional Bitcoin transactions. A wallet that's configured correctly can trace back to the transaction where you created the colored coin, and see what colored coin is. One of the easier ways to do that is using the op-return script operand. What the op-return script operand does is it allows you to introduce 80 bytes of information as an output in a transaction. That 80 bytes could be hash, or it could be a binary-encoded message that can be read by a wallet configured to read it. One of the colored coin protocols does exactly that. You have an op-return followed by a special code that says, hey, this is the colored coin protocol followed by, and this coin is marked in this way, with so many units that are divisible in this way, and here's a URL that tells you how to look it up. Based on that information, a wallet can display interesting things about it. A name, for example, maybe even an icon for that colored coin, and then know how to spend it in a way that maintains that information going forward. That's how colored coins work in this particular case. There are some implementation details, like what does the wallet put in the op-return? How does it encode that information? There's a whole specification you can read on different forms of colored coin implementations that tells you how the information is encoded. If you want, you can look in the blockchain at a raw transaction that created a colored coin, use the colored coin wallet to create a colored coin, and then go in the blockchain and look at that transaction, and look at the raw data in it. And you should be able to unravel it and say, oh, right. So this is the little encoding that they're using, and it matches the specification. You can read it, essentially, by unraveling the hex or binary encoding. Dean asks, can colored coins be used to track donations? I'm working on a platform for political funding and donations. I'd like to use Bitcoin exclusively. What would be super cool is if we could color the coins so we can see how they are used forever after they leave our donation platform? Is the case that this is possible with colored coins or with something else? Or is this not possible? If this is possible, could it be used with the Lightning network? So, Dean, to answer your question, this is possible, and you can use colored coins in order to track donations. However, depending on how users behave with these colored coins, they could obfuscate and try to hide where donations are going, by using standard mixing techniques and things like that. Effectively removing the color from the coins. Now, assuming those receiving the donations don't want to do that, this is an effective way of doing it. I know of at least one other project that's doing this, which is the BitGivFoundations project gift track, which is trying to do that for charitable donations. Can it be used with the Lightning network? Not at the moment. You can't use colored coins or send colored coins within the Lightning network, but it's possible that that could be a capability that gets added later on. There's no reason why you can't theoretically do that in the future.