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.

  • 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 – nyusternie Jan 11 at 11:21
up vote 3 down vote accepted
  • 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.

  • 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 at 10:21
  • Hum, yes, true, but I don't really think it's a good practice. – Andromelus Jan 11 at 10:23
  • In order to resend the transaction with higher fee that a normal practice, anyway good answer +1 – Зелёный Jan 11 at 10:23
  • Added your solution in the answer :) – Andromelus Jan 11 at 10:26
  • 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. – smarx Jan 11 at 11:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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