Bitcoin Forum
December 01, 2023, 04:39:34 AM *
News: Latest Bitcoin Core release: 25.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Are transactions compressed?  (Read 150 times)
JasonWoods (OP)
Member
**
Offline Offline

Activity: 61
Merit: 11


View Profile
January 06, 2018, 12:33:08 PM
Merited by ETFbitcoin (1)
 #1

I've been playing around some with raw transactions; one of them had a size of 4401 bytes when signed. So for a test, I compressed it with bzip2, and the resulting (hex) was only 1680 bytes
Code:
cat signed.txt | bzip2 | openssl enc -base64 -A -out signedbz2.txt

That's almost a third of space that's saved, so the fee would go down noticeable too, and more transactions would fit into a block.

I know keys can be compressed, but what about a transaction itself?
1701405574
Hero Member
*
Offline Offline

Posts: 1701405574

View Profile Personal Message (Offline)

Ignore
1701405574
Reply with quote  #2

1701405574
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
ranochigo
Legendary
*
Offline Offline

Activity: 2842
Merit: 3843


Premium Bitcoin Mixer


View Profile
January 06, 2018, 01:07:22 PM
Merited by ETFbitcoin (2)
 #2

The reason for the public keys to be able to be compressed or uncompressed is due to the property of the ECDSA curve. The curve has the x and y coordinates but the compressed keys only specify the x coordinate and the client can figure out what is the correct y coordinate, of the two possible coordinates. This isn't computationally intensive and its easily implemented.

With transaction, it is a different case. If you were to compress it like that, the client would have to uncompress the transactions, every single time they validate it. Same thing with when someone mines a block. A side effect of this is the increase in the rate of transactions, which wouldn't be good, considering the tradeoff for it.

.
..M. MixTum.io ▀▄ Premium Bitcoin Mixer ▄▀ 
█████
██
██
██
██
██
██
██
██
██
██
██
█████
███████████████████████████████████████████████████████████████
.
MIX FREE
Up to 1mBTC
.
███████████████████████████████████████████████████████████████
█████
██
██
██
██
██
██
██
██
██
██
██
█████
████████████████████████
█████████████▀▀████████
████████████▀▄█████████
██████████▀▌▄██████████
██████████▌███████████
█████████▀▄███▀████████
██████▀▄▄██████▀███████
█████▀▄█▀▄████████████
██████▀▄█▌▐████▐█████
█████▌▐█▀▌▐█████▐█████
██████████████▄██████
███████▄██████▄████████
████████████████████████
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
January 06, 2018, 01:13:34 PM
 #3

Compression will be very useful for some specific transactions, but for most it will not, so it is not worth it.
If you ever tried compressing entire blockchain, you will quickly see why. It takes a lot of time and it results not so impressive decrease in size, not even half the original size.

Transactions use a lot of cryptography and in good cryptography results are most often very random looking.
This goes for signatures,keys, etc. It just tends not to be very secure if there is a pattern.
JasonWoods (OP)
Member
**
Offline Offline

Activity: 61
Merit: 11


View Profile
January 07, 2018, 09:54:11 AM
 #4

With transaction, it is a different case. If you were to compress it like that, the client would have to uncompress the transactions, every single time they validate it. Same thing with when someone mines a block. A side effect of this is the increase in the rate of transactions, which wouldn't be good, considering the tradeoff for it.
Compression will be very useful for some specific transactions, but for most it will not, so it is not worth it.

The transactions have to be decoded anyway, so pushing them through a bunzip2 should not be that dramatic.

In exchange, you could reduce fees to about a third and increase transactions per block 3 times (more or less, one would have to test with a significant number of transactions to get the average compression rate).

With fees going through the roof and tx/s being rather low, I don't see why increasing the tx rate would be bad.
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 342


View Profile
January 07, 2018, 11:22:13 AM
Merited by ETFbitcoin (6)
 #5

The transactions have to be decoded anyway, so pushing them through a bunzip2 should not be that dramatic.

In exchange, you could reduce fees to about a third and increase transactions per block 3 times (more or less, one would have to test with a significant number of transactions to get the average compression rate).

With fees going through the roof and tx/s being rather low, I don't see why increasing the tx rate would be bad.

There must be some soft facts, that were not yet expressed, which prevents from doing so. Where would compression/decompression affect the ecosystem?

- a full node at the initial load of blockchain: verifies each tx - so the time get's increased
- during creation of new blocks: each miner has to decompress the tx, adding a bit of time
- a small block with only a few tx will not benefit much (but currently vast majority of blocks are filled with a substantiate amount of tx)
- it might be a hardfork (ugh), or vice versa, serious thoughts must be put into making it a soft fork
(approach/thought/idea: similiar to the way, segwit tx are forwarded to non-segwit nodes, same logic could apply to compressed tx)

+ with Moore's law: processing power is increasing faster than network bandwidth, so a good point for compression
+ compression during transfer on the network: decreases the amount of data to be transferred, reducing load, reducing latency, positive network effects
+ for the "end user": reduced tx size reduces fees, a quick bargain at current times (but against interests of miners?)
+ the bigger blocks get (with many tx), the better size reduction is achieved

there are way more... 
I searched through the forum, if this wasn't discussed already. Nothing really found. Whenever such a topic is discussed, it quickly runs into overly complex discussion about possible implications in the future, which boils down into sovereignty over the interpretation of implications.

Only response to this would be a real "measurement": how much impact?
--> do a test setup and proof  Cheesy Grin
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!