3 ms·
The reason why timestamping is a difficult problem is that if I publish two transactions spending the same money, the network must agree on the order of events
by danbruc 9y ago
The reason why timestamping is a difficult problem is that if I publish two transactions spending the same money, the network must agree on the order of events (which is to say: must assign different timestamps to the two transactions) so that one is considered valid, and the other invalid.
No, the system must not decide on the temporal order of your two transactions and in the extreme case, if you make them at the exact same time, it can not because neither one precedes the other one. In this specific case of an attempted double spending the system must only decide to accept at most one of your transactions and it must agree on which one gets accepted, if any. If one of the transactions gets accepted this will establish an ordering of the two transactions but this ordering is a result not an prerequisite.
A miner may randomly include any one of your two transactions, if individually valid, without regard to the time it was made. The inclusion in an accepted block then renders the other transaction invalid but this is still not really judgment about the time those transaction were made at, it is just a statement that one is valid and one is invalid.
Ordering is really only important insofar that you can only spend coins that you have received before, i.e. a spending transaction must not precede a receiving transaction. And even then the order in which the transactions are made does not matter. Nothing stops you from creating a spending transaction before the receiving transaction, the spending transaction will just be invalid and not get included in a block until the receiving transaction is made and included in a block.