Author

Topic: How to know the size of transaction before you send using electrum? (Read 1418 times)

hero member
Activity: 854
Merit: 1009
JAYCE DESIGNS - http://bit.ly/1tmgIwK
How? If I save that string to a file, the file will be 409 bytes, the 408 + 1 end of line character.

I think that's because text files uses encoding (UTF-8, 8-bits ASCII, etc) that puts the minimal size per character to 1 byte (or more for other encodings) even though they're actually smaller to make it readable. Non-text files created by programming like blockchain files stores the data in binary which make things nigh unreadable if you open them with text editor (but you can read the hex if you open them with hex editor).

Yes that is a good explanation, binary encoding is more efficient, thanks.

How? If I save that string to a file, the file will be 409 bytes, the 408 + 1 end of line character.

I think that's because text files uses encoding (UTF-8, 8-bits ASCII, etc) that puts the minimal size per character to 1 byte (or more for other encodings) even though they're actually smaller to make it readable. Non-text files created by programming like blockchain files stores the data in binary which make things nigh unreadable if you open them with text editor (but you can read the hex if you open them with hex editor).

or maybe it is because he is looking at the "size on disk" instead of size. the size on disk is 446 bytes of hex which is twice the byte value when sent aka 223 bytes (what blockchain.info in the link he quoted is showing by the way)

I dont really know which one is what, but yes try converting the text file into binary and then it will shink in size to the TX size.



Text file = 408 bytes + 1 byte EOF character

Bin file = 204 bytes (it's the TX size)
legendary
Activity: 3472
Merit: 10611
How? If I save that string to a file, the file will be 409 bytes, the 408 + 1 end of line character.

I think that's because text files uses encoding (UTF-8, 8-bits ASCII, etc) that puts the minimal size per character to 1 byte (or more for other encodings) even though they're actually smaller to make it readable. Non-text files created by programming like blockchain files stores the data in binary which make things nigh unreadable if you open them with text editor (but you can read the hex if you open them with hex editor).

or maybe it is because he is looking at the "size on disk" instead of size. the size on disk is 446 bytes of hex which is twice the byte value when sent aka 223 bytes (what blockchain.info in the link he quoted is showing by the way)
hero member
Activity: 629
Merit: 501
Experientia docet
How? If I save that string to a file, the file will be 409 bytes, the 408 + 1 end of line character.

I think that's because text files uses encoding (UTF-8, 8-bits ASCII, etc) that puts the minimal size per character to 1 byte (or more for other encodings) even though they're actually smaller to make it readable. Non-text files created by programming like blockchain files stores the data in binary which make things nigh unreadable if you open them with text editor (but you can read the hex if you open them with hex editor).
hero member
Activity: 854
Merit: 1009
JAYCE DESIGNS - http://bit.ly/1tmgIwK

Just copy that long hex code into a word editor and you can see how many bytes there are. Usually 1 character = 1 byte. Exclude the spaces and tabs.

For example the example above is 408 character and therefore it's 408 byte.

Quote
Well 1 hex = 4 bits and 4 bits = 0.5 byte so just dividing the number of hex character by 2 should get you the size.

It's 204 bytes.

It'll get bigger when it's signed btw.
https://blockchain.info/tx/963216dad3a1af2296e399f2e29dce52b348f02ecf387598247023f3707bc24c

How? If I save that string to a file, the file will be 409 bytes, the 408 + 1 end of line character.
hero member
Activity: 629
Merit: 501
Experientia docet

Just copy that long hex code into a word editor and you can see how many bytes there are. Usually 1 character = 1 byte. Exclude the spaces and tabs.

For example the example above is 408 character and therefore it's 408 byte.

Quote
Well 1 hex = 4 bits and 4 bits = 0.5 byte so just dividing the number of hex character by 2 should get you the size.

It's 204 bytes.

It'll get bigger when it's signed btw.
https://blockchain.info/tx/963216dad3a1af2296e399f2e29dce52b348f02ecf387598247023f3707bc24c
hero member
Activity: 854
Merit: 1009
JAYCE DESIGNS - http://bit.ly/1tmgIwK
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.


Save the transaction file to your desktop before broadcasting, and look at the byte size of the file itself.

I mean the real size not the size on disk as in Windows, you want to look at the real size.

So if you open it with a text editor it should be visible how many bytes there are composed of. Then you see how much the size is.
It doesn't really work. The .txn file actually includes additional words which will inflate the size slightly.

Even if you copy out the raw transaction, it would seem to be bigger than the actual size.

But where i can get that file in electrum? so i need to preview and sign and don't broadcast but the problem where i can see that file like you metion.. i tried to find it in electrum folder but i do not know if what file..
Press save and you can save it and use a text editor to open it.
Now i found it now how do i know it since i just saw the hex codes.. how do i know the size or there is some software to decrypt the hex code?
Code:
    "hex": "01000000014cc27b70f3237024987538cf2ef048b352ce9de2f299e39622afa1d3da163296000000005701ff4c53ff0488b21e000000000000000000ee43c49b1c67efc72ef560b725feb9ebdb882ddcf8f8737f6d1b8483683c1a5603d65a4e739b87d3ec7ce7edeaf23660db02566b7b978d95e4ce9f9e645bc51b3001002c00ffffffff020b550000000000001976a91459275cec98772c20867cab83ee633956b118784288ac94bd00000000000017a914d2a90181bd395f850baf44059fd6b7db592861028700000000", 
    "complete": false,
    "final": true
}
I just already decode the hex but i cant read the result..

Just copy that long hex code into a word editor and you can see how many bytes there are. Usually 1 character = 1 byte. Exclude the spaces and tabs.

For example the example above is 408 character and therefore it's 408 byte.
hero member
Activity: 924
Merit: 1001
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.


Save the transaction file to your desktop before broadcasting, and look at the byte size of the file itself.

I mean the real size not the size on disk as in Windows, you want to look at the real size.

So if you open it with a text editor it should be visible how many bytes there are composed of. Then you see how much the size is.
It doesn't really work. The .txn file actually includes additional words which will inflate the size slightly.

Even if you copy out the raw transaction, it would seem to be bigger than the actual size.

But where i can get that file in electrum? so i need to preview and sign and don't broadcast but the problem where i can see that file like you metion.. i tried to find it in electrum folder but i do not know if what file..
Press save and you can save it and use a text editor to open it.
Now i found it now how do i know it since i just saw the hex codes.. how do i know the size or there is some software to decrypt the hex code?
Code:
    "hex": "01000000014cc27b70f3237024987538cf2ef048b352ce9de2f299e39622afa1d3da163296000000005701ff4c53ff0488b21e000000000000000000ee43c49b1c67efc72ef560b725feb9ebdb882ddcf8f8737f6d1b8483683c1a5603d65a4e739b87d3ec7ce7edeaf23660db02566b7b978d95e4ce9f9e645bc51b3001002c00ffffffff020b550000000000001976a91459275cec98772c20867cab83ee633956b118784288ac94bd00000000000017a914d2a90181bd395f850baf44059fd6b7db592861028700000000", 
    "complete": false,
    "final": true
}
I just already decode the hex but i cant read the result..
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.


Save the transaction file to your desktop before broadcasting, and look at the byte size of the file itself.

I mean the real size not the size on disk as in Windows, you want to look at the real size.

So if you open it with a text editor it should be visible how many bytes there are composed of. Then you see how much the size is.
It doesn't really work. The .txn file actually includes additional words which will inflate the size slightly.

Even if you copy out the raw transaction, it would seem to be bigger than the actual size.

But where i can get that file in electrum? so i need to preview and sign and don't broadcast but the problem where i can see that file like you metion.. i tried to find it in electrum folder but i do not know if what file..
Press save and you can save it and use a text editor to open it.
hero member
Activity: 924
Merit: 1001
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.


Save the transaction file to your desktop before broadcasting, and look at the byte size of the file itself.

I mean the real size not the size on disk as in Windows, you want to look at the real size.

So if you open it with a text editor it should be visible how many bytes there are composed of. Then you see how much the size is.
But where i can get that file in electrum? so i need to preview and sign and don't broadcast but the problem where i can see that file like you metion.. i tried to find it in electrum folder but i do not know if what file..
hero member
Activity: 854
Merit: 1009
JAYCE DESIGNS - http://bit.ly/1tmgIwK
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.


Save the transaction file to your desktop before broadcasting, and look at the byte size of the file itself.

I mean the real size not the size on disk as in Windows, you want to look at the real size.

So if you open it with a text editor it should be visible how many bytes there are composed of. Then you see how much the size is.
legendary
Activity: 3472
Merit: 10611
the transaction size is the number of Unconfirmed Transaction Outputs (UTXOs) that you include in your transaction to spend (these are those transactions that you see when you check your balance on an online block explorer) and before you sign the transaction you don't know the real size of it but you can make an estimate based on experience.

every output (think of it as number of addresses that you send to) adds approximately 34 bytes (8 byte amount + 1 byte pk_script length + 25 byte pk_script)

every input adds approximately 180 bytes (32 byte TX hash + 4 byte output Index + 1(or more) byte scriptSig length + ~140 byte scriptSig + 4 byte - sequence)

add to this 10 bytes (4 byte version + 1(or more) tx_in count + 1(or more) tx_out count + 4 byte lock time)

The result for 1 input and 2 outputs is 180 + 34 + 34 + 10 = ~258 bytes example
remember that many of these sizes are approximate like scriptSig bytes

reference: https://bitcoin.org/en/developer-guide#transactions
hero member
Activity: 629
Merit: 501
Experientia docet
There's no way to do it in electrum I'm afraid. Which is why we're suggesting alternative ways.

You can already put a manual fee per KB from Tools > Preferences. 10 satoshi/byte is 0.0001/KB, 50s/b is 0.0005/kb, etc.

You can also use it to calculate the size of your tx by dividing the recommended fee by your fee per KB and multiply it by 1000.
So if you get recommended 0.000113 and your fee per kb is 0.0005 that's 0.000113/0.0005*1000 = 226 bytes transaction. I don't think there's an easier way to calculate it.
This one is for setting or manually change the fee but i am looking for a way that before you send you can see first the transaction size before you send..

You don't need to send to see the recommended fee.
hero member
Activity: 924
Merit: 1001
You can already put a manual fee per KB from Tools > Preferences. 10 satoshi/byte is 0.0001/KB, 50s/b is 0.0005/kb, etc.

You can also use it to calculate the size of your tx by dividing the recommended fee by your fee per KB and multiply it by 1000.
So if you get recommended 0.000113 and your fee per kb is 0.0005 that's 0.000113/0.0005*1000 = 226 bytes transaction. I don't think there's an easier way to calculate it.
This one is for setting or manually change the fee but i am looking for a way that before you send you can see first the transaction size before you send..


Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.
I have an idea.

Use the preview option on the send tab. Sign the tx. Then use the copy option to copy the hex code. What next? Is the hex code saved to an ascii text file going to use the same amount of space as on the blockchain? i'm not sure but maybe this will get you half way there.

It is a long way method to see the size of transaction do you have any methods that easy to do. or other method that you can easily seen it using electrum..
hero member
Activity: 629
Merit: 501
Experientia docet
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.
I have an idea.

Use the preview option on the send tab. Sign the tx. Then use the copy option to copy the hex code. What next? Is the hex code saved to an ascii text file going to use the same amount of space as on the blockchain? i'm not sure but maybe this will get you half way there.

Well 1 hex = 4 bits and 4 bits = 0.5 byte so just dividing the number of hex character by 2 should get you the size.
Or since it's already signed you can just decode from https://coinb.in/decode-raw-transaction.html.
legendary
Activity: 3682
Merit: 1580
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.
I have an idea.

Use the preview option on the send tab. Sign the tx. Then use the copy option to copy the hex code. What next? Is the hex code saved to an ascii text file going to use the same amount of space as on the blockchain? i'm not sure but maybe this will get you half way there.
hero member
Activity: 629
Merit: 501
Experientia docet
You can already put a manual fee per KB from Tools > Preferences. 10 satoshi/byte is 0.0001/KB, 50s/b is 0.0005/kb, etc.

You can also use it to calculate the size of your tx by dividing the recommended fee by your fee per KB and multiply it by 1000.
So if you get recommended 0.000113 and your fee per kb is 0.0005 that's 0.000113/0.0005*1000 = 226 bytes transaction. I don't think there's an easier way to calculate it.
hero member
Activity: 924
Merit: 1001
Hi guys i would like to ask if how we can know the size of transaction before we send bitcoin to the target address. so that i can put my manual fee for better speed of my transaction..  i notice sometimes my transaction with the same amount but different size that actually it takes time before its confirm.. So i am looking how to know it but i could not find it.
Jump to: