Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: chemodan on February 28, 2017, 04:57:01 AM



Title: What determines transaction size?
Post by: chemodan on February 28, 2017, 04:57:01 AM
Sometimes transaction size is 1847 bytes and sometimes 225 bytes . What does it depend? And how learn what will be transaction size before transaction to put proper fee?


Title: Re: What determines transaction size?
Post by: Coding Enthusiast on February 28, 2017, 05:15:14 AM
Number of tx_ins and tx_outs
In other words if you have multiple outputs (UTXO or transactions to spend) and if you are paying to multiple keys (sending bitcoin to many bitcoin addresses) your transaction size is bigger.
https://bitcoin.org/en/developer-guide#transactions

You can read about the structure of a transaction here (Raw Transaction Format) https://bitcoin.org/en/developer-reference#raw-transaction-format

So when you are spending 1 output and creating 1 new output your transaction size becomes ~225 bytes
example: https://blockchain.info/tx/ee33588fced298248c9e693b4eee72e2aae6963381b63cf5850ba2e94abe2d90?show_adv=true

But when you are spending multiple outputs (for example 10) and create 1 new output your transaction size becomes 1847 (with uncompressed private keys will be smaller with compressed)
Example of 1 output to multiple:
https://blockchain.info/tx/db8b1751c00bce986f833022fb4ed4b55406597eb0c11ad0fb8347765ddbdf39?show_adv=true
Example of multiple outputs:
https://blockchain.info/tx/16398c9e7261ec72c09bc5e5b712049882a7f857e363f9ac591e5a53cf37b410?show_adv=true
* These two were taken from the last block mined

And how learn what will be transaction size before transaction to put proper fee?

Use a wallet that tells you how much fee is appropriate, there is no need for you to "learn" what the transaction size will be.


Title: Re: What determines transaction size?
Post by: jonald_fyookball on February 28, 2017, 05:15:19 AM
Sometimes transaction size is 1847 bytes and sometimes 225 bytes . What does it depend? And how learn what will be transaction size before transaction to put proper fee?

it mostly depends on how many inputs you have.  If you have a lot of different change addresses in your wallet, and your wallet has to use many of them, it will make the size
bigger.  Presumably, a good wallet should tell you the appropriate fee but in this era of congestion, it becomes more difficult to calculate as it is dynamic.

Check this:

https://bitcoinfees.21.co/



Title: Re: What determines transaction size?
Post by: n0ne on February 28, 2017, 05:40:42 AM
It depends upon the transaction fee input to the transaction to the number of output it makes on the particular transactions.