## Intro to Bitcoin Mining

Listen to this podcast interview with Yan Pritzker for an introduction to Bitcoin mining. As you listen, consider the following questions. What does mining do, and how does it secure the Bitcoin network? Should you mine Bitcoin as a retail individual? How are Bitcoin miners compensated? What is the block reward, and what is the block subsidy?

STEPHAN LIVERA PODCAST: SLP121 YAN PRITZKER – INTRO TO BITCOIN MINING (BEGINNER EPISODE)

October 31, 2019

Yan Pritzker, Bitcoin Author and previously CTO of Reverb (Now CTO Swan Bitcoin) joins me in this episode to talk about Bitcoin Mining, his book Inventing Bitcoin, and give Bitcoin beginners an intro to Bitcoin Mining.

• Whether a beginner should do Bitcoin Mining or use cloud mining
• How bitcoin mining works
• How the network stops cheaters
• Bitcoin mining attacks
• Common errors in thinking about Bitcoin

Podcast Transcript:

Stephan Livera: Yan, welcome to the show.

Yan Pritzker: Thanks, Stephan. It's great to be on.

Stephan Livera: Yeah. So, Yan I know you've done a lot of cool stuff particularly with your book inventing Bitcoin, but I'd love to have you tell us a little bit more about yourself and what was some of your background before you got into all this?

Yan Pritzker: Yeah, sure. So I have a little bit of an interesting story. I came here to the United States when I was seven years old. Came from the former Soviet union and with my parents obviously, and they got into computers at an early age. My dad saved up what money. We had a little bit of money and bought me a computer. So I grew up kind of coding things like that. And then, you know, went to school for computer science and linguistics and I thought I was going to do AI and things like that.

Yan Pritzker: But then I really got into startups. So I spent about, you know, 15 to 20 years depending on when you start counting doing startups and being an early cofounder, early engineer at a lot of startups. My latest one was reverb reverb.com, which was a marketplace for musicians. Basically. We sold gear drums, guitars, things like that, and just got acquired by Etsy actually. So I'm real proud of the team there. But around 2016, I started falling down the Bitcoin rabbit hole as many people do once they really start understanding Bitcoin. I had actually known about Bitcoin since 2011 and I'm ashamed to say that it took me five years from knowing about bitcoin to actually like understanding what it was or even bothering to research it. So, you know, it took me a while, but in 2016, I finally kind of sat down and started looking at you know, Andreas' videos and reading every article I could get my hands on, listening to podcasts and really started getting educated on this and, you know, very quickly became kind of the Bitcoin guy in my group of friends.

Yan Pritzker: Obviously it was – a lot of people have experienced that sort of, you know, that effect, right? And started shilling Bitcoin at every opportunity, it got really annoying and decided that you know, I wanted to kind of figure out a way to explain Bitcoin to people a little bit better. And I actually started giving talks at a few high schools. I have friends who had been teachers. And based on these talks, I started realizing that I wanted to have a really simple way to explain Bitcoin. And that's kind of how I came to the book. I decided to basically write down those thoughts, try to make it as short as possible. So the books, you know, it's about a hundred pages. Try to make it as adjustable as possible for the regular sort of person, but at the same time make it technical enough so that you can understand how Bitcoin actually works. So yeah, that was my journey. I'm skipping over a lot of stuff that have in the middle. I kind of had, you know some time where I explored blockchain and ICO and Ethereum and all that kind of stuff. But eventually came around to the idea that bitcoin is the only thing that matters. So that's why I'm here. So you mentioned as well

Stephan Livera: So Yan, you mentioned you were from a former Soviet nation, so did that also play into your own understanding of Bitcoin as money?

Yan Pritzker: Yeah, I have to say that, you know, my experience was in the Soviet union, I, I grew up there, so my experience was as a kid and as a kid, I didn't really understand that the environment I was in, you know, there was something wrong with it. Right. I just had a normal childhood but my parents, you know, stood in line for bread. There was shortages of goods everywhere. But later on when I got into Bitcoin, I started asking, I started sort of thinking back to what the Soviet union was like and asking my parents about it. And one of the most interesting things I asked them about was what happened to our money when we left. Right, and what happened is, it turns out is that the government allowed us to exchange about $100 per person worth of currency with the Soviet ruble. Yan Pritzker: At the government controlled exchange rate, obviously the government controlled exchange rate was not the real exchange rate that was on the street because nobody wanted those rubles. So effectively we were able to keep$100 per person. And so when I heard that, I started really thinking about what would life have been like if we had Bitcoin. At that time, right? We would've been able to put a password into our head and walk out of the country with all the Bitcoin in our head. Right? So it started to really connect for me that Bitcoin is exactly that. It's not really I mean if it's an inflation hedge, maybe that's kind of a nice thing, but what it's much more important about Bitcoin is that it's a freedom hedge, right? It's a hedge against the government, like wanting to take all your stuff or not allowing you to leave the country with your wealth intact. And that's, that's what really clicked for me when I understood our condition and how we kind of escaped the Soviet union. We were lucky enough to be able to leave with what little we had. But if we had Bitcoin and we had been saving, you know, a little bit of our income and Bitcoin we would have been much better off obviously.

Stephan Livera: Yeah. I've often thought of Bitcoin as a kind of techno libertarian answer to the techno authoritarians.

Yan Pritzker: Yes, exactly. Right. It's exactly right. It changes the nature of the relationship, I think between people and their government. Right? Because I'm in the Soviet union, we were powerless to do anything because we had no economic freedoms. So the government imposed the currency on us, right? The Soviet ruble, they managed the whole economy. They planned everything. And so of course there are all kinds of things were screwed up and the shortages and everything. The money was devalued many, many times by many factors of a hundred, a thousand and so on. But we weren't even allowed to own, for example, U S dollars. Right? It was complete currency control. And you see this even today, this is not like something that happened back in the day. This is happening all over the world. I mean, Argentina, Venezuela, countries like that, they're not going to want you to flee the country with all that capital. So they need to lock things down. And when they lose that power, I think that really changes people interact with their government. It's puts a real check on the government's ability to even try to do something like this.

Stephan Livera: What I really enjoyed about your book is that it was really short and gives a high level explanation on different concepts and one of which is Bitcoin mining. I think it'd be good to walk through some of the examples from that. So maybe we'll just roleplay. So I'm going to be the Bitcoin beginner and I'm going to ask you Yan. So look, I heard about Bitcoin. Should I do Bitcoin mining?

Yan Pritzker: It's funny, it's a funny question because I actually have gotten this question from beginners. It's a very common question. And I think the problem with this question is the perception that Bitcoin mining is like well, it's honestly it's the media's fault because if you read articles, it says Bitcoin mining is done by computers by solving complex equations. Okay. So of course everybody's like, well, why can't, you know, why can't my computer solve complex equations? And it really misses the point of what mining is, right? So I think the first thing I actually start with is by giving people a realistic view of what mining looks like nowadays. People have to understand that mining is an industrial process. It's done by fairly large companies at large scale with huge amounts of power. They need to be negotiating their power contracts to get a very, very cheap cost of power.

Yan Pritzker: They need to be buying their hardware in bulk to get cheaper hardware. They need to have you know, the right tech structures in place to be able to like write off that hardware, all this kind of stuff. These things need to happen in order for mining to be profitable at scale. So the answer to whether you should mine is no as an individual you should likely not mine. I mean, you may have some reasons to mind. For example, if you want to get your hands on quote unquote clean Bitcoins, right? Because by mining you are generating the Bitcoins yourself. And that's kind of nice because you haven't logged into any exchange. You haven't interacted with anybody. You're literally generating them sort of out of thin air, but you know, you're using your electricity to pay for that. But the downside of that is that you're not going to be profitable. You need specialized hardware and you need very cheap power. So unless you're willing to pay for that sort of anonymity through essentially overspending compared to what you would've paid for on an exchange I would not recommend mining.

Stephan Livera: Right. And I think it also plays into that idea of what is the upfront capital costs required? And typically it might be much, much higher than the typical individual would be able to spend.

Yan Pritzker: Right? I mean, even a brand new mining machine might cost you a couple thousand dollars, or even if you pick up an old one on the secondary market, well that old one will take a lot longer to pay off because you know, it's not as efficient. So mining is kind of you can think of it as a race to the bottom. Everybody's kind of competing to be the most efficient possible. So everybody's trying to get the fastest hardware, the cheapest power. And if you're not in that top echelon of people with the cheapest power and the fastest hardware and the best operations team you know, being able to repair these things at scale is you're not going to be profitable. It's going to be very difficult for you to be profitable.

Stephan Livera: Right. Okay. So again, if I'm a Bitcoin beginner, I might've seen some ads online about cloud mining. Should I do cloud mining Yan?

Yan Pritzker: Again you know, I personally have never done cloud mining. I don't think it's wise for a number of reasons. One is that historically a lot of cloud mining companies have been scams, like just outright scams. There's no real way for you to know what the company is doing with your money. You send them money and then you just, you assume they're mining, but maybe they're just pocketing it and paying previous users in a, some kind of, you know, Ponzi scheme. Right. but as far as I know, there are a few companies that do quote unquote legit cloud mining, but even still, you're basically just splitting the profits that are already marginal with this other company, right? So they have to stay in profit and you're locking yourself up in a contract that you know, will last a year or however long the contract is. And at the same time, the price of Bitcoin could go up, could go down, the hash rate, which is the difficulty, effectively controls the difficulty of and profitability of mining could go up or down. Things could change drastically, and it's, you know, you're basically locked into a contract. So from what I understand, I don't think anybody's ever made money on this? Except for the mining, company offering the services? I'm sure he's doing quite well. But yeah, I wouldn't recommend it, especially now for Bitcoin.

Stephan Livera: Okay. So, so we're not gonna do Bitcoin mining and we're not gonna do cloud mining, but just as a curious Bitcoin beginner, can you just give us an overview? How does Bitcoin mining work?

Yan Pritzker: Yeah, for sure. I think again, to dispel the myth of this kind of complex equations thing that you hear about in the media mining is not a mathematical problem that needs to be solved. What really happens with mining is that we are creating a lottery system because we need a way to distribute Bitcoin, right? So we're creating this new type of money and the question is how do we distribute it, quote unquote, fairly? Well, we could have a bunch of people, you know sign up to, to receive it and we can give it our names and you can say, you know, my, I'm Stephan, here's my proof of ID. But the idea of of Bitcoin is that there is no central party in charge of the distribution. And so who is going to be responsible and giving out this money?

Yan Pritzker: Well, Bitcoin uses a very clever idea called proof of work. And so the idea there is that we're going to distribute the Bitcoins using a lottery system, but instead of having a sort of centrally run lottery system, like you might have a in your state run, you know, a lotto here in America at least we have, you know, the idea that you just basically buy a ticket and then, they roll some numbers and they show them on and whoever one gets to clean the prize. We want to do the same idea in Bitcoin, but we don't want to have anybody in charge of running those numbers or a ascertaining whether you've won or not. So what Bitcoin does, very clever is it uses the idea of proof of work. Proof of work essentially means I'm playing a lottery system where you generate numbers.

Yan Pritzker: But these numbers have to be very specific. The way it works is we have essentially a very large space in which we are trying to find a very small subset of things that make sense. So for example, it's like looking for a needle in a haystack. Okay. We're basically rolling a die and we're generating a random number and we're putting it through. It is a mathematical formula, but it's not a complex equation it's just a very simple thing called the hash function. And what they had function does is it produces essentially it takes some data, which is the transactional data that's happening in Bitcoin. Things like people trying to send Bitcoins to each other. As well as you know, the Bitcoins that are generating for themselves and they're being put through this hash function to generate a very large number.

Yan Pritzker: And we're trying to find a specific number that's in a very, very small range in a very, very large space. Okay. So what I usually say is that there's as many outcomes to this as there are atoms in the universe. It's roughly on that order of magnitude. So think about the number of atoms in the universe and think about finding a number. You know, if I'm thinking of a specific Adam, you know, you have to find that Adam, right? So how many rolls of the die will it take you to find that Adam? It will take you many, many, many rolls, right? And every time you rolled that die, you spend a little bit of energy. So the idea is we're basically having a lottery system where miners buy lottery tickets, but instead of buying those lottery tickets from some central party, they buy them from the universe by spending energy to generate randomness.

Yan Pritzker: And then that randomness has to fall into, like I said, a small range. And if they find the right magic number that's in that specific range, they show it to the rest of them that work. And then the network, which is everybody else nodes. Anybody who's running a node in the Bitcoin network, which could be you or me or you know, you don't have to have anything special, just computer or even a phone that the everybody on the network verifies whether that miner did the right thing by seeing if, if they actually you know, with evidence that they present does actually lead to that number.

Stephan Livera: Excellent. So you mentioned the SHA256 hashing. Can you explain for us what is actually being hashed together?

Yan Pritzker: Yeah, so again, I'm hashing is the process of taking some data and producing essentially a random looking number. And what's special about a hash function is that you can put in a very small variations to that data. So let's say you take the word, you know, Yan and I hash that word. I might get some really, really large number and then I'll use the word Stephan and hash that word. I'll get a completely different, very, very large number. And even if it's like stuff on with a space, I'll get a completely different number, right? So that's how hashing works. We, we put in some data and we get these, these numbers out of them. So in Bitcoin what we do is we take the transactional data, which is any trends, any movements of Bitcoins that needs to happen. So for example, Yan is sending you know, 0.1 Bitcoins to Stephan, right?

Yan Pritzker: I have announced this transaction to the network. Everybody who is mining on the network has heard about it. And then what they're gonna do is they're going to take that transaction and they're going to add a random number to it. This is like the idea of rolling a die and they're going to hash it, right? So we're going to put it through the hash function and they're going to see if the number that comes out of the other side is in the right target range. Meaning is it in that small space of acceptable answers within the larger space of the number of atoms in the universe. That's kind of the idea. That's that's what happens to produce essentially the first block. Cause we just, we just hashed that transaction. Now it before Bitcoin was, you know, widely available what people had it, miners were just generating Bitcoins.

Yan Pritzker: They weren't sending the, that Bitcoin around to anybody. So one of the transactions in each block, a block has just essentially this list of transactions as being hashed. A one of these transactions is a special one called the Coinbase. And that's the one that actually produces new Bitcoins. So as a miner, you essentially take any transactions that do want to go into the block plus a special one that grants you the block reward, the reward for mining that Bitcoin. And you hash that together to produce a block. Now that's for the first block and now every subsequent block does that as well. But it also attaches a hash of the previous block during that hashing process. So what that does is it creates essentially a chain, a block chain, if you will. This is where we get the word blockchain, right?

Yan Pritzker: It's a very sexy sounding word, but all it is, is it's telling us that blocks and Bitcoin are linked together by their hashes and the hash essentially is proving to us what the contents of that block are and that the contents haven't changed. And that every block subsequent to that block is telling us that nothing prior to that block has changed leading up to it. So we can verify essentially the all the transactions where the Bitcoin was generated at which block it was generated at which black it was spends. We can kind of follow the trace of any Bitcoins that have ever existed in Bitcoin because of this idea that blocks are chained together

Yan Pritzker: And putting on my Bitcoin beginner hat again, I might be thinking, well hang on Yan it's all well and good that you've got to get within this certain target range. But couldn't I as a miner cheat that system? Could I just write a number that's below the nonce? What's stopping me from doing that?

Yan Pritzker: Yeah. So the word nonce you just used for the beginners it means a random number. So what we're doing is it's called its number used only once. This, that's what non stands for. So we're rolling this die, we're generating this number. Yeah, miners are welcome to do what they want, right? So miner produces this hash. What is a miner trying to prove in order to quote unquote win the lottery? They're trying to prove that they're taking transactions, which are valid transaction, meaning they're spending coins that actually exist, meaning that the people spending those coins have provided signatures, which essentially say, prove to everybody that they own these coins and they're not spending any coins that have been previously spent, right? That's called double spending. Those are kind of the basic things that make transactions valid. So when a miner produces a block.

Yan Pritzker: They're telling us here are all the things all the transactions that I put into there, including that special Coinbase transaction, which grants them today, a 12 and a half Bitcoin reward. So every block contains in a 12 and a half Bitcoins of reward. Now, let's say they wanted to cheat that, and instead of that 12 and a half Bitcoin reward, they produce one with, you know, a thousand Bitcoins in it. What's to stop them from doing that? Well, nothing, they can totally do that. However, when they broadcast that block, the trick is they need to get everybody else in the network to accept that block and put it into their block database. Which means that any, remember, all blocks are chained together to previous blocks, right? So the network comes to consensus on what the previous blocks have been.

Yan Pritzker: So if I as a miner produce some block that is essentially invalid because it doesn't follow the rules of Bitcoin, well no other miner will take that block into their database. And so they won't mine on top of it. They will never link new transactions to it. And also if I as a miner, I try to spend those coins to somebody who's running a node, so let's say an exchange or a merchant selling, you know, a pack of socks or whatever it may be have you tried to spend those coins? Then that node will also reject those coins because they will never have that block in their database. Their node software will say, this is a counterfeit, this is a forgery, and we don't want it in our database. So nobody will ever consider those coins valid.

Stephan Livera: How does mining work in terms of the reducing reward over time? I guess there's two components to that, right? So what we're referring to specifically is the block subsidy component of the block reward. So why is that block subsidy going down over time?

Yan Pritzker: Right. So we have two components to the block reward, as you said. One of them is a subsidy, which is these 12 and a half Bitcoins that we generate per per block. And then we also have the fees, which are essentially anybody whose sending a Bitcoin transaction can voluntarily select a fee zero or more. And essentially miners decide which transactions they want based on fees. So it's kind of a market-based a solution, but to talk about the reward. So what happened with Bitcoin is Satoshi decided to have it distributed over, and now we don't know the exact motivations of, you know, why he chose this specific distribution curve. But the way that it's designed is that a Bitcoin's block reward is cut in half every four years. So the very first Bitcoin block that was produced had 50 Bitcoins generated.

Yan Pritzker: And that happened for the first four years. After that, we went to 25 Bitcoins for the next four years, and then we went to 12 and a half Bitcoins, which is where we are now. And we're just about to come up to a, another having, which is happening in around may of next year, which will bring us a six and a quarter Bitcoins. So why, why does this happen? Well, again, this is enforced by the rules and the software. So in the software, we know that at a certain block height, we, the block reward should be this or that. Right and so if you try to produce a block reward that is outside of those parameters, you're gonna get rejected. So today, miners have to produce 12 and a half Bitcoins per block. If they produce one that has, you know, 50, then that block won't be valid. That was valid, you know eight years ago or whenever bitcoin was born 10 years ago.

Stephan Livera: Okay. So what are some other things that might make a block invalid? So one, as you mentioned, is if the miner tries to give themselves too much reward, or too much block subsidy. And are there any other things you can think of there that would make it an invalid block? And would that, I guess, would that make it still Bitcoin or could someone, would that make it something else?

Yan Pritzker: Yeah, I mean, a block has a number of validity rules. I mean there's there's a lot of things, but I think the ones that I mentioned are probably the most important. Signatures are really, really important, right? Because the way that we determine who gets to spend Bitcoins is that we essentially lock them up into boxes where people have the keys to them. That's what we call a private key. So when I send the coins to Stephan, Stephan those are locked with Bitcoin, with Stephan's public key, essentially that's corresponding to his address. And then when he wants to spend those, he has to unlock them by providing the private key to that. Mailbox now, he doesn't actually show anybody the key. He just shows people a signature. And a signature is kind of an encrypted version of the key that tells us that he does in fact control it without actually revealing it.

Yan Pritzker: That's kind of in layman's terms. So the idea is if you're spending Bitcoins, you have to absolutely provide the signatures. And so those are controlling who gets to move what and those absolutely must be valid for the block. The block reward has to be correct and obviously any miscalculation really in the block is could trigger it to be invalid. We actually recently experienced some that potentially had a bug in their software and granted themselves the wrong amount of reward. And that was like a \$50,000 mistake right there where they had generated a block and basically lost all that money mining and not having received the reward. So that does happen even by accident.

Stephan Livera: Okay. So how about now the hash rate? So what is the hash rate and what's the relationship there with the dollar value of Bitcoin?

Yan Pritzker: Yeah. So as we said, you know, mining is an industrial process and it's about miners basically burning electricity. And what they're doing there is they're playing that lottery and they're producing Bitcoin by, proving to somebody that they've generated a number that is statistically improbable, right? So the issue there is, well, what happens if we have more miners? Right? So let's imagine that there's just, you know, 10 miners on the network and they're all mining away. All have the equivalent amount of hardware. They're all doing the same thing, and then all of a sudden the price of Bitcoin is going up. And so everybody's looking around, they're saying, Hey, this is really cool. We can make a lot of money. Let's go and make some money. So we have 10 more miners that join the network and they start mining as well because they want to generate Bitcoins.

Yan Pritzker: So that would cause Bitcoin to produce blocks too quickly, right? Remember the idea is that Sitoshi program then this every four years, we reduced the block interval and we want to, we want Bitcoin to take a long time to actually distribute all the way to the end, actually it will be somewhere in the year 2140 that will finish distributing it. So if every time the price goes up and more miners, want to mine, and we started doing producing blocks too fast, that's, that's an issue, right? We're gonna violate that issue with a schedule. And one of the most important things about Bitcoin is it's credibility with us monetary policy. So we know exactly how many Bitcoins are going to be assured at any given time. We know exactly how many total there will be and all these kinds of rules, right?

Yan Pritzker: So more miners come into the network, what happens? How does the network deal with that? How do we prevent Bitcoin from being issued too quickly? This is, I think, the most interesting and clever part of Bitcoin, and it's called the difficulty adjustment. So this idea of how many die roles the miners can do per second, it's called the hash rate by how many ashes we can do per second equals how many lottery tickets we can buy per second equals how many Bitcoins we can eventually produce. So if too much hash rate comes on board, then the difficulty adjusts. So what does that mean? Well, every 2016 blocks, which is approximately two weeks, we essentially look back in history and we say, well, how fast have we been producing blocks? Is it more or less than 10 minutes? On average, we want to have blocks be about 10 minutes apart on average.

Yan Pritzker: So if blocks are coming too quickly, then we're going to increase the difficulty, which means that we're essentially shrinking that acceptable range for what those lottery tickets can end up being in. So again, imagine we're trying to hit a number in the space of all Adam's in the universe. And at first the acceptable range is like from zero to a billion. And then we shrink it to from zero to a million, right? We've dramatically shrunk that. That range and now we made it a lot more difficult to mind. And so essentially that's what's happening with mining is that whenever the blocks are coming too fast, we adjust the difficulty upwards and then essentially miners less profitable because it takes them more hashish to generate the same amount of Bitcoins. And then the same thing happens in the other direction.

Yan Pritzker: So let's say the price of the Bitcoin is falling and now all of a sudden it's costing miners too much and hardware, electricity, operational costs and they're starting to become unprofitable. And this, this happens especially in areas where, for example, energy costs can be variable. So let's say you're in a place that gets really hot in the summer. Energy costs go up, heating costs go up, and all of a sudden you're actually spending more money to produce that Bitcoin then than the Bitcoin's worth. Well, that's, that doesn't make any sense for you as an economic, you know, as a rational actor. So you're going to potentially turn off those miners unless you want to speculative loo speculatively, run them. But most people would just curtail at that point, turn those off. And then that means the hash rate is coming off of the network.

Yan Pritzker: So now all of a sudden the blocks are getting too slow. Okay, well how do we compensate for that? We make the difficulty lower, which means we make the target range bigger. So we make it easier to find that needle in the haystack because the space of needles is larger. So now we're letting people, you know, we're making it more profitable with my Bitcoin. So again, we're balancing in the other direction, and this is kind of a thing that happens all the time if you look at the charts that estimate hash rate and to be clear, we we don't know what the hash rate actually is. We kind of estimated based on the number of blocks we're finding and how often we're finding them and that kind of thing. So we are taking a guess at what the hash rate is, but we can kind of figure that out based on the difficulty and the blocks being produced. And yeah, that, that essentially adjusts up and down all the time. And over time, as the price of Bitcoin goes up, we just get more and more miners. So that's what we've been getting for the last 10 years, almost on a exponential curve.

Stephan Livera: Right. Yeah. So I guess that that rise in the hash rate is coming from a number of things, right. So part of that is just better technology, part of that is more people trying to do mining and more resources being devoted to mining, which I guess some of that is getting into this concept of the business of mining as opposed to the technical component of it itself. Do you have any comments for the beginner in terms of how that has looked over the history of Bitcoin? Like how miners tried to somewhat Play the cycle?

Yan Pritzker: Well I'm not sure what the, can you be a little bit more specific about that?

Stephan Livera: Just around how some miners are effectively, they're sort of speculating into the right, right. Yeah. So they have to somewhat speculate. Oh, okay. I think the hash rate is going to rise this much. And that's why I need to be careful what projects I undertake.

Yan Pritzker: Yeah, yeah.

Stephan Livera: This number of machinery, right?

Yan Pritzker: We've definitely seen, the history of Bitcoin mining is started with just people on laptops, right? We used to have, it was okay to mind with CPU because the difficulty was very low, so everybody was just mining on their computer and then eventually it turned into GPU which are, you know, graphics cards. And eventually we got to the point where everybody was manufacturing custom hardware. And this is again that sort of race to the bottom where everybody is trying to get as efficient as possible because the more efficient you are at generating hashes, the more you can kind of outcompete the other guy.

Yan Pritzker: But it's also possible to grow too quickly. And if you grow very, very, very fast and you balloon your operation, then all of a sudden a bear market hits and the price of Bitcoin tanks, now you may be in a bad spot. So it's actually very tricky. I mean, we've seen miners go out of business. We've seen new miners come on board in places, you know, like Iceland or the far reaches of, you know, Canada where we have cheaper power. So I think the interesting thing about the, the the business cycle here is that the price of Bitcoin as it goes up creates more mining interest. People want to mine, they think it's kind of free money. They started building businesses around it and then a bear market hits. And if it's a brutal bear market, it really does a great job of washing away any if in inefficiency because you know, unless you're, you're able to sustain longterm operations throughout, you know, potentially a year long bear market, you're out of luck and you're going out of business.

Yan Pritzker: And we've seen even giant companies like Bitmain who was a huge player suffered tremendous losses, especially since they of course took a position in Bitcoin cash or Bcash as we like to call it. That was a mistake. But you know, that if you make a mistake as a miner, you don't have a lot of room for error really, because you are really competing in a hyper-efficient market where somebody was slightly cheaper power than you and slightly better equipment and a slightly better operations team. You know, you're toast. So I think what we're going to see in mining, it's very exciting because we recently just heard the announcement about layer one, which is a company building a data center out in Texas where they're going to try to vertically integrate, they're going to produce their own hardware, they're going to essentially have their own power plant or substation and they're gonna run that whole operation vertically integrated. So what that's gonna do is it's going to make their costs of producing Bitcoin very, very low compared to other players. And so that's going to mean that everybody's got to step up their game because otherwise they're going to be left in the dust. The difficulty will adjust upwards and everybody will become unprofitable. So I think the next couple of years of mining are going to be very interesting to see that play out.

Stephan Livera: Great. Yeah. Let's talk a little bit about mining attacks now. So there's one attack known as an empty blocks attack. What's that?

Yan Pritzker: Yeah. So people talk about a 51% attack in mining, which is essentially the idea that if you have more than half of the hash power of the network, you can dominate the production of blocks, right? Because if you think about it as a lottery then you know, you toss a coin and if that coin is not fair and the more you're getting heads more of the time, then you're winning those blocks, you're being able to produce more blocks than the next guy. And then the way that the Bitcoin consensus works is that we just go with whatever chain has the most proof of work, right? Meaning that whoever's expended the most amount of hash rate gets to produce those blocks and those will be considered valid by the system as long as they follow all the other rules. So what does it mean if you have more than the half of the the hash power of the network?

Yan Pritzker: Well, it means you can dominate the writes to the ledger. So let's say you know, you're producing the, the chain is five blocks long and you producing the sixth block and the seventh block and the rest of the network isn't able to keep up with you, right? So now that you're producing essentially every block, or you can eventually make it longer chain, you control what goes into those blocks. So one of the things you can do is you can mine empty blocks which essentially will prevent Bitcoin from working. Because nobody will be able to transact. They will submit transactions, but they'll never make it into the database. They'll never make it into the actual ledger of Bitcoin, which is those blocks. So that's an attack that you can definitely do. However, it's very, very expensive to do.

Yan Pritzker: So it requires you to not only control half, of the well, in order to control half of the hash rate, you pretty much have to have half of the hardware and you know, half of the the energy expenditure of that network. And you know, as people like to say, a lot of times in the media when they, when they're like making fun of Bitcoin is we spend like as much energy as, as a small or medium sized country on this thing. And that's a great, that's, that's how we keep it secure, right? Because in order to attack Bitcoin, you're going to need to amass the resources of a country to produce those blocks faster than the competition. And while you're doing that, of course the competition is going to also step up their game and try to compete with you. So it's a very interesting system that way.

Stephan Livera: Right. And I think you're also making the point there that it's not a onetime shot attack in order to do this sort of attack. It's a sustained expenditure enough that people, I guess, lost faith in the idea of Bitcoin ever coming back.

Yan Pritzker: Yeah, absolutely. I think, you know, people will talk about this a lot, but the, the, the, we'll talk about the 51% attack as if it's something that's like, we could just do it any day. First of all, we haven't really seen it. And part of the reason might be that, you know, all the miners are just kinda like committed philosophically to mining Bitcoin and they don't wanna attack it. But I think the real reason is that you can't really sustain it indefinitely, right? I mean, you can sustain it for an hour a day, you know, maybe even a week, right? Depending on how much. It's all about the resources. If it's a nation state and they want to like print money infinitely to sustain an attack on Bitcoin, I mean, they could do it. The question is what, what does that do though?

Yan Pritzker: Right? So, yes, you can prevent the chain from moving forward by mining empty blocks. But if it's really an attack, this is sustained for weeks, first of all you're, you're essentially competing against every other player on the planet. I mean, there will be mining operations that can just add hardware and overcome you. But even if somehow by some magic you have, you know, essentially so much money that you're printing these ASIC mining machines and you're printing your own electricity essentially. You know, you're wasting the resources of the state to do that. I mean still, we could fork, we could fork the algorithm that we use, right? And that would instantly invalidate all of your attack. And so I think even the fact that that kind of thing could be, could happen makes any kind of even attempt at a tech sort of impractical cause you know, what's the point? You're, you get to do it once and then what you start all over and you have to build your hardware from scratch, everything from scratch. Right.

Stephan Livera: It can be thought of like that's the, that's the going nuclear option, right? That's the, if everything else fails, switch the proof of work algorithm.

Yan Pritzker: Yeah. And I don't think it's going to be easy. I mean, I don't think it's going to be easy to do that, but if Bitcoin is truly quote unquote broken and like there's nothing we can do about it, then I think we will find consensus around some variation of that algorithm that will you know, allow essentially to rise from the ashes and it won't be exactly the same. It would be kind of a different system. But you know, we will destroy the entire mining industry if we do that. We'll have to start from scratch. But again, it would be possible and Bitcoin will be reborn and even if it takes years to rebuild it, it'll be reborn. So I think even the idea that it's impossible to kill it that way prevents these attacks from happening because it doesn't really make sense to waste all your resources. You might as well just like amass Bitcoin and join the join the party.

Yan Pritzker: Exactly right. Yeah. I think maybe put it another way, it's like, it's part of the threat of a proof of work change might be enough to stop somebody trying to attack Bitcoin because they know even if they did, then all the Bitcoin people might just switch out to another algorithm. Right. I mean, and that wouldn't be a simple task, but it would at least act as some kind of deterrent against somebody trying to do that attack.

Yan Pritzker: Yeah. I think so. I, you know, we don't have any proof of this. We don't know what's going to happen in speculation, but you know, if you kind of play out the game theory intuitively kind of makes sense because if you're going to kill Bitcoin, you have to kill it dead. And I don't see any way that you can kill it in a way that it won't, you know, resurrect in some other form. Right. so what's the point,

Yan Pritzker: Right. Yeah. and I guess the other question that somebody might be worried about if they're a Bitcoin beginner, the risk of centralization or mining centralization. And so I guess there are probably three main axes on which to consider this, right. So one of them is literally the mining pools and other one is the geographic location of mining and another one might be around the manufacture of the hardware of mining. So do you have any thoughts just on that and whether we're seeing increasing decentralization in that over time?

Yan Pritzker: Yeah, so with pools too, for the newbies out there, a pool is basically the idea that, you know, because Bitcoin mining is a lottery it's possible that you can just play this lottery and never win it. So you could just sit there, you know, with your computer burning energy, you just never, you'll never mine the block. So pools have arisen as a way to share that risk. So people basically connect to the pool and they share their hash rate. And then if a block is found by a member of the pool, then everybody gets paid out proportionally to what they've contributed. But we've seen over the years that pools have really changed. I mean, pools have come and gone. There was a pool, I believe in 2014 this happened with G hash that did amass close to 50% of the hash, but people left it.

Yan Pritzker: So it's important to realize that pools are simply, they're temporary structures and they're essentially voluntary associations of people of smaller mining operations. So those mining operations, if they suspect the pool is acting maliciously or doing something they don't like could simply leave. I think we're going to see a more interesting evolution of pools with the better hash proposal. Right now that's kind of a thing that Matt Corrallo put together. It's an idea that right now the pool itself decides what is going into the block that you're mining. So you're literally just being kind of a dumb hash producer. You're just, you, they give you data and you hash it with better hash, you as the miner have more control over what goes into the block. So that prevents the pool from doing a lot of malicious things.

Yan Pritzker: So hopefully we'll see that. I know that there's a pool coming. I believe it's a Blockstream branded pool, coming with better hash enabled. So I think once that happens, we'll probably see miners choose that because it's way better for Bitcoin. It's better for decentralization. So I'm, I'm hopeful that that will really change the pool story. Because today it is true that there's probably three or four pools you could put together that would be 50% of the hash rate, but again, pools are not miners, right? So if that were to happen to those pools were to collude in some fashion those, those miners would leave. And again, this is an attack they get to do once and then it's quite known and nobody will ever use those pools again. So it's the same kind of nuclear option as, as the, you know, empty block attack or anything like that where you know, what's the point?

Yan Pritzker: Why are they doing that? If they're being coerced by some state, again, what's the point? Why, how are they going to kill Bitcoin this way? They're not really going to. So yeah, that's, that's addressing pools as far as geographic yeah, I mean, we do know that there's a lot of mining going on in China. It's, it's really hard to say where mining is because a lot of these things are undisclosed operations. So a lot of it's from, you know, just known operations or voluntary disclosure. We do know that China is a leader in mining. It doesn't mean that that's gonna be the case forever. Obviously, like I mentioned a layer one is an interesting effort to bring a lot of mining power to America. And if that's successful, I don't see why we wouldn't replicate that in all over the America, all over Canada other places where we can get cheaper power.

Yan Pritzker: And I think we're going to see a lot of innovation too. We're going to see power innovation. We're going to see people setting up mining in places that we didn't think were going to be profitable before. We're going to see energy companies may be reclaiming some of their curtailed energy cause we have companies like shutting down power production because they're over producing. Perhaps mining starts to live inside of energy producers. Perhaps we see a mining on oil fields like we're doing with Upstream Data and other companies like that. So I think that's going to really change the decentralization game with mining. And then what was the third one?

Stephan Livera: Around hardware manufacturer. So I think in this case it would be around fab, so I guess there's a few things. There's the miners themselves and then there's the chip fab, the underlying chip fabric. So there's components there.

Yan Pritzker: Samsung supposedly entering the game. I don't know where they are with this. I've kind of not followed it. I know there's been some touch and go there. But again, I mean, if it's a profitable industry, why wouldn't more more people compete in it? I think we're still early. And I think that we're in a place where there was massive gains to be had early on and people build out these labs and try to, you know, kind of front run generating new generations of these things. People like Bitmain would produce the chips and then run their own miners. But we're getting to the point where mining hardware is getting commoditized. The designs are well known. How far we can shrink those transistors is kind of hitting a wall. So once that happens, we're going to see more companies play and it will be a commodity. You know, like anything else, right? Like GPUs are now. And so we will see, I think more decentralization there as well.

Stephan Livera: Yup. And now as a Bitcoin beginner, let's say I have sent a Bitcoin transaction and sometimes it can confirm really quickly and other times it confirms, it takes a long time. Now, what is a Poisson distribution and how does that apply?

Yan Pritzker: Yeah. So you might hear that Bitcoin blocks come 10 apart on average. So what does that mean? Does that mean we release a block every 10 minutes? No, because again it's a probability game, right? Bitcoin mining is a statistical game where we're rolling a die and we're trying to get the number, and again, it could, it could take it could theoretically take all day, could take all month, right? So Bitcoin blocks are produced 10 minutes on average. If you take all the blocks and you average them out over let's say a two week period, like we do for the difficulty adjustments, you will find that it is about 10 minutes. But unless of course there's been more or less hash power added or subtracted. But the reality is that for any given block, right, the times, the next block could be 20 minutes, it could be an hour, right?

Yan Pritzker: We don't know when a block is coming. So the real answer is like, if you ask, at this point in time, when is the next one, are we likely to see the next block? The answer is always 10 minutes, right? It's always going to take 10 minutes to produce the next block on average. But because of the way that blocks are sometimes they're very close together, they could be seconds apart or sometimes it could be an hour apart. If you were to throw a dart, like let's imagine that the the block times are all written out on the line, right? And you kind of see the blocks come in and close together, close together, very few seconds apart, and then you see a really big space for one that took, you know, 30 minutes or 40 minutes.

Yan Pritzker: If you were just to throw a dart, you're actually more likely to land in a bigger space than you are in a smaller space. And so this is why there's this effect of like, that your transactions always actually take longer to confirm than the average, right? Because you know, by sampling it that way, it's actually more like 20 minutes. So it's kind of a weird statistical statistical thing is hard to understand, but I think for the, for the beginner the more relevant thing to understand is that there is no guarantee whatsoever about when your transaction would be confirmed, which is a little bit scary, but also kind of fun. It also depends on the block times, right? Sorry, the block sorry, the black capacity, right? So when you're, when you're submitting a transaction you're waiting for the next block to come and that block may or may not include your transaction.

Yan Pritzker: If there's a lot of demand and other people are paying more in fees, well they're gonna get included and you're going to have to wait until the next block. So it's a little bit random. But on the other hand, within, you know, let's say an hour, it's almost certainly going to be confirmed. And the more you wait, the more certainty you get with that. And with the way that the blockchain is structured with the proof of work, the more blocks that are mined on top of your transaction, the more final it becomes, right then the harder it becomes to reverse. Because in order to reverse, you'd have to do one of these sort of 51% attacks and they spend lots and lots of energy.

Stephan Livera: Yeah. So basically what we've spoken through is one of the key sections from your book inventing Bitcoin. Did you mind telling us what are your thoughts on where should the listener think of situating this book? If they're trying to learn about Bitcoin? What's the book that you should read before this and then what's the book that you should read next?

Yan Pritzker: Yeah, I think that the book that I read that really resonated with me the most in the space was The Bitcoin Standard which I think is a great book for people without economic background. Like myself, like I'm more of a technical person. And when I read that book, it made me really understand how money works in general. So I would really recommend to readers to read the, the Bitcoin Standard to understand the economics of Bitcoin because that's something that I don't really talk about as much in the book. My book is more about how Bitcoin works from, the nuts and bolts, you know, how does mining work, how to transactions get into the ledger, that kind of thing. But on the other hand it is very short and I also do cover the motivations for Bitcoin.

Yan Pritzker: So I cover some of the whys and some of the writings of Satoshi. I think those are valuable and then understanding why he wanted to create the system. So I like my book as an intro book and I give it to people who are slightly technically minded, whereas for people who are more generalists, I really like to give Saifes book the Bitcoin Standard because it does give them that nice economic overview. As far as afterwards, I think some of the deeper books obviously if you're a developer, I would recommend Andreas' Mastering Bitcoin that's always popular and very, it goes very much in depth. It's, you know, there's code and stuff like that. My book does not get into code. It really just very high level and yeah, I think Andreas' book would be a good one as well as Jimmy song's Programming Bitcoin. He used to have a course called programming blockchain, but yeah, the book's called Programming Bitcoin, a very good book relating to that course as well. But yeah, that's for technical people if you're not technical, I think you'd get by with the Bitcoin Standard as well as my book. I think you'd get by just fine.

Stephan Livera: Great. I also was curious, I think you had some interesting comments around how Silicon Valley and tech people, they often make a certain error in reasoning or thinking about Bitcoin because they accidentally make a new money without realizing what were you getting at?

Yan Pritzker: Yeah, I actually, you know, I went through this process myself effectively because when I got into Bitcoin in 2016, Ethereum was making a big a lot of noise, right? And I heard about Bitcoin in 2011 but again, I never researched it. So in 2016 when I did start researching, I looked at Ethereum first and they had really good marketing and it was all a, you know, you can create a bank in a hundred lines of code. It was very exciting as a developer for me, it looked very, very attractive. And I asked other developers as well, and they, they said, yeah, we heard of Ethereum. It looks like you can create these really cool financial constructs in a very small amount of code. So I really went down that rabbit hole for probably six months studying theory.

Yan Pritzker: I'm studying all these other blockchain projects and stuff like that. And it wasn't really until I started reading some of the economic thought around Bitcoin. Actually part of the reason why I found your podcast Stephan. I started understanding the the economics of Bitcoin, the monetary aspects the Austrian economics stuff. And what that led me to is understanding that Bitcoin is money. And so if it is money, right? What crypto has done is it's created a free market competition for money, which we've never really had. Well, not in recent times, right? Back in the day we did have free market money, which was gold. We had other metals that competed for that and, but they lost that battle because gold was the hardest and the most saleable. And so if you think about that in crypto, we have no barriers, right?

Yan Pritzker: We don't have a nation state. We don't have the government saying, you must use this currency here because if you go to Venezuela today, nobody in Venezuela wants to use Boulevard, right? That's something imposed by the government. If they could have their choice, they would much rather take US dollars. That's a much better currency, right? It's more liquid, it's more saleable, it holds its value better. And that's why the world frankly, always uses U S dollars, right? If there's a black market anywhere in the world, it's pretty much a US dollar black market because as far as fiat currencies go, the U S dollar is the most liquid, the most salable, and the best sort of value. But in crypto, we don't have nation States, so nobody's protecting one crypto from competing with another on it's monetary properties. And so what does that mean? Well, basically if you buy Ethereum, well, you either think that Ethereum is money, that ether is money, right?

Yan Pritzker: Or you're speculating on ether as a project of some kind, and you're eventually going to sell that ether for money. Well, what is money? Well, money is the most salable and hardest thing in a free market, which is Bitcoin, right? So you're either going to be selling your ether for Bitcoin, or you're going to be selling it for you as dollars if you don't believe in Bitcoin. Which makes it so that any of these projects that maybe they're interesting ideas, maybe they have some technical merit, right? But by virtue of the fact that they produce a coin, something that trades like a money in a free market against Bitcoin, they're basically creating a losing proposition for themselves because nobody wants to hold those things long term. And this was kind of the idea of this, you know, people try to create this utility token thesis where they said, "well, people are going to hold these tokens because they're going to appreciate and value for this or that reason".

Yan Pritzker: But maybe in a closed ecosystem they would, but you're always forgetting that they're competing against Bitcoin, which is the hardest and most saleable money. So from that perspective, I think anybody who's creating these projects with these sort of native tokens, they're kind of forgetting that they're inadvertently creating money and the people are going to eventually have to hold the money that's actually appreciating in value, which is, or at least holding its value, which is Bitcoin. So that's going to cause all these to reduce in value. And if that happens, then, especially if they're doing something like providing security for the system, like ether is supposed to be the money of Ethereum because it has to provide a security. It has to pay the miners, right? So that's security for, Ethereum. And then it also has to act as money for any of these sort of DeFi ideas that are floating around, right?

Yan Pritzker: Like people are saying, we can issue loans on a theory on, well, you have to lock up ether and pretend that it's money. But if it's not money, which means it's not the most saleable and hardest thing, well then it's not gonna retain the monetary premium and it's gonna go down in price and the whole thing's gonna fall apart. And so that's kind of what I've realized. And I think that it's funny because tech people of which I am one, I would definitely classify myself as says that tech person, they actually fall into these scams like much more readily than, than people with an economic background. So once I started listening to people in the economic background, I started realizing how, how none of this makes any sense. Which it does, it does on paper, on paper. It totally does. I mean the marketing is very good, but the reality of it, yeah. It's free market competition and people are just not going to hold this stuff.

Stephan Livera: Right. Yeah. No, that's great. Look, I think we're pretty much running out of time here. But yeah, and before we let you go, can you make sure you tell the listeners where they can find inventing Bitcoin and where they can find you online?

Yan Pritzker: Yeah, definitely. So I'm on Twitter. My handle is scoop, which is @skwp. It's a very strange name. I chose when I was 14. If you hit me in DMs, I'll explain it. And then you can also get the book on Amazon or at inventingbitcoin.com where you can pay with Bitcoin if you want. But I don't recommend it cause I have to go through all the work of sending you the book. Plus you have to KYC yourself to me. You don't want to do that. Just buy it on Amazon. But if you do want to give me your sats, I will take them. I will gladly take them off your hands. So yeah, by inventing bitcoin.com or Amazon and find me on Twitter, @SKWP.

Stephan Livera: All right. Thank you very much for joining me.

Yan Pritzker: All right. Thank you, Stephan. It was a pleasure.

This resource was provided to Saylor Academy with the permission of Stephan Livera. You can find the original work at https://stephanlivera.com/episode/121/.