Blocktime

Episode 45: Mining, Market Dynamics, and Energy Efficiency

Blocktime Powered by Riot

Join us for an exploration of how Bitcoin tackles the age-old issues of trust and distrust within central banking systems, offering a transparent and accountable alternative. Discover the significance of private keys and hardware wallets, emphasizing the personal responsibility integral to this decentralized system. We also examine Bitcoin's steadfast commitment to security and stability in its software development approach, setting it apart from other cryptocurrencies.

Learn how metrics like hash price and mining rig efficiency are crucial in evaluating the Bitcoin network's global electricity consumption and economic viability. With a spotlight on Texas's 15% market share in Bitcoin mining, we discuss the potential for growth and the integration of Bitcoin mining with power grids. This episode offers a comprehensive view of Bitcoin's evolving landscape and its pivotal role in reshaping financial systems.

Follow Blocktime on Twitter: https://twitter.com/BlocktimebyRiot
Follow Blocktime on YouTube: https://www.youtube.com/@RiotPlatforms/podcasts

Speaker 1:

Welcome to the Block Time podcast produced by Riot Platforms, where we take a deep dive into the grid electricity, bitcoin mining and, of course, bitcoin. Today we're really going to cover the whole range, this presentation. It's got a lot of infographics, a lot of charts, so perhaps you'd prefer to watch it on YouTube versus listening to it, but I'll try to describe them so that you can listen to it, and we're going to go end to end, from what Bitcoin is to what Bitcoin mining is and thus how it integrates with the electricity grid at the end. So first let's start on the Bitcoin side of things.

Speaker 1:

The big question to answer for Bitcoin is what problem does Bitcoin solve? And I think the short answer is the problem of trust, or rather distrust, in the central banking experiment that has been running for the past 50 plus years. And this experiment in central banking, with pure fiat currency and fractional reserves, has had some pretty mixed results. And when we look at, for example, what are the behavioral effects on consumers and investors, well, we see that inflation causes consumers to need to spend their money as quickly as possible, and so we've got lots of people living paycheck to paycheck so that inflation doesn't eat away at their bank balance. And then on the investment side, we see that we've got lots of bad investments that happen in waves, so most recently we had the big real estate bubble in 2008. And all of this financial instability then leads to bailouts, where insiders get trillions of dollars at the expense of everyone else who has to pay for it in the form of consumer price inflation. So the Bitcoin emerges as an alternative to this centralized system where, due to the need to trust these third parties, as Satoshi put it that trust gets abused. So Satoshi really designed a system that does not have trusted third parties. How did he accomplish that? It goes along with three important principles transparency, accountability and reliability.

Speaker 1:

On the transparency side for Bitcoin, what Bitcoin has is that its code is open source, so anybody can review, audit the code, contribute to its development. On top of that, all the transactions that occur on the ledger are also publicly available and pseudonymous. So it's letters and numbers, but everybody can see it and everybody can verify the whole ledger to make sure that the rules of the Bitcoin protocol are being followed. To have this level of transparency, you would have to, with fiat, go into the Federal Reserve building and start opening up their books. And if you did that, you'd probably get arrested for trespassing. You're not allowed to just walk in and start auditing the Federal Reserve. With Bitcoin, you are allowed to do that. You can just do that from the comfort of your living room with your laptop. You can audit the whole ledger. It's about 600 gigabytes of data to download and to verify, but a typical laptop will accomplish that in less than a week. It'll audit the whole history of Bitcoin from 2009 to today.

Speaker 1:

So with that comes accountability. That is, that you are responsible for your own money. Bitcoin comes with a lot of freedom, and it comes with that responsibility. If you lose your keys that give you access to your Bitcoin, then there's no customer support line to call on your own, so you've got to make sure that you understand the system, and likewise, when it comes to verifying your balance or verifying the monetary policy of Bitcoin, you have that independence, but you also have that responsibility to do that by running your own node. The third part is that, because you've got all these people running their own nodes and holding their own keys, the decentralization of that removes any single point of failure, and so that's what enables Bitcoin to be far more reliable than the fiat system. In addition, the software development process behind the Bitcoin node software really has a conservative philosophy that focuses on the security and the stability of the network and of the nodes and the software over other considerations. So you'll see, in the wider cryptocurrency ecosystem, other cryptos will try to compete against Bitcoin by differentiating themselves, adding new features and sacrificing the reliability aspect of the system, and so Bitcoin does not take any shortcuts there and it really does maximize reliability for users, which I think is something really important for a monetary system. And if you know people who want to be more innovative, they can find either layer twos on top of Bitcoin or they can find other cryptocurrencies that meet their needs. All three of these principles have led Bitcoin to really being a giant success story. Over the past 15 years, it's grown to have a market cap of over a trillion dollars, so people have been getting lots of utility out of the system and wanting to use it both for savings right as a long-term digital gold, but also for transactional purposes as electronic cash that can move around the world 24-7 and have that level of autonomy that you know you might not have with the banking system.

Speaker 1:

Let's zoom in on what's going on under the hood with the Bitcoin system and how mining fits into that. First, we can start with the private keys. These private keys, these are the secrets that allow you to receive and hold and spend Bitcoin, and typically you'll want to keep the secrets in a specialized device that can be called a hardware wallet. The technical term for it is a signing device, and this is usually a USB device that you can plug into your computer or keep it air gapped by using SD cards to transfer data or NFC lots of different cool communication protocols there and the signing device or the hardware wallet, will then be able to give you access to generating addresses to receive Bitcoin, but also generating signatures to spend Bitcoin, and the interface with which you access that is really through the wallet software, so the wallet software. Quite often it can be separate from the hardware wallet, which is why we call it a signing device instead of calling it a hardware wallet and the wallet software is tracking what Bitcoin are yours.

Speaker 1:

The way it does that is by communicating with a node. So you've got the private keys, then you've got the wallet, then you've got the node. The node is verifying transactions that are coming from wallets. If those transactions are valid. The node then adds it to a backlog of transactions called the mempool. That backlog of transactions is what mining pools look at to select transactions to include in the next block, and then they send a summary of that data out to the miners. The mining rigs. You know, like Riot operates out in Rockdale and Corsicana in Kentucky. Now that's where all of the work happens. From a proof-of-work mining perspective is there, and then when we find a winning hash, we send it back to the mining pool. The mining pool broadcasts it to all the nodes. The nodes verify that the block we proposed is valid and then it will add it to the ledger and at that point the transaction is finalized and the system continues to operate so at a high level. Those are the different parts of the Bitcoin system the private keys, the wallets, the nodes, the mining pools and the miners, or the hashers as we could call them.

Speaker 1:

Now let's zoom in on the mining aspect of this. In this system, you have two ways that the miners receive revenue, or two sources of revenue. One is the new issuance. So Bitcoin has an issuance schedule of. Ultimately, there will only be 21 million Bitcoin. It started at 50 Bitcoin every 10 minutes and then it gets cut in half every four years worth of blocks. So now we're at 3.125 Bitcoin, and this is going to continue to occur. And then on top of that we have the transaction fees that are being paid by the transactions to be included in the blocks. So with that, when we look back at the past 15 or so years of mining rewards, so the sum of the new issuance plus the transaction fees, that's the mining reward that gets paid to the miners. If we look at it in BTC terms, it has actually decreased over the past 15 years, and it has decreased because of that halving function that cuts it in half every four years.

Speaker 1:

As you can see on this chart, we have to layer on top of that the increase in the Bitcoin price right. The exchange rate or the purchasing power of those Bitcoin has increased dramatically, and one way to visualize this is by looking at this information from the perspective of Bitcoin's halving cycles. So if we take the day of the halving and we index the price on it, that's what this chart shows. So it starts at an index of 100. And then, if we look at the 365 days after the halving, we see that the Bitcoin price historically has dramatically increased after the halving. So that's the bull market, and then after that we have a bear market, and then we have what I call the enlightenment phase, where finally we've gotten rid of all the tourists who maybe had no business buying Bitcoin in the first place, who panic, sold during the bear market, and then the price kind of recovers at the end of the cycle, only to begin the cycle anew. With the halving reward multiplied by the exchange rate, we see that the overall revenue for Bitcoin mining has dramatically increased. So the Bitcoin price has increased faster than the halvings have cut revenue. Now, on a quarterly basis, that means that the Bitcoin mining industry earns approximately currently three and a half to four billion dollars per quarter, and that revenue is what is all going to the miners.

Speaker 1:

Let's look at what a hash is, because we've really got to figure out from here how Bitcoin mining works. We have to understand this cryptographic function, the hash function. It has some interesting properties. So, first of all, it's random, meaning that if you put different data through the hash function, you will get a completely different random output. The output is always of the same fixed length. In Bitcoin's case it's 256. Zeros and ones is the output and the function is called SHA-256. Now, technically, bitcoin does it twice, so it's SHA-256 squared, but nevertheless the output is 256 zeros and ones. So different data, different hash, but same data, same hash. So a hash function is deterministic. It's also irreversible, so you can't take the hash and decrypt what the input data was. A hash function is not an encryption function. It's more like taking a fingerprint of a piece of data. That is going to be unique to that piece of data and it's going to allow you to identify it and verify it, but you can't reverse back into it. So what is the input data?

Speaker 1:

In the context of Bitcoin, it's called the block header. So the block header has metadata about a block that you know. A block on average comes out every 10 minutes. We'll explain how that part works in a minute. The data that's summarized in it, the most important part, really, is what's called the Merkle root hash. So this is the root of a Merkle tree. The leaves on the tree are hashes of transactions. So each transaction has a transaction identifier and that gets rolled up into the block header in one short hash. Now the other part that gets included in the Merkle tree is the mining reward transaction. So when the pool is constructing the block header, the pool's block header is different than any other pool's block header, because each pool puts its own reward transaction into the block, because that reward transaction is going to have addresses that are owned by the pool, and so each block header is uniquely tied to the pool that mined it, so that that pool can be rewarded for proposing a valid block. The block header also has a hash of the previous header, and this means that you essentially link together the block headers by embedding each previous hash into the next one, and this is what gives you the block chain. That is immutable because it is all depending on one history and kind of inheriting from the previous block header.

Speaker 1:

The timestamp self-explanatory, it's just what time is it when the miner was constructing this block header? And then the nonce is really important. The nonce is what the miner is going to modify in order to generate a new hash. Right, because if they were hashing the same data over and over, they would always get the same result. But they're actually trying to generate lots of different hashes and so they keep the same data except for one little piece of it, which is the nonce, and changing that little piece of data, because the hash function is random. That's enough to give you a completely fresh fingerprint of the data. And, last but not least, you've got the bits difficulty and we'll talk about that in a minute because it's a bit more involved of a concept.

Speaker 1:

So how much hashing is going on? So this block header is going through the hash function many, many times in Bitcoin and I want to kind of lay out some of the terminology here in terms of the orders of magnitude that we're working with in Bitcoin, the orders of magnitude that we're working with in Bitcoin. So 1,000 hashes per second is one kilo hash per second, one million. Then you've got one billion hashes per second and then you've got one trillion hashes per second. So I want to stop here at one trillion hashes per second, because this is a tera hash and this is the order of magnitude at which the today's generation of bitcoin mining rigs operates at. And so the latest micro bt mining rig, I believe, is a 300 tera hash per second. So that's 300 trillion hashes per second is being generated by this mining rig. And then, if we scale up to a peta hash, so that's one quadrillion. And then you can scale up to an exa hash, and that's one quintillion. So today's Bitcoin network is approximately 600 exa hash. If we assume that the whole network is 300 terahash micro BT machines, that would mean that there's 2 million mining rigs that are mining Bitcoin everywhere in the world. Now, that's not. You know, that's not the case, because there's other mining rigs out there that you know have more or less hash rate, but the Bitcoin network is the equivalent of 2 million micro BT mining rigs at 600x.

Speaker 1:

A hash Hashing happens where the mining pool is sending data to the miners. The miners are hashing it and then, when they find a winning nonce, they'll send it back to the mining pool. There's many different mining pools. They are always competing with each other to have as much hash rate as possible, and really the reason why Bitcoin miners use a mining pool is in order to avoid, for example, if they only have 1% of the network, that means that they would earn 1% of the rewards, but if they're unlucky for one month, they might earn 0.5%. The next month they might earn 1.5%, and so it creates a lot of variance in terms of their revenue, cash flow, which can create a mismatch with their expenses cash flow, and so that's why Bitcoin miners use mining pools to aggregate hash rate and to reduce the luck factor.

Speaker 1:

Now where does the difficulty come from? The difficulty is set by the nodes. So, every two weeks worth of blocks, the Bitcoin nodes look back on those 2016 blocks and they calculate how fast were those blocks coming in based on the timestamp, and if the blocks were arriving too quickly, then they increased the difficulty, and that means that essentially, the hash rate of the network, or the amount of mining hash rate that was happening, has increased. And so now the Bitcoin nodes need to increase the difficulty so that blocks go back to coming in only every 10 minutes. Conversely, if they measure those 2016 blocks and find that it was really 12 minutes, then they need to decrease the difficulty to calibrate that decentralized clock that is adding transactions to the Bitcoin network in a sequential order. The difficulty level is a crucial part of proof of work for Bitcoin. Now, putting some numbers around it so if the Bitcoin network is 600 exahash per second, the Bitcoin network is 600 exahash per second and there's a block every 10 minutes, that means that there's essentially 360,000 exahash per block and there's only one hash out of that. That is the valid hash on average average, and so when we divide one hash by 360,000 exahash, you get a very, very small probability of any one hash being the winning one, right? So that winning hash is the proof that the miners hashed 360,000 exahash. Statistically speaking, on average, it's the proof of that much work.

Speaker 1:

One of the challenges with Bitcoin, as I mentioned, is that variance of how often do you find a block, and this comes down to what, in statistics, is called a Poisson distribution, so you have blocks that come in a lot faster than 10 minutes, right? So it might be that you find a block and then two minutes later, another one is found, and then an hour later, another one is found, but it all averages out to 10 minutes, and so that can be challenging, both for miners, but it can also be challenging for people who are using Bitcoin. Maybe they send a Bitcoin transaction and they're waiting for it to get confirmed. It's taking longer than they expected because they expected 10 minutes, but that's just not how probability works, and so they might have to wait, you know, 45 minutes or longer. Now, there are solutions to that. We could get into lightning on a different day, but basically, you know, if you're using Bitcoin, don't use it for time sensitive transactions using it for transactions that you know you can wait an hour to confirm.

Speaker 1:

This graphic shows the winning blocks in blue and in red is the difficulty, and so, basically, the red is the finish line right, or the threshold. Maybe it's more akin to a hurdle right that you have to jump over to get a winning block, and so if we were to plot out the hashes that failed to meet the target, it would just be, you know, completely filling the chart above the red line. Most of the hashes barely meet the difficulty threshold, but you see, some hashes get really lucky, and so they have a value that far exceeds the target, and so that can happen as well, but they don't earn more money by overachieving here. Okay, so after they found the nonce that allowed them to meet that target, the mining pool then sends out that block block header out to the Bitcoin nodes. The nodes verify that the hash actually does meet the target, meaning that when they convert the block hash into a number, that it is lower than the difficulty, and if that's the case, then the mining pool gets rewarded through that transaction that they included in the block.

Speaker 1:

Something that's interesting to note is that and this is something that we covered in a past episode when we talked about the Bitcoin white paper. The initial implementation of Bitcoin, written by Satoshi, had it where he was checking not how much work was going on but the height of the block, and so that was actually a little implementation mistake on his part. That got fixed. But just wanted to show that, you know, while Satoshi was an absolute genius in creating Bitcoin, he did have some little bugs that have had to be fixed afterwards. So we shouldn't, you know, take everything Satoshi says with a grain of salt. Right? Don't trust, verify applies to the inventor of Bitcoin as well.

Speaker 1:

Now, a metric that we use a lot or look at in Bitcoin mining is to take that reward that we started out with the transaction fees plus the new issuance, and then we divide it by that global hash rate of 600 exahash and we convert it to petahash, and that's the reward per petahash, per second, per day, and we call it the hash price. So currently, you see, it's around $50 in dollar terms, and what we can do with the hash price then is that we can convert it into how much revenue does a Bitcoin miner get per megawatt hour of electricity. But to get to that point there's an intermediary step. So the intermediary step is that we have to go from terahash to electricity. We do this through the mining rig efficiency ratio. So mining rig efficiency is measured as joules per terahash, so unit of energy per terahash per second, and you can see here in this chart that over time, mining rig efficiency has dramatically increased. Where the Bitmain Antminer S9 from 2017 clocked in at 98 joules per terahash, the latest generation Bitmain Antminer S21XP, hydro is at 12 terahash per second. So you see an improvement by an order of magnitude almost of the efficiency of the mining rigs over the past seven years. Interestingly, now that we have the mining rig efficiency, now we need to get to the network level efficiency, because we know that it's not like the whole network is using S21s, but it's also not all using S9s. It's some blend of the past seven years of mining rigs that is currently operational and hashing operational and hashing.

Speaker 1:

Our friends over at Coinmetrics found a way to fingerprint, identify which mining rig is generating which hashes, and then they can use these anomalies to understand what the relative market share is of different mining rigs, and they built a really helpful chart showing that. They then extrapolated from that to a network-wide efficiency metric, and so you can see here that you know, as we saw with the mining rigs, the efficiency of the network as a whole has dramatically improved over the past let's say, five years in this chart, going from 90 down to below 40, as we would expect based off of the specs of the mining rigs. So this actually allows us to then calculate how much electricity is the Bitcoin network consuming as a whole, globally. We can estimate it, and Coinmetrics estimated it as 20 gigawatts, 20 gigawatts of electrical capacity, and Riot is just shy of one gigawatt of that. And so let's say 800 megawatts of that. And it's interesting to go from all the way from the Bitcoin side to the electrical side by looking at that, at the different ratios.

Speaker 1:

The next kind of step is to look at that marginal revenue per megawatt hour of Bitcoin mining rigs. So here we have a chart that shows the more efficient the mining rig is, the greater amount of money it earns per megawatt, per megawatt hour. So an S21 is just shy of $200 per megawatt hour, while a S9 is probably more towards $10 or $20 per megawatt hour, and the S19 is, you know, in between there. So what this shows is that and historically you know that has evolved. When we look back at when the S9 launched in 2017, it was really hitting astronomical numbers of tremendous marginal revenue and that fell very quickly as people deployed S9s. And that fell very quickly as people deployed S9s. Then, when the S19 came out, the S19 had $400 per megawatt hour, but then that compressed as people deployed S19s and the network difficulty increased.

Speaker 1:

So, even though you had the same level of efficiency, because the overall pool of hash rate had increased so much that any one machine was a smaller and smaller percentage of the mining reward and thus less revenue per megawatt hour we could probably surmise that the equilibrium is somewhere around $100 per megawatt, which would somewhat reflect electricity prices out there. Right that? The idea being that Bitcoin mining revenue per megawatt hour over the long term converges onto a spread above the marginal cost to produce one megawatt hour. And so if we were to say, okay, well, the global cost to produce one megawatt is $50, and the Bitcoin marginal revenue is $100, then the gross profit margin of Bitcoin mining is 50%.

Speaker 1:

Now I also want to emphasize that these revenues are very low compared to other industries, so a typical industrial user of electricity, they might have a marginal revenue per megawatt hour. That is, in the thousands of dollars, not in the hundreds of dollars, and part of that is because they just the electricity is a smaller percentage of their input costs. So they can just they would be able to afford to pay a lot for that. The other part is that they might be producing a product that's not a commodity, right, hash rate is a commodity. It's a globally produced, it's hyper competitive industry. Other industries will, for example, have more value add. So, like manufacturing an iphone, when they're manufacturing an iphone, they they're probably not very sensitive to the price of electricity. Uh, that goes into that because they're selling the iphone for such a great dollar amount. Right, it's got a tremendous premium to it.

Speaker 1:

The other piece of the puzzle is that when we look at flexible sources of electricity right generators, a battery, for example, will typically be more around $400 per megawatt hour as their break break even when you figure in the depreciation of cycling the battery, and that puts it at a higher break even price than bitcoin mining. So typically it's not economical to use batteries for bitcoin mining, the other power technologies. So, for example, example peaker plants, right natural gas power plants, they are generally within striking distance of the marginal revenue per megawatt hour of Bitcoin mining, and so Bitcoin miners might be turning off at the same time as a inefficient peaker plant is turning on. When we look at the dynamics on the grid Now, on the grid, there's two phenomenon going on. One is that there are Bitcoin mining rigs that are looking at the real-time price of electricity and responding to that in real time. This chart shows that from ERCOT during the solar eclipse, when the electricity price went above the break-even and they put it here at $149 per megawatt, which is reasonable, when it went above that, it caused Bitcoin miners to shed load right. So they turned off mining rigs because now they were paying more for electricity than they were earning from mining Bitcoin. But once the electricity price went back down below that break-even, then they stopped turning off their machines and they started turning them back on. This really is what we call price-responsive behavior from a large, flexible load On this chart also is the green line at the bottom, which is the ancillary services which we've discussed here before, but we'll mention it again because it's very important.

Speaker 1:

This is electrical load that ERCOT is paying to have it stay on, and so the reason why they want that electrical load to stay on is so that they can control it in case they need to be adjusting it to maximize the reliability of the grid, to make sure that the system frequency of 60 hertz is approximately respected. So it's interesting because in Bitcoin you have the difficulty target of the hash rate. That is kind of calibrating the system. Uh, on the grid you have the system frequency of 60 hertz. That is the target, uh, that ercot is trying to calibrate around. So here you see that the ancillary services in green did not decrease when the the electricity price up, and that's exactly what ERCOT wants. Ercot wants to maintain a reserve of resources available and they don't want those resources to be responding to price. They want them to be responding to electrical engineering signals. So it's just a completely different purpose that unfortunately occasionally gets conflated by the media.

Speaker 1:

This chart shows the historical prices that have occurred in ERCOT and really, you know, what it shows is the seasonality of electricity prices. People tend to think of electricity prices on very average terms, right? Because when we look at our electricity bill, the rate that we pay is an average, and so then the person or the company that is selling us electricity they're hiding the volatility of the electricity price from us and kind of smoothing it out to a fixed rate, but there's a tremendous amount of volatility. So in August of 2023, as you can see in this chart there were lots of times where the electricity price was $500 to $5,000 per megawatt. $5,000 per megawatt is the regulatory maximum that can be charged in ERCOT currently. So at these prices, bitcoin miners have turned off long before that and, conversely, if you look at a shoulder month right off-peak month, for example, april of 2024, not only do you have very few price windows that are in that $500 to $5,000 range it's like less than 1% you also have lots of purple, which is negative $35 to $0. And so you have negative pricing more than 5% of the time, and then you have lots of hours where it's $0 to $20 per megawatt. So there is an abundance of electricity outside of peaks and Bitcoin miners are helping absorb all that electricity and make sure that generators get paid so that they are available for when the peaks come around.

Speaker 1:

You know a much smaller percentage of the year when we cross the electricity price in ERCOT with the S19 mining rig breakeven, we can see how often would the typical S19 mining rig be unprofitable and curtail in the ERCOT market if they're just responding to price During winter storm Yuri in 2021 of February, 25% of February would have been off, which makes sense because the storm lasted for a week, so that's a quarter of the month. This past summer was much milder from a temperature perspective and we had lots more solar and batteries. So the peak curtailment month was May and that was only 10%, so half as much as August of last year. And, you know, certainly at lower prices as well. So you know the curtailment. You know the electricity price might be a $500 and the mining rig is off At $5,000, it's still off. Right, we'd have to look at a different view to see kind of what the opportunity cost or what the avoided price was. And then there's lots of months where it's really less than 5% it's like hovering around 1% to 2% where there's very little curtailment happening because during that month there's just overproduction of electricity and there's no grid stress from everybody turning on their air conditioning. So the grid is having to handle a very wide range of outcomes due to the combination of solar, wind and then, of course, the air conditioning load.

Speaker 1:

At how Texas and Bitcoin mining integrate together 15% of the Bitcoin network, or of the Bitcoin mining hash rate, is in Texas, and that amounts to about three gigawatts of electrical load here in Texas, which is a sizable amount, and it seems like, though, that the market share for ERCOT has really gone sideways right.

Speaker 1:

It's been a steady 15% over the past couple of years. I think that we've got to increase that percentage, but we'll see. As the network continues to grow, maybe we'll just stay steady at 15% of market share for Texas. In any case, I hope you found it interesting that we went from what is a hash cryptographically speaking what are the economics that are going into the revenue for Bitcoin mining and then tying that to what's the price of electricity and how is Bitcoin mining integrating with the grid? If you have any questions about what we covered today, always feel free to reach out. We're always happy to take questions from the audience. Don't forget to subscribe, leave a review and share with your friends and family, and we'll see you again on the next episode of Black Time.

People on this episode