Pending transactions

Why is my Stacks transaction pending?

Introduction

On L1 Stacks the average time between blocks is about 10 minutes. Transactions pending between 2 minutes and 60 minutes is not uncommon.

If transactions are pending for more than 2 hours it is likely there is some kind of congestion and or fees have gone up. We would want to make sure that the transactions are correct and Well-formed transactions first. Pending transactions will be dropped after 256 blocks or ~48 hours — a transaction that is not confirmed, by definition, has no impact on your assets and can be re-sent by the original sender.

Transaction pending for several hours or longer? Contact wallet support and/or check for these common issues:

  1. Check that the balance is sufficient for example if you are making a STX swap or transfer, will there be enough left for the transaction fee (for the miner)?

  2. Are the nonce in order without any gaps? An account that has not sent any transactions yet sends the first transaction with a nonce of 0 then 1, 2, 3, 4, etc.

  3. When the network is congested it can also take more time for transactions to get processed. The solution would be to increase the fee. You can check the number of transactions waiting to be processed by checking a node for example this one, or this website https://stacks-inscription-dashboard.vercel.app/ which will also give you an indication of fees required to get high priority with different types of transactions (STX transfer, contract call (i.e. a swap) or a contract deployment (required for listing a BNS name). This last page will also show fees paid for recent transactions and a general idea of priority fees (low, medium, high) per transaction type: https://explorer.hiro.so/transactions?chain=mainnet.

How to troubleshoot pending transactions

We start by getting an overview of all the transactions and their nonces and fees. Do this by visiting explorer.hiro.so and then searching for your address. After that click the "Pending" tab. Here is an example. Take note of the following:

A. The last executed transaction nonce

B. The nonces of pending transactions and that they go from the number in a. without gaps.

C. Check the fees and the balance on your address, can they all be covered?

D. If you have pending transfers of STX going out of the address, can they likewise be covered?

E. Are the fees sufficient for priority? compare with https://explorer.hiro.so/transactions?chain=mainnet. Fees can go up rapidly in times of increased activity so if your transaction remains pending when you have determined that the nonces are good and balance is sufficient, you can increase them again if it still doesn't get picked up.

Recognizing a "nonce gap"

In this example the last executed tx nonce is 136. This means the next nonce that can be processed for this address is 137. The pending transactions for this address start with 138. Without filling that gap no other transactions can get processed. If you create a new transaction for this account the wallet is expected to set the nonce to 137. But it is good to check this by clicking "edit nonce" before proceeding. How to set a custom nonce can be seen in this guide.

How to replace a Stacks transaction

You can replace a pending transaction by increasing the fee (this will send the same transaction again but with the same nonce but a higher fee).

You can also send a completely new transaction, and then edit the nonce to be similar to a transaction that is already pending, by setting a higher fee you will replace the pending transaction with that nonce.

Please note that it takes time for transactions to propagate over the network, the transactions with the same nonce and a higher fee will replace those with a lower fee on Stacks nodes. Sometimes one of the transactions is mined before it is replaced on all nodes and then it can still show up as pending while the nonce has already been used. The pending transaction in that case will expire automatically after 256 blocks (about 2 days) and can be ignored.

Last updated