Tagged and Padded based coloring
I am going to give this one more shot, especially as you begin to move further from literal Bitcoin transfers equating to literal Colored Coin transfers.
Instead of ordering inputs with outputs, I would suggest you do the following:
Colored coin definitions be implemented with a structured definition (XML? Jason?) that provides the following:
- A Name (example: Gold Coin)
- A Description (example: Each coin represents 1 ounce of Gold, or 1 share of company xyz)
- 25 signatures randomly from the odd numbers between 1 to 99, inclusively
- Other information TBD, and perhaps specific to the colored coin.
A Transaction will transfer colored coins under the following conditions:
- An output has as its last two digits a signature value as specified in its definition
- The last output transfers all the colored coin of the transaction not transferred by a previous output
- The Padding value is subtracted from the colored coin transfer amount, and is not colored
- The Transaction fee is never colored.
If an address contains multiple colored coins, then these coins can be transferred using signatures locally unique to those coins. The odds of two coins having the same 25 random signatures is roughly 1 in 126 trillion.
Any output without a valid signature that is not the last output is a transfer of uncolored coins.
If we using a padding value (say .00010000 BTC), then that padding would not be colored coin. The transaction fee is never colored coin.
Layout of a Colored Coin output:
V.vvvvvvSS
- V is any number < the number of Bitcoin to spend
- (vvvvvv - the pad)*1000000 = the number of colored coin transferred. For example, to transfer 100 of colored coins, you would send someone .00020037 BTC, where 37 is the signature, and (.000200 - .0001)*1000000 = 100.
- Since "change" is usually the last output in most wallets, your remaining colored balance will come back to you.
Advantages:
- SPV is all that is needed. All you have to chase down are the inputs to transactions
- In computing a colored balance at an output, inputs that are not the last output and do not have a valid signature can be discarded immediately. So the number of inputs you have to chase is far smaller.
- Once you have reached the genesis transaction, you can compute back the colored coin balance at your original output.
- Literal Bitcoin balances do not get tied to your colored coin.
Observations:
If you are going to go to a padded order based coloring, you might as well go the extra step and use tags. They are easier to explain, easier to see, and they do disengage the Bitcoin from the Colored Coin. They do have the slight disadvantage that you cannot use a Satoshi to represent a colored coin, but the advantages of shorting your searches, and disengaging from Bitcoin make up for that.