It requires a soft-fork. As long as a vast majority of miners (e.g. >75%) follow the new rules, there won't be any prolonged fork. At that time, the market force will make the minority to reject invalid OP_CHECKCOLOR transaction or they will get orphaned. See how v2 block was gracefully implemented:
https://en.bitcoin.it/wiki/BIP_0034Right, and that change has a "point of no return".
Your target is to propose an upgraded transaction type right?
That makes voting a little more difficult.
Maybe, propose a block type 3 that accepts transaction type 2.
If more than 75% of the last 1000 blocks are type 3 or higher, then reject blocks containing invalid OP_CHECKCOLOR transactions
If more than 95% of the last 1000 blocks are type 3 or higher, then reject any blocks of type less than 3, forever afterwards.
OP_CHECKCOLOR compatible clients (both mining and non-mining nodes) will never create, relay, or mine invalid OP_CHECKCOLOR transactions. Before 75% of miners enforce the new rules, they will still accept blocks with invalid OP_CHECKCOLOR transactions to avoid a prolonged fork. However, they will not acknowledge the color in these invalid OP_CHECKCOLOR transactions. And yes, SPV clients won't work in this sub-optimal situation.
Right, the point of the change to make miners support it.
Is my understanding of your process correct?
MintingInput (1 BTC): from "some-output"
Output (1 BTC): Hash("some output") OP_CHECKCOLOR ....
TransferInput (1 BTC): from the previous transaction (Hash("some output") OP_CHECKCOLOR ....)
Output1 (0.5 BTC): Hash("some output") OP_CHECKCOLOR ....
Output2 (0.5 BTC): Hash("some output") OP_CHECKCOLOR ....
So, effectively OP_CHECKCOLOR does both checking for minting and checking for spending.
Transaction CheckingIt is nice that the colour is stored in the sig script of the output. That way it can be done as a local check for the transaction.
Something like:
If normal processing of the transaction where OP_CHECKCOLOR is a NOP fails, then the invalid transaction.
Scan all output scripts for the OP_CHECKCOLOR script
- If OP_CHECKCOLOR occurs twice in any output then invalid transaction
- If any OP_CHECKCOLOR is not preceded by a 20 byte array, then invalid transaction
- All colored outputs are marked as the color of the byte array
- Determine total value of outputs for each color
- Scan input scripts
-- find the corresponding output script
--- If it contains <color> OP_CHECKCOLOR somewhere, then the input is of that color
--- If hash(output) is equal to <color>, then the input is of that color
--- Credit that color with the value of the input
- If the total outputs for a particular color is greater than the inputs, then invalid transaction