Bitcoin Forum
May 27, 2024, 09:30:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Estimating Transaction Size (in bytes)  (Read 12236 times)
BradZimdack (OP)
Member
**
Offline Offline

Activity: 87
Merit: 12


View Profile
November 15, 2012, 01:31:46 AM
 #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?
lile
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
November 15, 2012, 07:04:08 AM
Last edit: November 15, 2012, 07:17:15 AM by lile
 #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.
someone42
Member
**
Offline Offline

Activity: 78
Merit: 10

Chris Chua


View Profile
November 15, 2012, 01:31:03 PM
 #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.
jainsanket662
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
September 09, 2014, 10: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
DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4656



View Profile
September 09, 2014, 12:48:01 PM
 #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?
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1032



View Profile WWW
September 10, 2014, 02:23:17 AM
 #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.
jainsanket662
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
September 10, 2014, 06: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)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!