The simplest solution I can imagine is: TRUST
I trust my broker, You trust your broker. Our Brokers trust each other and the exchange. We put orders. The Exchange match the orders. Our brokers swap our assets (BTC vs USD) based on the trade execution and trade is done.
Right, but you are creating a more centralised system. The brokers lots of trust links have a lot of power in the system.
The proposal of colored coins and tokens seems good, tell more about it!
Basically, a "mint" would create a coloured coin by sending you a coin from a particular address. Initial marking of colour requires the mint to formally give info on which tx outputs are coloured as "roots".
The software tracks the coins as they go through the network. They have rules for how to colour coins before and after a transaction.
For example, you might have
Inputs
0: 5 satoshi (mint1 colour)
1: 15 satoshi (mint1 colour)
2: 50 satoshi (mint2 colour)
3: 0.01 BTC (uncoloured - this is for the tx fee)
Outputs
0: 10 satoshi
2: 10 satoshi
1: 50 satoshi
If this is included in the block chain, the colour tracker will then mark the outputs as coloured to give
Output
0: 10 satoshi (mint1 colour)
1: 10 satoshi (mint1 colour)
2: 50 satoshi (mint2 colour)
If you want your coloured coin value to be preserved you need to make sure you have the right amounts for the coloured coins.
In this case, the first 2 inputs are the same colour and add up to 20. Similar the first two outputs add to 20. Your software would remember that those outputs are also coloured.
Likewise the 50 satoshi of mint2's colour are matched values.
These guys have defined a spec for this.
But how do we trade a basket of chicken eggs at the farmers market against a barrel of gasoline with colored coins / tokens ? Is it doable?
The mints act convert coloured coins to/from their backing. A mint might send you 100 satoshi coloured by them in exchange for $1. Likewise, they would do the reverse transaction. There would be a fee in both directions.
This also works with other things like barrels of oil. The farmer would sell the eggs for BTC and then buy the oil.
(In this example farmers market got their order book at this hypothetical p2p exchange where farmers put sell orders of chicken egg and consumers pay with barrells of gasoline,
It is more efficient to have a currency for that. There is no need for barter. Having many mints to convert to/from fiat is required since fiat isn't in digital format.