Nonces
If you create multiple transactions inside and/or outside of GasHawk, you might run into problems concerning the transactions nonces. Keep reading to learn how to avoid this.
What is a nonce?
Each address on ethereum adds a positive integer number to each transaction it creates. These are called nonces. They start at 0 and increase by 1 with each transaction. The evm enforces this behavior: any deviation leads to the transaction being rejected.
The rules are:
- nonces start at 0 for each wallet
- each nonce can only be used once
- the nonce has to increase by exactly 1 for each transaction
Examples for illegal nonces:
- using the nonce 7 again, after it has already been used in a transaction
- using nonce 3 when the highest nonce used so far is 1
Read more about nonces here.
How can this cause trouble?
Example 1: Transactions with and without GasHawk (or Diana and pizza)
Example 2: Multiple Transactions in GasHawk
Why doesn't GasHawk just fix the nonce already?
We'd love to! But we can't. GasHawk receives signed transactions from your wallet. Them being signed means that any tampering with any part of the transaction data invalidates the signature, and thus the transaction, which would therefore be rejected by the mempool. Apart from the nonces this is great: Neither you nor we want GasHawk to be able to tamper transactions.
What can you do about it then?
Don't send transactions on the ethereum mainnet from an address that still has pending transactions in GasHawk