Skip to content

Release Stuck EVM Transactions

Network congestion or low transaction fees may prevent a transaction sent to the node from being included in a block. If a transaction remains unprocessed for a certain period after submission (10 minutes on EVM chain, 60 minutes on Bitcoin), Fordefi marks it as STUCK. Fordefi provides two ways to resolve a stuck transaction:

  • Accelerate: Resend the original transaction with a higher fee.
  • Cancel: Replace the original transaction with a higher-fee transaction that sends funds back to yourself, effectively nullifying the original.

These methods, collectively referred to as releasing the transaction, are available on EVM chains and on Bitcoin. The underlying mechanics are similar across the two chain types:

  • On EVM chains, the replacement transaction uses the same nonce as the original and a higher gas price.
  • On Bitcoin, the replacement transaction uses the same UTXOs, a higher sequence number, and an increased fee per byte. To cancel a transaction on Bitcoin, the replacement transaction spends the same UTXOs but sends the funds back to your own address, effectively nullifying the original.

In both cases, the higher fee incentivizes miners to include the replacement transaction in a block, making it more likely to be mined than the original. Once the replacement is mined, the original becomes ineligible to be mined and is dropped by nodes.

Release a stuck transaction

Learn more about releasing transactions using the Fordefi web console.

To programmatically release a transaction, you need to call the Release Transaction API by sending a POST request to the /api/v1/transactions/{id}/release endpoint, where {id} is the ID of the original transaction.

Since releasing a transacton creates a new transaction, it is a sensitive operation and thus requires signing the request. The following examples demonstrate how to release a transaction in different programming languages:

{
    "type": "evm_transaction",
    "release_type": "cancel",  // or "accelerate"
    "signer_type": "api_signer"
}

Transaction information

Once cancelled or accelerated, the original transaction includes a child_transaction_id field, which contains the id of the newly created replacement transaction. The replacement transactions points back to the original transaction in its parent_transaction_id field and also has its is_cancelation or is_acceleration fields set. You can obtain the transaction objects that contain these data using the Get Transaction endpoint.

Release a stuck transaction - advanced method for EVM chains

Acceleration is usually the preferred method for releasing a stuck transaction. However, when the original stuck transaction is no longer relevant, canceling it is the simplest solution. The downside of canceling is that it sends an "empty" transaction, which still incurs gas fees.

To avoid paying this fee, you can replace the stuck transaction with a different transaction instead of an empty one. Create your desired transaction and use the custom_nonce field in the Create Transaction call to reuse the nonce from the stuck transaction. This new transaction will then replace the stuck transaction.

Here's how:

{
    "vault_id": "16b5aa12-509e-4944-b656-cf096515d627",
    "signer_type": "api_signer",
    "type": "evm_transaction",
    "details": {
        "type": "evm_raw_transaction",
        "chain": "ethereum_mainnet",
        "to": "0x565697B5DD1F7Bdc61f774807057D058E5A27cbC",
        "value": "0",
        "data": {
            "type": "hex",
            "hex_data": "0x0d1d7ae50000000000000000000000000000000000000000000000000000000000000006"
        },
        "custom_nonce": "47890",
    }
}