WARNING:
Customising gas fees and "nonce" values can have serious consequences. We would strongly advise all customers to select "FAST" transaction speed from API, iOS or TrustVault Web or you run the risk of transactions getting stuck.
This article aims to explain how TrustVault works when setting nonce values for Ethereum transactions.
Firstly, it's worth noting that TrustVault generally treats API usage as an advanced feature and allows operations that are more complex. This could lead to issues if API users are not aware of how the Ethereum network operates.
Sending Ethereum transactions with TrustVault
When you use TrustVault via the Web or the mobile App, TrustVault attempts to construct transactions that have a high chance of being accepted by the Ethereum network quickly. This means TrustVault will select the appropriate gasPrice, gasLimit, and nonce values for the transaction. If you are unsure what these terms mean there are some articles to explain:
- https://www.investopedia.com/terms/g/gas-ethereum.asp
- https://ethgasstation.info/blog/gas-limit/
- https://kb.myetherwallet.com/en/transactions/what-is-nonce/
How is the nonce value determined?
This value cannot be set manually unless you use the API and even then it is an optional value.
Normally, if you try to create a transaction (without passing a nonce value), TrustVault will give an error if you already have a transaction pending (awaiting a signature from other users). This is to protect you from creating transactions out of sequence that may cause problems if you fail to sign one or sign them out of order.
If you don't have any pending transactions, TrustVault will allow you to create a new transaction and will select the nonce value for the transaction by querying the network and checking any transactions inside TrustVault.
NB: Due to the distributed nature of blockchains, it is possible (although generally unlikely) for the nonce value selected by TrustVault to be sometimes incorrect.
Setting the nonce from the API
If you are using the API, TrustVault allows more flexibility and allows you to set the nonce directly yourself. This is useful for several reasons:
- You can send more transactions at once, effectively "batched" for signing later.
- You can change an existing transaction by increasing the gasPrice.
- You can control exactly how you send transactions.
Setting the nonce value in the API changes the behavior of TrustVault slightly. If you set the nonce, it is implied that you are using an advanced feature and are tracking the nonce values yourselves. Thus, TrustVault will NOT perform a check to see if there are existing pending transactions and will accept any integer value you send (nonce must be >= 0).
This allows you to push many more transactions into the system for signing. However, be aware of the following:
- You can send a transaction with the same nonce multiple times. Once signed, they will be pushed to the Ethereum network, which may or may not accept the transaction.
- You can send a transaction with an old nonce, which the Ethereum network will likely reject.
- You can send a transaction with a future nonce, say 10 ahead of the current value. The Ethereum network may accept or reject it, but it will likely remain in the mempool until all transactions with lower nonces are submitted and mined.
- Mixing setting the nonce via the API and then using TVW or the mobile app is discouraged as it may lead to unexpected nonce values.
Summary
Setting the nonce values for transactions allows API users more control and flexibility, enabling transactions to be batched for signing later or re-submitting stuck transactions by increasing the gasPrice.
Please use the API nonce setting ability with caution and make use of our Sandbox environment to test your code.
🛑 Common Error Message
Unable To Broadcast Txn : { "jsonrpc":"2.0", "id":1, "error":{ "code":-32000, "message":"nonce too low: next nonce <expected>, tx nonce <submitted>" } }
This message indicates that the transaction was submitted with a nonce lower than the next expected value by the network. The transaction will not be broadcasted.
âś… How to Diagnose and Resolve
Before contacting support, follow these steps:
1. Check the Latest Nonce on a Block Explorer
Use a block explorer like Etherscan to look up the sending address. The last used nonce can be seen in the transactions list or via an API query.
- Last confirmed transaction = nonce
n
- Next transaction should use nonce
n + 1
2. Compare With Bitpanda Custody Transaction Details
In the Bitpanda Custody interface, review the nonce assigned to your transaction. Make sure it matches the network’s expected value. If the nonce is reused or out of sequence, the transaction may be rejected or dropped.
3. Don’t Reuse Dropped Nonces
Once a transaction with a given nonce has been dropped and a newer one confirmed, rebroadcasting with the old nonce will result in a “nonce too low” error. Use the latest expected nonce only.
4. Avoid Gaps Between Transactions
If you submit a transaction with a future nonce before filling the previous one, the transaction may remain unconfirmed. Ensure all previous transactions are confirmed before submitting the next in the sequence.
đź› Tips for Manual Nonce Management
- Always double-check the current nonce before submitting a transaction manually.
- Avoid concurrent transaction submission from different tools using the same key.
- Use consistent monitoring to track pending and confirmed transactions.
📌 Summary
If your transaction isn’t broadcasting:
- Verify the correct nonce on a block explorer.
- Ensure no earlier transactions are unconfirmed or stuck.
- Do not reuse previously submitted or dropped nonces.
Following these steps resolves most nonce-related issues. If you still encounter problems, contact support with your transaction reference and sender address.