Author

Topic: Estimating Transaction Size (in bytes) (Read 12259 times)

newbie
Activity: 2
Merit: 0
September 10, 2014, 01:27:45 AM
#7
Hi,

please tell me how to calculate transaction fee exactly??

suppose i have 5 BTC , Which i had received from different different addresses and now i want to send 2 BTC to another address,
then how to get transaction fee before sending it ?

please tell me the calculation of transaction fee and how do i calculate every time before sending amount.

Thanxs in advanced .  Embarrassed

What wallet program are you using?

We are using Bitcoin-qt (Bitcoin Core version V0 9.1.0.1)
legendary
Activity: 1512
Merit: 1036
September 09, 2014, 09:23:17 PM
#6
Hi,

please tell me how to calculate transaction fee exactly??

suppose i have 5 BTC , Which i had received from different different addresses and now i want to send 2 BTC to another address,
then how to get transaction fee before sending it ?

please tell me the calculation of transaction fee and how do i calculate every time before sending amount.

Thanxs in advanced .  Embarrassed

Your wallet program will choose previous payments seeming at random to make up your new payment, and it is the number of these payments that make up the data size of the transaction you will send and therefore the fee. Your wallet may choose to spend from one large previous payment, or it may take 50 dust payments and spend them all to make the transaction. Bitcoin Core will alert you to the specific fee that will be included when sending. Unless you have a relatively unused wallet, there is no way to predict what the size will be (Bitcoin attempts to minimize the change, not minimize the fee).

You can manually compose a payment if you want to get into the inner workings of Bitcoin transactions, but this is beyond the needs of most people.
legendary
Activity: 3472
Merit: 4801
September 09, 2014, 07:48:01 AM
#5
Hi,

please tell me how to calculate transaction fee exactly??

suppose i have 5 BTC , Which i had received from different different addresses and now i want to send 2 BTC to another address,
then how to get transaction fee before sending it ?

please tell me the calculation of transaction fee and how do i calculate every time before sending amount.

Thanxs in advanced .  Embarrassed

What wallet program are you using?
newbie
Activity: 2
Merit: 0
September 09, 2014, 05:15:31 AM
#4
Hi,

please tell me how to calculate transaction fee exactly??

suppose i have 5 BTC , Which i had received from different different addresses and now i want to send 2 BTC to another address,
then how to get transaction fee before sending it ?

please tell me the calculation of transaction fee and how do i calculate every time before sending amount.

Thanxs in advanced .  Embarrassed
member
Activity: 78
Merit: 11
Chris Chua
November 15, 2012, 08:31:03 AM
#3
According to the transaction fee rules, the size of the transaction is used to calculate fees (https://en.bitcoin.it/wiki/Transaction_fees).  From what I've read elsewhere, the size of the tx will be: 180 bytes per input + 34 bytes per output + 10 bytes.

However, while I've found that calculation to hold up most of the time, it doesn't seem to be accurate all of the time.  Is there a more reliable way to know how large a transaction will be so that appropriate fees can be assigned when creating a raw transaction?
As lile has pointed out, the size of signatures can vary.

In particular, for uncompressed public keys, there is:
  • a 25% chance each input is 179 bytes or smaller,
  • a 50% chance each input is 180 bytes,
  • a 25% chance each input is 181 bytes.
However, what makes a bigger difference is that if compressed public keys are used, each input is 32 bytes smaller.

If you want to set a conservative limit, 181 bytes per input + 34 bytes per output + 10 bytes seems like a good bet. This limit only applies to reasonably-sized (< 253 inputs and outputs) and standard (one signature required) transactions.
newbie
Activity: 41
Merit: 0
November 15, 2012, 02:04:08 AM
#2
According to the transaction fee rules, the size of the transaction is used to calculate fees (https://en.bitcoin.it/wiki/Transaction_fees).  From what I've read elsewhere, the size of the tx will be: 180 bytes per input + 34 bytes per output + 10 bytes.

However, while I've found that calculation to hold up most of the time, it doesn't seem to be accurate all of the time.  Is there a more reliable way to know how large a transaction will be so that appropriate fees can be assigned when creating a raw transaction?
There is no way of knowing in advance how big the signatures are going to be. You can try making several transactions and based on the size of those figure out how large the fee must be.

You could also use a conservative estimate for the size and have users in some cases pay a little bit more.
member
Activity: 87
Merit: 12
November 14, 2012, 08:31:46 PM
#1
According to the transaction fee rules, the size of the transaction is used to calculate fees (https://en.bitcoin.it/wiki/Transaction_fees).  From what I've read elsewhere, the size of the tx will be: 180 bytes per input + 34 bytes per output + 10 bytes.

However, while I've found that calculation to hold up most of the time, it doesn't seem to be accurate all of the time.  Is there a more reliable way to know how large a transaction will be so that appropriate fees can be assigned when creating a raw transaction?
Jump to: