2

I set transaction fee with :

$ bitcoin-cli settxfee 0.00003000

Here is what i observe from block explorer for my transaction : https://testnet.blockexplorer.com/tx/789d578d22ee07e11ceca9e94aacbf51d36a41223f792035cac26e91830f39c3

Fee Rate    0.000036 BTC per kB

I've tested with different transaction fees for several times; difference always 20% more.

I am on testnet3; using bitcoind version 0.16.0

Edit :

As Adam's answer; now i am more skeptical about byte calculation of blockchain monitoring sites (or whatever they are called).

I've inspected my transaction with getransaction call. But i still dont see fee per kB is matching with calculation. According to hex parameter; it should be 250 bytes. So total fee should be 0.00000750. Shouldn't i take hex parameter as size of transaction?

If adam's calculation correct; (seem like it is) then 180 * 0.00003000 / 1024 = 0.00000527. Closest answer so far with %4.5 difference.

Is my calculation correct?

bitcoin-cli gettransaction 789d578d22ee07e11ceca9e94aacbf51d36a41223f792035cac26e91830f39c3
{
  "amount": -0.00005000,
  "fee": -0.00000504,
  "confirmations": 190,
  "blockhash": "0000000000000287661d724d67bed9c1a8861179413e056ee0d16a8b132ad380",
  "blockindex": 12,
  "blocktime": 1527979564,
  "txid": "789d578d22ee07e11ceca9e94aacbf51d36a41223f792035cac26e91830f39c3",
  "walletconflicts": [
  ],
  "time": 1527979516,
  "timereceived": 1527979516,
  "bip125-replaceable": "no",
  "details": [
    {
      "account": "",
      "address": "momFk8PtAZoN4j7Y6jnbucEfc6teUKECEB",
      "category": "send",
      "amount": -0.00005000,
      "vout": 0,
      "fee": -0.00000504,
      "abandoned": false
    }
  ],
  "hex": "020000000001014bb52fb3493598763b53d5ba3cb41f2486cd1ec1b61bae2727d2b9fc74a7454800000000171600148febee6ac4a40d4474c2665c77bbf02350d1bb63feffffff0288130000000000001976a9145a756559278c3795092c07f49c6cf47d360bb1be88acc7c70f000000000017a914849901fe3e003ebf5be1afaf737305158d8865a58702483045022100e23a7e22a21da25f3363bbccbe0bfc94f8044e48236f20b595a456f6bc6d708b02206fc6acdc3636904458cd81770a346a75cc7d5e8ad3868168e387c9cff521b9680121038dc51cc27a4ae2f7ae52503ae4a23862cde107001b59a65639522925527a3e4788291400"
}
  • It's likely a difference between fee calculation using segwit and non-segwit sizes. – Raghav Sood Jun 3 '18 at 1:20
1

The problem is not with bitcoin core, it's definitely of the block explorer.

Transaction size is 104 + 32 + 34 + 10 = 180 byte, they are saying transaction size 140 byte. I don't understand how did they calculate it.

Blockchain.info saying transactions size is 250

You should not trust them for that matters, try

bitcoin-cli gettransaction 789d578d22ee07e11ceca9e94aacbf51d36a41223f792035cac26e91830f39c3

and see transaction size.

| improve this answer | |
  • You are right. But still i coundnt reach the exact calculation. I have shared output of gettransaction call. – Kerem atam Jun 3 '18 at 10:03
  • You can't reach exact calculation because transaction header size isn't always 10 byte and input size as well, take a look at this answer here – Adam Jun 3 '18 at 11:49
  • Got it! How about bitcoin-cli command output. I cant see 180 but 250 as blockchain.info – Kerem atam Jun 3 '18 at 14:38
  • 2
    The size that matters is the virtual size (or 1/4th of the weight), which takes the SegWit discount into account), not the byte size. – Pieter Wuille Jun 3 '18 at 17:08
  • 1
    Weight is defined in BIP141 as 3*bytes_when_serialized_without_witnesses + bytes_when_serialized_with_witnesses. – Pieter Wuille Jun 3 '18 at 21:45

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.