Skip to main content

Transaction Fees

Proper fee management ensures your transactions are processed by mining pools and confirmed on the Bitcoin network.

Understanding Shield Fees

Shield uses a different fee model than standard Bitcoin transactions. Instead of an implicit miner fee (the difference between inputs and outputs), you pay the Shield fee as an explicit transaction output to a Shield-provided address.

Your transaction's inputs must equal its outputs — the implicit Bitcoin fee must be zero. The Shield fee output replaces the standard miner fee entirely.

Fee Structure

When using Shield, you need to:

  1. Include an output in your transaction that pays the Shield fee address
  2. Set the output value high enough for your desired hashrate coverage
  3. Ensure the implicit Bitcoin fee is zero (inputs = outputs)

Shield Fee Output

The Shield fee output must be:

  • Paid to the address provided by the /info endpoint
  • Included as a single output (not split across multiple outputs)
  • Sufficient to meet the minimum fee requirements

Note: The vsize used to calculate the fee must include this output.

Fee Rate Calculation

The fee rate is calculated as:

Fee Rate = Total Fee / Transaction Size (in vbytes)

Where Total Fee is the value of the Shield fee output.

Selecting the Right Fee Rate

Shield's /info endpoint provides fee rate recommendations based on the (estimated) cumulative fraction of the network's hashrate desired:

"fees": [
{
"estimated_hashrate": 0.12,
"feerate": 18.0
},
{
"estimated_hashrate": 0.27,
"feerate": 24.0
}
]

The estimated_hashrate value (0-1) represents the approximate percentage of Bitcoin hashrate that will accept your transaction at that fee rate.

Calculating Total Shield Fee

To calculate the total Shield fee:

  1. Determine your transaction size in vbytes (don't forget to account for signatures and the Shield fee output)
  2. Choose a fee rate from the /info endpoint
  3. Multiply to get your total fee:
Total Shield Fee = Transaction Size (vbytes) × Fee Rate (sats/vbyte)

Example Calculation

For a 250 vbyte transaction (including the Shield fee output) with a desired fee rate of 15 sats/vbyte:

Total Shield Fee = 250 vbytes × 15 sats/vbyte = 3,750 satoshis

Fee Optimization Tips

  • Use native SegWit addresses (bech32/P2WPKH) for smaller transaction sizes
  • Consolidate inputs when possible to reduce transaction size
  • Regularly check fee recommendations as they may change with network conditions
  • Consider transaction batching for multiple payments to reduce overall fees
  • Implement output amount calculations that account for the Shield fee output