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

node distri.js testnetblocks.txt
no blocks 5000
total size (bytes) 57563723
block average size (bytes) 11512.7446
hexadecimal digits counts
[
38667318, 5394405,
5048875, 4887831,
6779455, 5444886,
4586058, 4912363,
6969862, 5004919,
a: 5535784, b: 4808945,
c: 4537947, d: 3896688,
e: 4398336, f: 4253774
]
Many zeroes
node parts.js testnetblocks.txt
no blocks 5000
block headers size 4434741
[
160000, 160000, 100000,
160000, 160000, 160000,
1280000, 20000, 15000,
15000, 12887, 20000,
85000, 27963, 20000,
3428, 400000, 910464,
724999
]
Block Header Parts, size in bytes
  • 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.