Bitcoin Forum
May 26, 2024, 07:41:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to calculate size of transaction?  (Read 535 times)
bikerleszno (OP)
Hero Member
*****
Offline Offline

Activity: 656
Merit: 501


XBY - New Tech Coin (POSIGN) xtrabytes.global


View Profile WWW
February 08, 2017, 12:32:52 PM
 #1

Hello,

I know it is very important how big is transaction. I mean size of it. Generally if it comes from 1 to 2 inputs it is about 370 bytes.
Can you tell me is there any way to calculate how big will be transaction ?
We know more inputs, bigger size but we need to know how big fee we need to put.

Is there any way to calculate it ?
What is the maximum inputs transaction you ever saw ?

XBY - New Technology Coin (POSIGN) - https://xtrabytes.global
Telegram Group - https://t.me/xtrabytes_official
mocacinno
Legendary
*
Offline Offline

Activity: 3402
Merit: 4984


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
February 08, 2017, 12:36:29 PM
 #2

Hello,

I know it is very important how big is transaction. I mean size of it. Generally if it comes from 1 to 2 inputs it is about 370 bytes.
Can you tell me is there any way to calculate how big will be transaction ?
We know more inputs, bigger size but we need to know how big fee we need to put.

Is there any way to calculate it ?
What is the maximum inputs transaction you ever saw ?

EDIT: Please read DannyHamilton's post (right beneith this one). Seems like my info is a bit on the old side (you learn something new every day Wink )


You can't really calculate it, but you can make an estimation this way:

in*180 + out*34 + 10 plus or minus 'in'*

* source: http://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending

This is valid for "standard" P2PKH transactions. Offcourse, it's still an estimation.

For example, a transaction with one input and two outputs (one output to the receiver, one output to your change address):

1*180+2*34+10 +/-1 = estimated size between 257 and 259 bytes.
https://bitcoinfees.21.co/ tells us that at time of writing 140 satoshi's per byte will give you a 90% chance of getting into one of the next 3 blocks.
Personally, i don't mind waiting 3 hours, so i'd go for a 61-80 satoshi/byte fee... 259 * 61 =~ a 0.00016 BTC fee would probably be enough if you don't mind waiting for a couple of hours.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4656



View Profile
February 08, 2017, 12:40:26 PM
 #3

you can make an estimation this way:

in*180 + out*34 + 10 plus or minus 'in'*

* source: http://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending

That information is old and no longer accurate.

Most modern wallets and services use compressed key addresses.  If you received the bitcoins at a compressed key address (which you probably did), then each input is between 147 and 149 bytes (not 180).

Outputs are still typically 34 bytes each (there may be a variation of a few bytes if you are not sending to a P2PKH address), and there is still 10 bytes of overhead per transactions.
bikerleszno (OP)
Hero Member
*****
Offline Offline

Activity: 656
Merit: 501


XBY - New Tech Coin (POSIGN) xtrabytes.global


View Profile WWW
February 08, 2017, 12:48:23 PM
 #4

Thank you for info.

XBY - New Technology Coin (POSIGN) - https://xtrabytes.global
Telegram Group - https://t.me/xtrabytes_official
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!