I have a question about double spend attack on ethereum

I heard that double spend attack is prevented by Nonce

and we can send transactions with different nonce it can be validate

but this situation I thought always two transaction is mined by different blocks

I Want to know is possible to contain two transaction(with different none) for one block

and so if possible, how can be validated by miner? (their state is same state)

  • Thanks, i think that is problem from different account. That means if two transaction from one account, lower nonce transaction could be upper gas price right? Mar 18, 2019 at 6:00
  • This is not a duplicate. But yes, two transactions from the same account can be included in the same block. Transactions within a block are ordered, and in this case, the transaction with the lower nonce will have to be included first. Validation is simple: validate each transaction within the block, in order.
    – user19510
    Mar 18, 2019 at 6:04
  • @smarx Thanks for reply. So it doesn't matter with gas price. lower nonce is validated first.. it is simple. thanks Mar 18, 2019 at 8:34
  • Yes, nonces have to be strictly consecutive. If a certain address has made 3 transactions, the next transaction has to have the nonce 3.
    – user19510
    Mar 18, 2019 at 8:38
  • Another question.. So that ordering is supported by miner? is there any algorithm in geth code? Mar 18, 2019 at 8:52


Browse other questions tagged or ask your own question.