Mining Bitcoins just became worse

Clubhouse 0 to $100m in months, on work from home, and how video games are made

Bitcoin mining rewards dropped by 50% this week

The reward for mining a Bitcoin block dropped to 6.25 Bitcoins from 12.5 earlier this week. It comes out to be just over USD 58,000 at the current market rate. This was nothing extraordinary as the decay in rewards every 210,00 blocks mined (about 4 years) is built in the Bitcoin specification itself, with the next one scheduled to be in 2024. Amusingly, the coinbase parameter of the block which can be used by the miner who proposed the block to just write anything has the following content -  ‘NYTimes 09/Apr/2020 With $2.3T Injection, Fed’s Plan Far Exceeds 2008 Rescue.’ This was a reference to the fact that the genesis block of the bitcoin, mined back in January 2009 by Satoshi Nakamoto had the following data - ‘The Times 03/Jan/2009 Chancellor on brink of second bailout for banks’.

Cypherpunks, Bitcoin and genesis

On 31 October 2008, someone, or a group of people under the pseudo-name of Satoshi Nakamoto (though it is more likely to be just one person) announced the Bitcoin project on The Cryptography mailing list, one of the successors to the Cypherpunks mailing list (explained later). The email starts with this -

I've been working on a new electronic cash system that's fully
peer-to-peer, with no trusted third party.

The paper is available at:
http://www.bitcoin.org/bitcoin.pdf

The main properties:
Double-spending is prevented with a peer-to-peer network.
No mint or other trusted parties.
Participants can be anonymous.
New coins are made from Hashcash style proof-of-work.
The proof-of-work for new coin generation also powers the
network to prevent double-spending.

Ever since Bitcoin has had its fair share of critics and blind supporters. The pseudo-anonymity of its creator, the volatility of its price in fiat currencies, the creation of enormous value out of thin air for miners which made it look like a gold rush, all of these have attracted a lot of media frenzy and public attention.

It is worthwhile to mention the Cypherpunk movement that started in the early 90s. This was also a time when the export of cryptographic technologies from the US was strictly restricted. A bunch of smart, passionate computer science people formed a group advocating social and political change using cryptography, on a mailing list and meetups. Ideas ranged from the right to preserve one’s privacy to minimal government interference in the lives of citizens, to a way to transact using digital currencies without the involvement of the government as the central authority. Members of the list later went on to create some of the most important tools for privacy that are in existence today. It is worthwhile to read a Wired article that appeared in 1993, part of which is reproduced below -

The obstacles are political—some of the most powerful forces in government are devoted to the control of these tools. In short, there is a war going on between those who would liberate crypto and those who would suppress it. The seemingly innocuous bunch strewn around this conference room represents the vanguard of the pro-crypto forces. Though the battleground seems remote, the stakes are not: The outcome of this struggle may determine the amount of freedom our society will grant us in the 21st century. To the Cypherpunks, freedom is an issue worth some risk.

The Bitcoin specification probably did not have any single original research idea. What it did have was a magical symphony of existing ideas, including from similar projects that failed to take off and it fixed those issues. It also helped that the creator chose to code the system themselves and publicize it instead of simply writing an academic paper and leaving it to that. In fact, in an email to Hal Finney (a cryptographer and activist who unfortunately died in 2014 of ALS) on The Cryptography mailing list, Satoshi writes -

I actually did Bitcoin kind of backwards. I had to write all the code before I could convince myself that I could solve every problem, then I wrote the paper.

There are a limited number of key ideas which anyone needs to understand here. First, Bitcoin is a scarce resource by design. There would eventually be only 21 million coins generated, ever. A transaction on Bitcoin is pseudo-anonymous in the sense that identity in the form of a public key is required, but it is not tied to your real-world identity. You could generate hundreds of pairs of public and private keys and use the corresponding public keys as identities for different transactions. A Bitcoin address is a hash of the public key. There is no concept of a table or a database to maintain the balances of the respective addresses. Instead, there is a publicly-available append-only record, composed of blocks of multiple transactions, stored in the form of a list, starting all the way from block 0, the genesis block.

For readers with a computer science background, the data structure used is a blockchain, a modified linked list where instead of regular pointers, we use hash pointers which are simply pointers with the cryptographic hash of the data stored alongside. A hash pointer allows a way to test for the integrity of the data. If the underlying data has been tampered with, recomputing the hash would produce a different value than the hash pointer. The individual blocks themselves are up to 1 MB in the form of a sorted Merkle tree, which is simply a binary tree with the normal child pointers replaced by hash pointers, the leaves being the hashes of the data blocks. The sorted Merkle tree allows a log n time test of membership of a transaction in the tree. We simply need to store the head hash pointer and the whole chain can be verified.

The Bitcoin network is decentralized. It means a bunch of peer-to-peer nodes maintain, verify, and append to the blockchain, and peers ask around for the information that they do not have. A lot of concepts in Bitcoin including security are based on consensus which is primarily driven by incentives. The nodes that simply store the blockchain information are not compensated in any way to do so. There are additional nodes called miners that validate transactions and propose new blocks of transactions to be added to the blockchain. Miners are incentivized in the form of a reward for proposing a block. This has been reduced to 6.25 BTC from this week. There is an inbuilt method to adjust the ‘difficulty’ of mining new blocks so that a block is only found approximately every 10 minutes, no matter how the other parameters change. This limits the number of transactions that the Bitcoin network can process to about 7 per second, one of the key bottlenecks of the system. Apart from user-to-user transactions, Bitcoin supports escrow transactions (having the funds in a separate location, having an intermediary for conflicts and major voting to complete the transfer.) and a way to have micropayments without prohibitive transaction fees. This is achieved using a simple builtin scripting language that supports various primitives.

The basics of Bitcoin mining

Proof-of-work as a concept was conceived by Cynthia Dwork and Moni Naor in 1993. (Coincidentally, Prof. Dwork has been awarded the Knuth Prize 2020 for her work on cryptography and data privacy this week!) The concept was that to deter email spam in 1993, let every device sending the mail do some computation before they can send the mail. Since legitimate users do not send hundreds of emails per hour, it was not really an issue but it would increase the cost of sending mass emails for spammers. Bitcoin uses the Hashcash proof-of-work system with the SHA256 crypto hash function. A crypto hash function takes an arbitrary length of input and generates a fixed-length output, generally much smaller than the input with some of these properties - you cannot find two messages with the same hash output, given a hash output you cannot find a message that generates that and changes in the input should not have a correlated change in the output. The basic idea in Bitcoin’s proof-of-work involves finding an arbitrary value called a nonce, that when combined with hash values of the outstanding transactions, and some other fixed inputs and then applying the SHA256 function (twice for some reason), produces a hashed output which is less than a certain target. This is the puzzle that all miners are solving.

Since there is no clever way to find the nonce, the only way is to try all possible values. The number of trials required is huge (trillions of hashes per second) The difficulty of the problem can be adjusted by adjusting the target. This adjustment happens every 2016 blocks in Bitcoin (around two weeks), so as to keep the time to generate a new block around 10 minutes. This essentially solves the problem of having a central authority to select a random node that gets to propose a new block and pocket the mining reward. Nodes with higher compute capacity have higher chances of finding such a nonce and thus get rewarded more frequently. (Statistically inclined people might find this similar to a Poisson process.)

In essence, miners keep on solving this hash puzzle along with receiving the transaction data from their peers. If they are able to solve the puzzle once in a while, the frequency of a favorable outcome depending on the hash power they have, they can create a new block with the outstanding transactions after validating them, add an extra coin-creation transaction to pay the mining reward to themselves, and propose the new block to be added to the blockchain. Apart from the block rewards, individual transactions most of the time do have a voluntary transaction fee. Miners proposing the block also get to keep those fees. When all the 21 million Bitcoins have been mined, the block rewards as the primary incentive would be replaced by the transaction fees. Expectedly, the average transaction fee in the last 3 weeks prior to the block reward halving has increased 400% from less than a dollar to more than five dollars. No one really knows how miners would behave when the block rewards reduce a lot.

When Bitcoin started, the ‘difficulty’ was so low you could mine a few coins daily with your normal laptop CPU. An increase in difficulty made CPU mining obsolete and miners started moving to GPUs. Since a lot of new miners joined the party, the increase in difficulty factor made GPUs obsolete, giving way to FPGAs for a short-while and since then ASICs are the only hardware that has been used for Bitcoin mining. ASICs are highly optimized circuits that unlike CPUs (general purpose) or GPUs (useless shaders units for gaming, extra floating-point units) can only perform a certain specialized operation very efficiently. In this case, the operation turns out to be SHA256 hash calculation which needs integer operations, primarily shifting of bits, rotate, and XOR. To give an idea, a popular ASIC by Antminer costs around USD 2500 and does 14 Tera Hashes per second and is power rated at 1300 W. Though the equation of profitability might not work out currently if you add the electricity expenses, ASIC manufacturers are raking in billions of dollars in profit. Something something about selling shovels during a gold rush.

What happens if the price of Bitcoin pegged to fiat currencies like the US dollar goes up? Mining suddenly becomes more attractive to a lot more people. The time between successive Bitcoin blocks decreases from the approximate 10 mins. 2016 blocks or about 2 weeks in, the network adjusts the difficulty, and mining becomes more difficult, or everyone starts getting a lesser amount of Bitcoins for their work.

Since Bitcoin was designed to be decentralized, if an entity controls more than 50 percent of the hash power, there are a lot of theoretical security issues that can crop up. In practice, it would be counterintuitive for someone to do so from an economical sense since the attack requires a huge amount of compute infrastructure and it would anyway be detected thus driving down the worth of Bitcoin.

Bitcoin mining has been taken over by large entities with mining datacenters worth millions of dollars. The mining datacenters are primarily located in countries with a cooler climate and cheaper electricity so as to drive their recurring costs down. Smaller entities and individuals generally do not mine directly since due to their small hash capacity, the expected time to get their first reward might be in years or decades but use what is called a mining pool, whereas the name suggests, simplistically, a group of miners work together on solving their own crypto puzzles and if anyone finds a solution, the prize is shared amongst all miners in proportion to the amount of work they have performed. In fact, some large organized players wanting to hide their actual mining capacity or for other reasons also join and work in pools. As of today, the top 10 pools own more than 75% of the hash capacity of Bitcoin.

Due to the high upfront cost, lack of general availability, and power requirements of ASICs, a lot of hobbyists miners mine other cryptocurrencies, also called Altcoins. Some Altcoins have purposefully made their hash puzzle to be such that creating an ASIC chip for them would be difficult. One of the ways to make this is to require a lot of memory or memory bandwidth.

One of the most famous Altcoins is Ethereum. Ethereum can be mined using commonly available GPUs. I was a hobbyist Ethereum miner back in 2017 just before people started getting crazy over crypto. I was exploring cryptocurrencies and buying them using money from my bank account was out of the question, given that later on banks started tracking and in some cases even freezing accounts based on crypto trading. It was fun and sometimes frustrating keeping those rigs hooked to several GPUs running all the time, writing monitoring scripts, automating end of day trading so as to keep the loot in the much stable Bitcoin, automatic switching of mining a certain Altcoin based on profitability and more. Then Ethereum prices peaked, a lot of people invested a lot of money in GPUs to become miners to the point that gamers started experiencing a shortage of Nvidia GTX 1070s, one of the most popular GPUs at that time for gamers and miners alike. This increased the difficulty and then came the price crash.

Unlike Bitcoin, Ethereum includes a Turing complete language that has been used for applications such as smart contracts. One of the blots on Ethereum has been the Initial Coin Offering (ICO) scams where people made millions off the newly Ethereum rich public looking to ‘invest’ their coins and diversify. The ICO scams warrant another story of its own.

As of 2020, mining the best possible Altcoin with the best available consumer GPU in the market right now an Nvidia 2080Ti for about USD 1000, you can earn $1.4 per day after electricity expenses, which should decrease over time unless there is a crypto boom 2.0. Not a very good proposition.


In case you have not, please do enter your email address below so that you can receive my weekly emails, delivered on weekends. It is free.

Clubhouse and the communities on the Internet

I am not on Facebook, or Instagram, or Quora, or Snapchat, or Twitter, (though someone did make me create a Twitter account just before the lockdown, and I tried to edit my prose to the limits of their character count, but you might have figured out how that went.) For some reason, I am still on LinkedIn, though I think one day tired of all the shitposts taking over my feed, I would be deleting it too. One of the disadvantages of this is that I remain oblivious of all the happening stuff until it becomes too popular.

So I was not surprised when someone calls me at 2 am to tell me about how this brand new social app which is voice-based and is still not available publicly has people begging for invites. Not only this, apparently Benchmark and Andreessen Horowitz, two of the most respected VCs out there were also fighting for the right to give the Clubhouse founders 10 million dollars of their money. A16z won. Clubhouse with a few hundred users, without an app to download, is now a $100 million company.

The variety of places where you could go online is just fascinating. There are the usual social networks, not much interesting, filled with the same bunch of people trying to one-up with their photos and life updates. There is Twitter if you desire short crisp freshly unrolled sermons from just about anyone. Then there are pseudo-anonymous places based on interests like Reddit, where you can take advice from strangers on just about any topic in the world, ask your favorite people anything on AMAs, laugh at cute dogs being derp at 4 am in the morning when you cannot sleep. There are specialized communities such as Indiehackers for the startup outcasts who are satisfied running a profitable million-dollar business, there is Hacker News where younger developers flock to read the rants of older developers on just above anything related to tech. Then there is Product Hunt, where everyone is super positive and caring and happy all the time making you wonder if this is some kind of a cult. 4chan is the hell where all the darker stuff originates along with original memes before they go about their usual journey to Reddit, and then a few years later to Twitter and Instagram. And then there is TikTok, yeah.


The Work From Home conundrum

Twitter has allowed most of its employees to work from home, forever. Gitlab is a multi-billion dollar tech company with an all-remote work setup. So are other tech companies - Automattic (the makers of Wordpress), Zapier, Ghost, et al. Work from home poses its own set of benefits and challenges. At a time when a lot of companies around the world are re-evaluating their fixed costs, real estate sometimes comes out to be a major factor in it.

The flexibility that remote working brings makes that we don't have to worry about living life at the end of the day. - GitLab

Unfortunately, some jobs cannot be remote. A lot of these jobs fall under what is generally called the blue-collar workers, leading people to believe that COVID might lead to more disparities and inequalities. Even some of the more computer-based jobs cannot be done remotely due to artificial constraints like security and being classified in nature. Then there are jobs like customer support and call-center which should have been remote instead of stuffing people in a building.

Companies in high-rent neighborhoods like Manhattan are reconsidering if it is worth paying the high rent. This not only affects real estate but a lot of businesses that survive due to our ritual of commuting to work. Real estate is also one of the major contributors to city taxes in a lot of business districts.

David Kenny, the chief executive at Nielsen, said the company plans to convert its New York offices to team meeting spaces where workers gather maybe once or twice a week.

Remote jobs come with their own issues. People are experiencing internet issues, lack of support for their computer equipment if anything goes wrong, even improper chairs and for some people, a home/family environment that might not be conducive to work. Some people who have never done this before are feeling guilty being a little less productive while working from home, and are working even more hours to compensate.

Work from home has also led to a rise in employer-mandated surveillance. Few companies are asking their employees to install third-party software that monitors their screens, takes periodic images with the employee’s webcam, and tracks keystrokes all the time. Some have even gone further and started location tracking them, least an employee commits the sin of going out for a grocery run during their work hours. Companies are competing with each other to come up with shittier ways to snoop on their employees, with even timers starting when one goes for a bathroom break.

One of the often-quoted arguments against Work from home is security. This is most often quoted by a few CISOs who despite their years of work, clearly have missed out on the important bits of why we need security in the first place. A lot of companies are doing away with the concept of VPNs and the false sense of security that a perimeter-based approach to security provides. Google’s BeyondCorp initiative is a zero-trust architecture based deployment that allows someone to work even from untrusted networks without the need to login to a VPN. Companies such as Citrix are also pushing more for secure remote access solutions as an alternative to VPNs.


If you like this maybe share this post by clicking the button below?

Share

[Book Notes] Blood, Sweat, and Pixels:  The Triumphant, Turbulent Stories Behind How Video Games Are Made

One of the rarest things to find today is someone who is passionate about just anything. Game developers are such people. Jason Schreier is a journalist who has covered the video game industry extensively. This is a summary of his book that I read this week on the people working behind the video games. The process in his words -

‘A room full of developers, setting themselves on fire.’

The book is divided into ten chapters each about the making of a different game and the story of the associated studio. There is a lot of fascinating content for gamers and developers. The common running themes are making video games are hard, they combine art and technology at a scale that no other industry can match, small focused teams pulling off amazing feats, sacrifices over years sometimes decades, terrible time estimation with developers having to crunch extra hours. The book gives an overview of the relationship between game developers and publishers, the long time it takes to make a game (sometimes even ten years for even the largest of studios), there are a couple of interesting stories about independent studios and their quest for survival including running Kickstarter campaigns and innovative marketing under financial constraints. You learn about focus testers, gold masters, internal politics, and frequent clashes between art and management.

I found Chapter 3 on Stardew Valley to be particularly interesting. It is the story of a lone developer named Eric Barone, trying to create a scrappy 2D game in 2011 with no source of income while his extremely patient girlfriend supports him with food, rent, and their studio apartment expenses. Two years into game development, the money situation deteriorates even further, and to counter his loneliness while banging out code and creating pixel art, he is forced to take up a part-time job as an usher in a theater. He gets burnt out and tries doing an Android game for a month, releases it and it flops. It is now four years since he has started working on it. After a year more of sleepless nights and self-doubts, he releases the game in 2016. And then the magic happens. Eric Barone, driving a hand me down 20 years old car where the driver side door is stuck and does not open at all, working alone on a 2D game for the last 5 years, sells 1.5 million copies of Stardew Valley and gets over $12 million in his bank account. And he still used to drive the broken car. He continues working on the game updates and patches but then one day suddenly stops working. Burned out, it was time for a long break.

Then there are stories about even the largest studios taking ten years to complete a game (Diablo III) and failing on the launch day, fake demos in gaming conferences, 99,000 bug reports in a game, studios like Bungie moving away from their parent and struggling, overpromises on Kickstarter campaigns and developers committing to their promises even if took years of development time post-launch, the entire studio being closed mid-games and developers still scrambling to complete the game under progress.

Chapter 9 is an interesting story about how an underdog studio CD Projekt Red based out of Poland made the massive success called The Witcher 3. That awesome game based on a series of fantasy books by a Polish author, on which Netflix made a frustrating, boring series. It is the story of a small studio based out of Poland, whose founders started out as importing and distributing games in the local market. The goal with Witcher 3 was to make a big game with about a hundred hours of engaging gameplay and compete with the bigger studios based out of the US. And then there was more. As the author, Jason writes -

‘With quests like The Bloody Baron, The Witcher 3’s design team wanted to give players tough choices. They wanted to make you question your morality, and they wanted to leave you thinking about those ethical questions long after you finished the game.’

At the end of development, the maximum gameplay time stood at closer to two hundred hours double of what they had set as their goal. After the success of The Witcher 3, experienced game developers from all over the world started emigrating to Poland just to work at the studio.

The final chapter is about the disintegration of LucasArts after the acquisition of Lucasfilm by Disney. Disney shut down LucasArts and laid off 150 employees. The book writes about the day as emotional with some employees ransacking the place, using flash drives to grab whatever half-done work they had on LucasArts servers, some of them stealing console development kits. It is different than the other chapters since the last game that LucasArts was working on, Star Wars 1313 never really got released.

‘The Bay Area is filled with people who have had their hearts broken by LucasFilm or LucasArts - that sad legacy of multiple presidents, multiple layoffs. There’s a lot of people out there who’ve been treated badly by the company.’

The book is overall a decent read for developers and gamers alike.


Other things that matter

Facebook has agreed to pay USD 52 million as part of a settlement with its moderators who apparently developed PTSD due to their job of reviewing graphic images and content. Adobe is in news again for the bad security of their apps. Adobe Reader allows a malicious program to gain root privileges on macOS. Facebook has agreed to buy Giphy, a place to search GIFs (the search does not work properly) for a reported USD 400 million. Nvidia GTC 2020 has started virtually with its CEO delivering a keynote from his kitchen. Nvidia also released its new Ampere architecture for GPUs. There are significant performance gains all-around over Volta and a new TensorFloat-32 for seamless mixed-precision work on Tensor cores. Telegram, the messaging app was building a blockchain platform named TON, which they said would be better than Bitcoin and Ethereum. It has apparently been banned by a US court and all work has stopped. TSMC, the world’s largest silicon foundry, and Taiwan’s largest company will be setting up an advanced semiconductor fab facility in the US. They already have one of them though not something like this (5nm process).


In case you have not, please do enter your email address below so that you can receive my weekly emails, delivered on weekends. It is free.

Thank you for your feedback last week. The common themes were the first part was too long to be read on a mobile phone (still figuring it out), maybe some of the paragraphs could be broken down into even smaller ones and if there was a better way like adding subtitles to break long-form content.

I am still experimenting with the content and sections and am trying to figure out what the essence of the newsletter should be. Feel free to send me what you liked or hated on any of the channels you know me on, or just drop it as a comment on the webpage of this post.

The image is ‘A Bird in Flight’ generated using an equation and a program by the Iranian mathematician artist Hamid Naderi Yeganeh. It is one of his most famous works. Find his other works here. I had to insert an image for better sharing on the social platforms and this looked beautiful.

Have a good week ahead. See you next weekend.