Memo.cash math: How big do blocks need to be to handle twitter on-chain?
The new twitter-like memo.cash has gotten a lot of attention since it has been released a couple of days ago, and created a lot of enthusiasm and excitement.
I mean, how cool is that? A social network, on-chain, completely uncensorable? This is exactly what we need in times of Orwellian hate-speech laws and ZUCC memes.
But among the enthusiasm was also a nagging voice, saying, Well this may be great for adoption in the short run, but won't it bloat the blockchain to an unbearable size? Twitter handles millions of tweets per day. Blocks will fill up too fast and the network either collapses or only a handful of miners will be able to validate the chain anymore.
This question bugged me, too, therefore I set myself the task to examine the following question: How large would blocks have to get to handle the entire Twitter load?
So let's get some numbers. I had to gather some data myself, which can be found in behind the paywall.
Twitter has a lot of tweets
Twitter handles 500,000,000 tweets per day. So we just multiply that by the size of a memo, right?
The sizes on the description of memo's protocol are wrong, at the time of writing. I had to measure it myself: A “follow user” action takes 20 bytes as address, not 32, and a “like“ action takes 32 bytes as transaction hash, not 20.
The size of a memo is dependent on the number of characters used in the memo, which is 76 at most. However, in this May's hard-fork, the OP_RETURN opcode will be able to handle 220 instead of 80 bytes - this means Memos can be up to 216 characters!
To illustrate this size, the following quote from the bitcoin whitepaper would be 76 characters:
A purely peer-to-peer version of electronic cash would allow online payments
Whereas this one would be 216 characters:
With the possibility of reversal, the need for trust spreads. Merchants must be wary of their customers, hassling them for more information than they would otherwise need. A certain percentage of fraud is accepted as
Much longer, much more useful! (the remainder of the last sentence would be “unavoidable.”, btw.)
That means that we should take this lifted limit into account. A memo is 206 bytes + number of characters used. If we have 150 characters per memo (on average) that's 356 bytes per memo.
This means that the Bitcoin Cash blockchain would grow by 178 GB each day, which would means a block size of 1236 MB.
That sounds... Oddly realistic? The Gigablock Testnet Initiative already mined a 1 GB block, so 1,2 GB should be fine in the near future! Considering this is Twitter, I mean, Twitter, that's pretty impressive, to say the least.
Let's take likes into account
However, we can also like tweets, as we can do with memos. There's no official number on how many likes a tweet receives on average, so I gathered some data myself. I collected 1,252,199 tweets containing the words the, be, to, of, and and a, the most common English words (you can't just get any tweets using the Twitter API).
The tweets had to be some time ago, such that enough people could like them, therefore I only collected until one week ago (the maximum for free users). This way I could (mostly) only collect English tweets, which are 42.9% of users, so we'd have around 214,000,000 English tweets.
463,383 tweets had no likes, one tweet had 4,587,067 likes (which actually isn't a week ago, but I didn't write Twitter's API. After double checking, excluding those older ones had little influence on the number of likes). The median was 16 likes and the average was 8,737 likes. It looked like a Pareto distribution to me, which is logical, since tweets that already have a lot of exposure gain even more exposure by that. The average number of retweets was 3,606. If someone got better numbers or a better way to acquire them, leave a comment :)
Now to the size of the blockchain with memo.cash if we include likes.
A like for a memo is 238 bytes (if it has a tip, it's 271 bytes). If a tweet, on average, has 8,737 likes, that means we have ...
50 of 50 reviewers say it's worth paying for
0 of 50 reviewers say it's not worth paying for