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?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.