Title: [CORRECTED] Script calculates 71% freeable transactions Post by: John Tobey on May 23, 2011, 07:05:33 AM "nobody has done studies of the existing block chain to see how much space could be reclaimed." --https://en.bitcoin.it/wiki/Scalability
So I gave it a go. I hope someone will check my logic, especially as I am new to Python. $ time src/bitcointools/freeable.py loaded 125925 blocks real 0m47.131s user 0m43.799s sys 0m2.744s $ ls -l .bitcoin/blk0*.dat -rw------- 1 jtobey jtobey 180119823 2011-05-23 00:42 .bitcoin/blk0001.dat (edited: fixed bug http://forum.bitcoin.org/index.php?topic=9461.msg137059#msg137059 (http://forum.bitcoin.org/index.php?topic=9461.msg137059#msg137059)) diff of bitcointools: Code: diff --git a/deserialize.py b/deserialize.py Title: Re: Script calculates freeable transactions Post by: ByteCoin on May 23, 2011, 10:27:20 AM 201085 of 544296 tx freeable 63328760 of 168627001 tx bytes freeable Good work! I hope I'll get around to checking it soon. One complication - Although you can throw away the transactions, you have to keep the Merkle hash tree stubs so that's roughly 32 bytes per transaction (because the tree height is low) which you have to store. ByteCoin Title: Re: Script calculates freeable transactions Post by: Mike Hearn on May 23, 2011, 11:33:26 AM Great work! Simulating the merkle tree collapse is probably much harder, but even so the fact that 36% can be deleted today is great. I'd expect that number to only go up as the economy picks up pace.
Could you update the wiki page with your findings? Title: Re: Script calculates freeable transactions Post by: John Tobey on May 23, 2011, 02:15:36 PM Great work! Simulating the merkle tree collapse is probably much harder, but even so the fact that 36% can be deleted today is great. I'd expect that number to only go up as the economy picks up pace. Could you update the wiki page with your findings? Updated: "As of May, 2011, the software does not implement pruning, and the savings are calculated {link here} at 37% of transactions or 35% of raw block bytes." I will not have time to calculate the Merkle tree prunings. I guess a lower bound is the transaction count times 32, and an upper bound is double that. Adding the former number to the freeable tx bytes and dividing by the raw file size gives me 38.7%, which is slightly higher than the rate in both transaction count and transaction bytes. This seems wrong to me, but I haven't given it serious thought. Title: Re: Script calculates freeable transactions Post by: John Tobey on May 23, 2011, 02:32:09 PM This seems wrong to me, but I haven't given it serious thought. OOH! Bug fix. "tx[txin['prevout_n']]" should be "tx[txin['prevout_hash']]". This improves the stats quite a bit: loaded 125925 blocks 387616 of 544296 tx freeable (71.2%) 123285900 of 168627001 tx bytes freeable (73.1%) (387616*32+123285900)/180119823 = 75.3%, still too high I suspect. Updating wiki... Title: Re: [CORRECTED] Script calculates 71% freeable transactions Post by: theymos on May 24, 2011, 02:43:44 AM I get similar numbers using BBE data. 391288 transactions and 124638004 bytes over 126191 blocks.
Title: Re: [CORRECTED] Script calculates 71% freeable transactions Post by: John Tobey on May 24, 2011, 01:25:48 PM I get similar numbers using BBE data. 391288 transactions and 124638004 bytes over 126191 blocks. Thanks for checking. |