Now I have a command line tool to export block data (read Command Line Tools for RSK Node), I can explore the block data. I exported 5000 blocks from live testnet (from height 718_000 to 722_999), and wrote two simple nodejs scripts.

First Analysis

I executed

The output:

Some blocks are empty; others have more than 150 smart contract transactions. The average block size is, then, 11K. It’s only an informal result, over a short range of blocks. The array at the end of the above output shows the count of each hexadecimal digit. A graphic:

Many zeroes

First result: most of the bytes are zeroes.

Block Header Analysis

Then, I executed:

It analyze the blocks headers. The output:

So, the average block header size is less than 1K. The array has the byte size of each block header part. A graphic:

Block Header Parts, size in bytes

Notably, the “heavy” parts are:

  • Bloom filter: 256 bytes, many of them are zeroes.
  • BTC Merkle Proof: generated in merge mining process
  • BTC Coinbase Transaction: generated in merge mining process
  • BTC Header: 80 bytes each

Pending Work

Analyze the transactions and the uncles. I expect that the uncles show a similar distribution to block header. Locate where are the zeroes: only in the headers, in transactions, in uncles? Analyze the size of the block depending on number and kind of transactions, and number of uncles.

Possible Improvements

Although the key value store (in this case LevelDB) could compress this information (using snappy, like in geth), it could be better don’t depend on that feature. Also, a better encoding could allow shorter network messages.

First proposal: encode the bloom filter in an efficient way (I have code in my blockhain personal project, see Bloom, BloomEncoder and their tests). And although it is not in the block, a lot of bloom filter are generated in the transactions receipts (to be analyzed).

The information regarding merge mining with Bitcoin, could be improved, maybe with some zero knowledge proof, but I’m not sure about this.

Angel “Java” Lopez