Sequence of events

Imagine that we have a contract that implements a custom cryptocurrency on top of Ethereum. There is no way to specify amount when the coins are transferred, the whole balance is sent to another account.

Now look at the following transactions:

1. Alice sends all her coins to Bob.
2. Bob sends all his coins to Charlie.

Depending on order these transactions are processed Charlie gets different number of coins to his account.

Is it possible to specify the order without waiting for Alice's transaction becoming visible to Bob (for referencing it explicitly)?
Does Ethereum define a canonical ordering of transactions (not influenced by miners) in the same block?

Answers

  • wireswires Member Posts: 7
    Good question! I'm interested as well.

    FWIW Judging from the yellow paper, only blocks have a timestamp, not transactions.
    At least in bitcoin the lack of timestamped transitions has been notes as a problem or even oversight by Satoshi in the original proposal/client. As miners get to pick which transactions they include in a block, some transactions are left over and there is no way to know how fresh they are. And indeed as you note, the ordering of transactions within a block is vague...

    Then there is the problem of securing the timestamp, which I don't know nearly enough about to say anything useful on.
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    Transactions are executed in the order they are in the block. So if the result is different, the result is different, it is basically up to the contract writers to try make that sensible.

    Bit raw data, but a forum thread, and a reddit thread.
Sign In or Register to comment.