ASH BENNINGTON: Anders, welcome to Real Vision.
ANDERS BROWNWORTH: Thank you, Ash. This is a pleasure.
ASH BENNINGTON: It's such a pleasure to have you here. Anders, one of the things that I find so interesting about your demo is that very often when you ask people what a blockchain is, they tell you what it can do, they give you use cases, they say, Bitcoin is digital gold, Ethereum is a place to write smart contracts, but they don't actually tell you what it is. What I find so fascinating about what you've done here is that your videos do something that I've never seen anyone else do, which is to walk you through in a step-by-step way, that's incredibly visual, concept by concept, the underlying technology for how blockchains work.
ANDERS BROWNWORTH: I only learned visually. This is an outgrowth of having done the Bitcoin deep dive and try to re-explain the basic idea behind it with pictures, because that's the way I think.
ASH BENNINGTON: I should say a little bit about your background, you're currently principal architect at the Federal Reserve Bank of Boston, you were a senior software engineer at Circle. Way back, I think in 2014, you co-taught the first blockchain class at MIT.
ANDERS BROWNWORTH: That's right. I was lucky enough to be picked to do that. It's amazing. You go there, and you've got 100 of the best minds in the world, and you're supposed to teach them something that they don't know. It's incredibly, invigorating. It's a lot of fun.
ASH BENNINGTON: Well, I should say, you certainly succeeded in doing that. Finally, I should add, if you enjoy this demo, this walkthrough half as much as I do, shout it from the rafters, tweet it, post about it, tell your friends, share it as broadly as possible. I think this is something really special.
ANDERS BROWNWORTH: Well, thank you are very much. If you want, we can dive right in.
ASH BENNINGTON: Let's dive in.
ANDERS BROWNWORTH: Great. Well, so I think the key is with blockchains, there's only really two cryptographic techniques you have to understand how blockchains work. We're going to just quickly get a visual feel for how each of those work. This one right here we're looking at is called a SHA256 hash. This is one of them right there. Looks like a bunch of letters and numbers together. It's actually a hex number. What this is, is a digital fingerprint of whatever I type up here. I'm going to type something. I'll type my name, A-N-D-E-R-S. Well, look at that, some kind of seemingly random looking data.
If I were to take this, let's see, first of all, I should note that starts with a 1-9-E-A. Let me delete what I wrote there and I'm going to type exactly the same thing. Sure enough, 1-9-E-A. Anytime I type exactly the same thing here, I get exactly the same hash out of it. In that sense, the SHA256 hash is a digital fingerprint of whatever data I put in here. Now, I could put nothing, I could put lots of data and you'll see every time I'm typing a key, this is changing. You get the idea that this can be calculated very, very quickly, but no matter how much or little I put up here, you're always going to get a SHA256 hash, which is exactly this long.
Importantly, you're not going to be able to go backwards. You're not going to be able to start with this and just intrinsically know what was put in to get it, you can't go in that direction. But super easy to go in the other direction, you can tell because that's how I type, and it calculates it very quickly. I could put anything in here, including like the Library of Congress, and it would always come out to a hash that's just that long. That's the critical piece of information, you can go one way very easily, and the other way is impossible.
ASH BENNINGTON: So, it only moves in one direction and when you type in one character or the entire Library of Congress, the hash always comes back the same length.
ANDERS BROWNWORTH: Right, and exactly the same, it will always be exactly the same. If you put in the Library of Congress in exactly the same order, you'll always get exactly the same thing out of it.
ASH BENNINGTON: If this is real time actually happening, this isn't a demo. This isn't a video. This is actually the algorithm being calculated in real time as you see it on the screen.
I'm going to make what I call a block out of this. It looks very similar to what we were looking at before, but instead of one text area, now I've got three. I've got one that I call a block, we'll call this block number one. I have an entry here, I'll call it a nonce, we'll go into what that is later. Then just some data, you can type whatever data you want. Basically, this hash here, this SHA256 hash is the hash of the concatenation of all this data. If you take all this stuff, put it together, you get that.
Now, importantly, very importantly, this is an unusual hash, because it starts with four zeros in a row. Completely arbitrarily, I'm just going to say that that makes this block solved. What would happen, Ash, if I were to type something in this data area? What's going to happen to this hash?
ASH BENNINGTON: Well, that's going to change as soon as you start typing.
ANDERS BROWNWORTH: Now, what's the chance it's going to start with zeros?
ASH BENNINGTON: Well, probably 10,000 to one, I guess.
ANDERS BROWNWORTH: Yeah, exactly. It's probably not. If I type something that's going to violate what I call a hash, solve the blocks. I'm going to type something and sure enough, it turns reddish, meaning this is not solved. How could we solve this block? I could go here, and I could put a number. Since my non-serum told you we get back to this, it gives me a field that I can change that doesn't really affect anything else.
I put a 1 there, does it start with four zeros now? Well, let's try 2. Well, let's try 3. As I'm going here, I'm looking for one that starts with four zeros. You can tell I'm not getting it. What we're doing right here is we're mining that. Now, I bet you wonder what this mine button does. Well, literally what it does is it starts at 1 just like what I was doing but it goes all the way up and does it automatically. This is literally mining. I'm going to hit mine. There, it's thinking for a little bit, and it's starting from 1, and it's going to go up to whatever number it needs to get to to find a block that hashes out to something starting with four zeros.
My computer has taken a little bit of time for it but there we go. Had I gone all the way up to 71,000, whatever, I eventually would have run across a hash that starts with four zeros. What I'm demonstrating here is we have a block, and we have done some work to satisfy what is essentially an arbitrary definition of what a solved block is. That is that it starts with four zeros. So, that's it.
ASH BENNINGTON: One of the things that I find really interesting about this is the way that you have this divided up, you have a block, you have a nonce, you have the data, and then you have the hash. It's almost an arbitrary division from the perspective of mining. What makes the nonce, as I understand it so important is that you segregate the data out as the payload. You could think of it as, perhaps an envelope, and it's the thing inside, and then you calculate the series of numbers going through them, iterating through one by one until you solve for the hash that meets the criteria that we're looking for, which in this case is four leading zeros.
ANDERS BROWNWORTH: That's exactly right. Then to move on, let me ask you, this is a block, what's a blockchain?
ASH BENNINGTON: Well, I have the benefit of having gone through your demo over a series of years, but it has to do with the way these are chained together. Show us exactly about how that works because I think this is really just the incredible aha moment that many people will have when they're watching this video.
ANDERS BROWNWORTH: This is how you chain blocks together. I'm just going to make a chain of, in this case here, I've got five blocks. These look just like what we were looking at before but interestingly, I've added this previous, what is previous? Well, that number is this number, is the previous block's hash, and this previous is this blocks hash. Everything else is exactly the same. If I change something here, it's going to break this block. But what were to happen if I were to change something here. It's going to change this hash, but that gets copied up to here. We're going to have two broken blocks. Sure enough, that's what happens.
You might say, well, that's not the end of the world, we could just remine it. I could mine these two, and then we would be fine. Well, as we saw, I'm going to fix that one, I'm going to go back one more and I'm going to add some data here. Now, we have three broken blocks. Now, I'm going to say, well, if you were to mine it, I just hit mine there and that thing is thinking. I want one relatively fast, I hit this one. That one's taking a little bit of time, and then this one. We could remine this blockchain and it would be fine. It would satisfy our definition of what we call solved blocks in a chain.
The problem is, the farther back we go, the more of these you would have to fix. It takes time to mine each of the blocks. The farther back you go, the more of that work you have to do. Let's talk about this for a second. This is the work we're doing, is literally the proof of work that you hear about in proof of work blockchains. This is the work that they're doing.
We need some way to fix this. We have this problem because, okay, I did the work but how are you going to know that I've altered this chain, that I've taken some data and I've changed it? How do you know? Well, we can't really know, we just know we have a solved chain here. What I'm going to do is I'm going to distribute this blockchain.
We've got exactly the same thing, five blocks, but this is in Peer A. We also have a Peer B, and there are five blocks in Peer B, and here is Peer C. We have five blocks. Now, how do we know? Let's say I were to change something. I'll go back in time and change this block, and I'm going to remine it. Let's say I'm mischievous, I shouldn't be doing this. I remine this block. Interesting, it takes a long time. Then I remine this block. When this completes, I've got my altered chain. This is a problem.
ASH BENNINGTON: It's an altered chain, but it satisfied the criteria that we arbitrarily decided with sign, which is those four leading zeros?
ANDERS BROWNWORTH: It does, yeah. But we need to be able to detect that somebody has gone and maliciously changed something here. How do we know? Well, getting back to the hash, remember how it is a fingerprint of some data? Well, this is actually a fingerprint of all of the data in this chain, including the previous blocks, because the previous hashes are copied up. Literally, all I have to do is check this, A, F, A, T, F, whatever, is that the same as E4B? No.
Here's another one that claims it's E4B. So, who's right? Well, democracy. We have this chain, Peer A, that says it's something and then two others that disagrees, so the majority wins, and we just forget about this chain. All of that work that was done was thrown away, essentially.
ASH BENNINGTON: This is such an important point. People frequently asked when they're new to this space. Well, how do I know, how can we know whether a particular computer that's telling something on the blockchain and Bitcoin, for example, is reliable? How do we know that people didn't go in and tinker around with some of the transactions? What you're seeing right here is a real time live demo showing how you can have multiple peers on the network, also called nodes, that have different ultimate hashes, which show that one chain has been changed.
It's really fascinating. It's actually a revolution in that for the first time in human history, you can generate trust in a way that's decentralized. It doesn't rely on a single centralized actor, a big bank, the Federal Reserve to say this is the source of truth. You can see it democratically happening in real time in this demo, and I think that's just fascinating.
ANDERS BROWNWORTH: I should also note though, that this is a very simplistic blockchain. We have five blocks here. Right now, the Bitcoin blockchain is something like 680,000 blocks long. One way to compare all the chains would be to literally lay out 600,000 blocks and check the first one. Is this one the same? Yes. Is this next one the same? Yes. Next one the same?
Or you could just go to the last hash and realize that that is a fingerprint of that entire chain and compare it against any of the others. The blockchain can get arbitrarily long, billions, trillions of blocks long, and it will all always boil down to something that's this long and no longer. It's super easy. It's elegant. It's super easy to just instantly check literally terabytes of data, petabytes of data, in one number. It's pretty neat.
ASH BENNINGTON: Elegant is a word that comes up over and over again, when you hear people who really understand the math such as yourself for how this works. I should say, if you've heard the term Merkle Tree, I know it's a lot of complex cryptography and math behind it, but this is really the basis for basically how you can take a hash of a hash of a hash and aggregate it so that at the end, you can just look at one number and know that the entire chain is authentic.
ANDERS BROWNWORTH: Yeah. That's actually a really interesting point. We know that the chain is authentic or not, we don't know what change was made but it doesn't matter. The only thing you care about is that you have the authentic one. If there has been a change, it doesn't matter what the change was, we're going to drop it. A hash gives you a real easy way to do that.
Now, we've got a problem with this blockchain here. This is a blockchain and it's got some data area, I can type whatever I want. Who cares? This is not valuable information, I'm trying to save the letter A, that's not great. Let's do something about that, instead of that data area, what I'm going to do, and this is a blockchain, just like we're looking at before, five blocks long, but the data area, I've replaced with what I'm calling transactions. This is just some amount going from some person to someone else. It transfers.
ASH BENNINGTON: There you have it, now you've got a ledger.
ANDERS BROWNWORTH: That's right. Yeah. But importantly, this is a ledger of transactions, not a ledger of balances. We are not saying John's balances, whatever, we're just saying that some amount of money was sent from one person to another.
ASH BENNINGTON: This is such a key concept. I think, for people who think about traditional accountancy, this isn't a stock value, it's a flow variable. It's talking about what's just happened in terms of a transfer. This is a really also, I think, deeply fascinating and pivotal point in how block chains work.
ANDERS BROWNWORTH: These are showing changes of state. It turns out, computers are really good at calculating numbers very quickly. If we were to save the balances here, it would really be duplicate information. We can just say that everyone had nothing to start with. Then they got this money through transfers. That's how this goes on. Let me just to nail the point home. If this is $2700, some amount of dollars, if I were to change that, it's going to break the block, and this is very, very important.
Even if I were to change literally like one penny, if I were to make this 64 cents, it's going to break the blocks. That's very important. Now remember, we also have Peer B, and C, the same thing we had before. We're going to essentially, democratically figure out what the authoritative chain is just by checking who has what and pointing to the one that has the majority as essentially the winner, but I've got a problem in my little system here. I don't know if you can find it easily or not. Any ideas?
ASH BENNINGTON: I think I see it but walk us through.
ANDERS BROWNWORTH: Where does money come from? How do I know that Rick here has $62 to give to Elsa? How do I know that this much money is in this guy's account for that person? By the way, I don't know if you know all these names. These all come from a movie, if you what movie that is, you get extra points.
ASH BENNINGTON: I was like, Casablanca?
ANDERS BROWNWORTH: It's Casablanca. That's right. Each one of these are different movies. The interesting thing here is we have no way of knowing, like money just appears, the money is just moving around. That's great. We can't just have unconstraint-- I can't just say, somebody I make up gives hundreds or million dollars, that sounds like a great idea, but it's probably not good in an economic system. We have to have a way to get money into this system.
In order to do this, we're going to use what we will call a Coinbase transaction. We'll zip forward to five here, I'm just going to add a new transaction at the top of the transaction stack, called a Coinbase. Regularly, every one block, I'm going to release $100 to someone. Who? Well, this happens to go to the person that has mined this block first. Now, we have a regular transmission of money. I create money in the Coinbase, so it's controlled. It's always going to go to someone, and then those people can then transfer the money.
Let's go back to the beginning of this chain. The first block here has a $100 Coinbase transaction goes to me, I happen to have created this block, I happen to have solved this block, but there are no transactions because nobody has any money to send to anyone,