Bitcoin Forum
April 16, 2024, 05:15:48 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Signed transaction length  (Read 331 times)
MaximC (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 2


View Profile
August 26, 2017, 10:01:37 AM
 #1

Hello all.

How short can be signed transaction in chars?
I have idea do it as short as possible, but don't know the formula.
Is there any function to make it shorter or delete unnecessary items?
Is Lightning transaction in same format?

Thank you
1713244548
Hero Member
*
Offline Offline

Posts: 1713244548

View Profile Personal Message (Offline)

Ignore
1713244548
Reply with quote  #2

1713244548
Report to moderator
1713244548
Hero Member
*
Offline Offline

Posts: 1713244548

View Profile Personal Message (Offline)

Ignore
1713244548
Reply with quote  #2

1713244548
Report to moderator
1713244548
Hero Member
*
Offline Offline

Posts: 1713244548

View Profile Personal Message (Offline)

Ignore
1713244548
Reply with quote  #2

1713244548
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713244548
Hero Member
*
Offline Offline

Posts: 1713244548

View Profile Personal Message (Offline)

Ignore
1713244548
Reply with quote  #2

1713244548
Report to moderator
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
August 26, 2017, 11:16:42 AM
 #2

I can tell you that a transaction with one input and two outputs (including a change address) is around 224 bytes (so I guess 224 chars as well). I don't think there is much variation in size for transactions with one input and two outputs.

I don't know about LN, but I assume those transactions are Segwit transactions which should mean that their signature is detached from the transaction itself. So it should be smaller, perhaps twice smaller, since that is what they say is a new virtual size of blocks.
MaximC (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 2


View Profile
August 26, 2017, 11:32:22 AM
 #3

I can tell you that a transaction with one input and two outputs (including a change address) is around 224 bytes (so I guess 224 chars as well). I don't think there is much variation in size for transactions with one input and two outputs.

I don't know about LN, but I assume those transactions are Segwit transactions which should mean that their signature is detached from the transaction itself. So it should be smaller, perhaps twice smaller, since that is what they say is a new virtual size of blocks.

Not really sure about 224 bytes...
I check right now some signed transactions and is it about 400 chars.
The best for "safe" reduce hex is base91 I think.
Then maybe is possible some parameters, which can be added after transmission.

Second option is entropy (https://en.wikipedia.org/wiki/Entropy_%28information_theory%29) for some parts of transaction. Not really sure about it.

For example in segwit:

01000000 version
0001 segwit flag (new)
01 number of inputs
fd461a7cf84bc4cae3427f25b547439910cce3fe0a6e86744d53bdc63e41a71900000000 input 1 txo id
00 input 1 dummy
ffffffff input 1 sequence/maturity lock
01 number of outputs
131cd90800000000 output 1 value
19 76a9141a0bde6a36b62dd42bb467e10c1217be277684bc88ac output 1 scriptPubKey
01 input 1 number of witness elements
6b 483045022100c30407ee492bf98c66b832ea22b78f02efc1b7925447d85b185c20f865afd399022 05ddae735daecd897abbb9d4d2c2820bdc45837301972a93fc2496cb07b0d629a012103fa91ab10 65b9730f795ea36fbc61117faf340ec35d663ddbe421236000fbeea8 input 1 witness 1
00000000 lock time

Put out version, lock time, etc...

Example segwit transaction:
0100000000010115e180dc28a2327e687facc33f10f2a20da717e5548406f7ae8b4c811072f8560 40000002322002001d5d92effa6ffba3efa379f9830d0f75618b13393827152d26e4309000e88b1 ffffffff0188b3f505000000001976a9141d7cd6c75c2e86f4cbf98eaed221b30bd9a0b92888ac0 2473044022038421164c6468c63dc7bf724aa9d48d8e5abe3935564d38182addf733ad4cd810220 76362326b22dd7bfaf211d5b17220723659e4fe3359740ced5762d0e497b7dcc012321038262a6c 6cec93c2d3ecd6c6072efea86d02ff8e3328bbd0242b20af3425990acac00000000

Is it 462 chars long
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
August 26, 2017, 12:44:49 PM
 #4

Oh that is what you meant by chars. In hex digits you meant.

Yeah two hex digits correspond to one byte so 462 digits can be written in 231 bytes.
So there you go.

I know that it variates a byte sometimes, but it could be possible that it sometimes variates 7 bytes as well, since I said it is 224 bytes. Tho I notice that if you remove first 12 digits that correspond to version and segwit flag you get 6 bytes less which is 225 bytes which I have seen often as well.
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!