3

Several articles say that a transaction can be canceled or replaced with the same nonce and higher gas price.

Then does this indicate that the same address can NOT send two transactions at the same time?

As the nonce is the number of transactions sent from a given address, may I just increase the number of nonce when sending the second transaction?

However I don't think it is possible to know which transaction will be mined firstly, so it confuses me that I can not determine which transaction should be given a higher nonce.

Please correct me if anything is wrong.

1
  • Ethereum contracts are able to send multiple transactions at the same time, which then show up as Internal transactions on etherscan.io. More info in internal transactions ethereum.stackexchange.com/a/6432/20276
    – Shomari
    Jan 11, 2018 at 11:21

1 Answer 1

4
  • Then does this indicate that the same address can NOT send two transactions at the same time?

No. It indicates that you cannot send two transaction with the same nonce from the same address.

  • As the nonce is the number of transactions sent from a given address, may I just increase the number of nonce when sending the second transaction?

Yes.

  • However I don't think it is possible to know which transaction will be mined firstly, so it confuses me that I can not determine which transaction should be given a higher nonce.

I think (if someone could confirme or correct) it is the first one that gets mined. But I'm not sure at all because that miners' configuration migth have an influence on that.

From @Зелёный in the comments, you could set an higher gas price in one of yoru transaction so that it is processed before the other one. You then don't have to worry about nonce anymore.

7
  • 1
    I can send second transaction with the same nonce but with other gas prices, if the gas price higher than I sent previously that transaction give precedence. Jan 11, 2018 at 10:21
  • Hum, yes, true, but I don't really think it's a good practice. Jan 11, 2018 at 10:23
  • 1
    If you send out two transactions, one with nonce 5 and one with nonce 6, the one with nonce 5 has to be mined first. Until it is, 6 is not a valid nonce. So yes, you can sign a bunch of transactions with different nonces and dictate the order in which they're added to blocks.
    – user19510
    Jan 11, 2018 at 11:12
  • 1
    @smarx Do you mean even with the same gas price, it is safe to send two transactions with different nonce numbers, and the chain will order the transaction automatically?
    – xuanzhui
    Jan 11, 2018 at 12:27
  • 1
    Yes, that's correct.
    – user19510
    Jan 11, 2018 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.