<p>Big disclaimer: you really shouldn't do this. Transaction prioritization works based on fee per size, so that's what you should be configuring.</p>
<p>As for an explanation of what you're seeing: the block explorer you're using is showing the wrong size. For fee computations what you need is the <em>vsize</em>, not the serialized size. This is the size that takes the discount for witness data introduced by BIP141 (segwit) into account.</p>
<p>The vsize of your transaction is 141, not 222.</p>

CC BY-SA 4.0
2021-05-03T19:50:09.680Z
2021-05-03T19:50:09.680Z
Pieter Wuille
<p>I want to set fixed fee rate for transaction. I calculated tx size which is 222( <a href="https://blockchair.com/bitcoin/testnet/transaction/d8c00cc75dde9b1f29e0f06e9da766a8b24cd30e515ac50cd1533cc27a67ae87" rel="nofollow noreferrer">here is this tx</a>), called rpc <code>settxfee</code></p>
<pre><code>$o-&gt;settxfee(sprintf('%f', (0.00001/222)*1000));
</code></pre>
<p>and sent to the network. I supposed fee would set for tx to 0.00001 but set to 0.00000662 TBTC instead. Here is wallet info <code> &quot;paytxfee&quot;: 0.00004500,</code>, seems  <code>settxfee</code> worked as expected. What do I do wrong?</p>

CC BY-SA 4.0
2021-05-03T19:57:23.653Z
for some reason blockchair doesn't show vbytes for testnet as it does for mainnet, blockstream block explorer instead shows it: https://blockstream.info/testnet/tx/d8c00cc75dde9b1f29e0f06e9da766a8b24cd30e515ac50cd1533cc27a67ae87
leevancleef
<bitcoind>
settxfee: formula for fixed fee
Oleksandr IY
# settxfee: formula for fixed fee

(Asked by: username_0 on 2021-05-03)

I want to set fixed fee rate for transaction. I calculated tx size which is 222( here is this tx), called rpc settxfee
$o->settxfee(sprintf('%f', (0.00001/222)*1000));

and sent to the network. I supposed fee would set for tx to 0.00001 but set to 0.00000662 TBTC instead. Here is wallet info  "paytxfee": 0.00004500,, seems  settxfee worked as expected. What do I do wrong?

**Tags:** bitcoind

> **Comments:**
> **username_1**: for some reason blockchair doesn't show vbytes for testnet as it does for mainnet, blockstream block explorer instead shows it: https://blockstream.info/testnet/tx/d8c00cc75dde9b1f29e0f06e9da766a8b24cd30e515ac50cd1533cc27a67ae87  

---

## 1 answers

### Answer by username_2 on 2021-05-03. Score: 1 | Accepted answer

Big disclaimer: you really shouldn't do this. Transaction prioritization works based on fee per size, so that's what you should be configuring.

As for an explanation of what you're seeing: the block explorer you're using is showing the wrong size. For fee computations what you need is the *vsize*, not the serialized size. This is the size that takes the discount for witness data introduced by BIP141 (segwit) into account.

The vsize of your transaction is 141, not 222.


---

