The Blockchain Bitcoin Computerphile Okay so today were going to talk about blockchain technology and give you a highlevel overview of what it is and how it works blockchain, it emerged in 2008 out of cryptocurrency specifically Bitcoin that had a white paper published and Thats really where it all started So we start, I guess, by defining what it is Blockchain technology is a distributed, decentralized system in which all parties have an entire record and can view the transactions that took place Its a decentralized and distributed network and I can draw that out to explain what a decentralized, distributed network actually is so in a classic centralized network, you have a central node to which all other nodes in the network connect to In a distributed system you might have clusters of nodes with a few links between them, something a bit like this But if you know this node is knocked offline, you lose the part of the data that was stored on that system in a distributed system like a peertopeer network you have something a bit more like this here you can think of talking a bit like in database terms your database is sharded and distributed in components, parts across your network In this distributed, decentralized solution all parties have a complete record of the database and system combined together to add this one single database with each individual node having a complete copy of all transactions, in the case of blockchain So here youve got centralized, here youve got a decentralized network where youve got clusters with only a few nodes connecting the individual clusters and here in this more lattice pattern youve got a distributed and decentralized network you can think of the blockchain system as a distributed ledger or like an old fashion uh, database term, a transaction based database Thats what it fundamentally is, it stores a ledger of transactions uh and its also immutable, which is to say.. it can be updated new sets of transactions can be added to it but, it cant, you know, once somethings added, that block cannot and should not be changed or mutated any further the core technologies that underpin blockchain is hash codes, hash puzzles Merkel trees and publicprivate key cryptography in the sort of common parlance of bitcoin you have what is known as a bitcoin wallet thats actually your public key in privatepublic key cryptography earlier Computerphile on publicprivate encryption but essentially, in the case of blockchain, you have your your wallet your public key and uh your private key and an interesting thing about at least the way bitcoin has implemented on the blockchain technology its all or nothing, so the total wealth of my current wallet has to be spent in a transaction, so if Ive got five bitcoins using the Bitcoin technology and I only want to send one to you then I send one coin to you and four back to myself but I had to do this sort of circular transaction I basically say that that one bitcoin Ive sent to you is I dont necessarily know you, I dont know who you are Theres no reason for us to have met or me to even know your name what Im really saying is the wallet that is labeled by this public key, the person who owns the corresponding private key to that public key Im authorizing them to take ownership of this one Bitcoin and thats how public private key Encryption is used in, in means of legitimizing and, or uh authoring transaction said yes I have said you can spend this amount I wish transfer the amount to you, and you know that that turns got originated from me and not somebody else on the network poking at me The other thing is hash uh Hash codes and merkel trees Basically I can, please throw this out, another interesting thing about the way hashes work is for a given input if I have I know ABC make my input and I put that through hashing algorithms and I get the output, I dont know, uh Zero Five B C Uh I only have to change this marginally, say I add ABC and I add D to it and it will completely change the corresponding hashed code you only have to change the input in a small way to get a drastically different hashcode coming out that will be of the same uniform length, a particular one despite the fact the input which of a different length you can think of it is like labeling it with a uh Im going to use unique carefully here cause there are In occasions you do hash collisions where? different input resolves to the same hash, but youre youre aiming toward uniqueness and the idea is you can think of it as like a fixed length signature for a given input so how this feature further in in block Chains is a blockchain technology The transactions we talked about earlier uh, are grouped to get, you know, you can think of transactions when they first published the network its existing out there in the ether and then the job of you might have heard of sort of miners in blockchain technology The job of a miner is to gather a bunch of these two transactions together form them into a block and the process of doing that is what involves hashing and the process of checking that a block it remains immutable and hasnt been changed It goes on to Merkle trees which are drawn in the next diagram, but essentially one key. I formed my block My block has a corresponding hashcode and how Merkle trees come into it. If we start with a basic block of content that we want to represent in our tree structure in generating our next node in our tree. Im just going to use H to represent hash function Of A and B, and the value of that comes to label this node in our tree Likewise over here, take the Hash of B and C and then here at our top level we take the hash of the hash of A and B, and the hash of B and C and that represents our next level up in the tree and the interesting thing about This structure and about hash code is, we remember from this diagram You only have to change your input a tiny bit to change the output so if I change this base content I make it lower case rather than upper case for example this will then change to this, the hashcode will become invalid as wic and it will persuade and filter back up and that is the core of blockchain technology in terms of how blocks are stored and how its, uh, In a, in a sys, in a distributed system when no one knows anybody else how you know and can be certain that the transaction cannot been tampered with because everyone can see this chain of blocks Having talked about some the underlying data structures give an example of how transaction get grouped into blocks and blocks get grouped into chains so you can think of, uh your, you know your ledger of transactions, you can, when you transaction your first formed on the network they could go out there in the ether the sort of loose transactions that need to be grouped together into blocks in a network Anyone who takes on the role of a miner their job is to grab some of these transactions down from the ether put them into a block If I draw a block here and a block has several things in it has a set of transactions A said something to B B said something to C and so and so forth it also has the hash value of any previous block That were in the network Going back to that Merkle tree structure Additionally it has something known as a Nonce value Which is just a randomly guessed value, uh to impact the signature hash of this block so you hash the combination of the record of transactions, the hash value of the previous block and this Nonce value to generate a Hash Code that uniquely labels this block now the reason behind the Nonce value is to sort of hash puzzle this final hash code that labels this block It will it had to start with four zeroes So what a miner does, he groups his transactions together And he puts in random guesses for that Nonce value until this hash value that labels this block satisfies the Criteria of whatever the hash puzzle is where does this hash puzzle come, your said.. So its part of the mathematics of the the Block chain Network and its a way of, uh, certifying that a grou, a block is legitimate uh and that its agreed upon key, and its a way of managing the distributed nature of the network because anyone can take any collection of transactions very light that are sort of out in the open that not yet formed into a block and Try and create a block and theres this sort of mathematical race of a sort of compute power To solve this puzzle and the first person who solves it or the first group of people that solve it Theyre the ones that generate a block that goes on to the chain so its a way of managing the fact that everybody is free to try and create blocks to add to the chain so what happens then when say two people Both happen to solve a block at the same moment at precisely the same moment now it is rare, but they happen and in those instances You can get forks in block chains.
The people in the network, they see one block added go off and try and build Blocks on top of that block whereas the people that see a different block being added go off and try and continue the chain in another direction Hows that yelled across the network? How is it that everyone has this single agreed upon ledger? What happens is That the longer essentially a sort of a democracy throughout the network, the longest chain is the one that everyone agrees that they should take and the mathematics are such but youre unlikely to sustain Forks for a long period of time as You know people are looking all the time to update their current ledger to the longest chain you know suppose, to keep it simple, we have five people in our network and we have a forked chain. We have two imagine we two competing chains it only takes three of those out of five to have seen the you know the longer of the two chains for the vets bit contention submissively Bishop by Majority vote yet were Were going to reject any chain that shorter than the longest chain the majority the people on the network Ive seen what happens to Any transactions that happens with the shortage only man. You know in the shorter chains.
Thats where youre kind of your transactions Youre in that group. Youre out of luck they go the extent that they go back into the ether. Theyre not yet codified allure Incorporated into the blockchain and so not process not not legitimate all of this Means is actually a slow assistance on at the moment Not as well this will it take it happening very quickly at the moment blocks are in Again, I use bitcoin cuz you tweak the first system And you know one of the most widely adopted in the bitcoin system lock your created that mathematical complexity of that hash puzzle Is on a sliding scale to reflect the compute power of the network at any given point? That blot will be created on average every 10 minutes the further back In the chain a particular blockage the less likely it is for that came to be to the plan to be a a shorter fork and Decided so that the current Waiting period is kailia before counting that the money in your wallet Lets plot to be created at a moment.
That is back an hour So its not Instantaneous, but its not too long to wait and a bad point makes a very slim chance that your transactions going to go back into the ether and then you know to be incorporated in a block later on if you are in the Unfortunate circumstance where you were past that shorter fork of the blockchain and your transaction hadnt been accepted And its been turned back into the ether yeah Youre just wasting for another minor to come along grab that series of transactions you and try and build another block you must leave this all these insults and filming about the fact that be a pointer which lonely bitcoin. Go maybe Thats correct. Yes, if some its like me that this mining will stop at uplands No, but how you will be?
Complicated with more change so at the moment Bitcoins are sort of being introduced to show you through the mining process in that youre being financially rewarded in Bitcoin, I think at this point in time the creation of a block it merits its coins in the wallet of the Minor or as is commonly the case now with people grouping computer out together the group of people that are made after sort of mining pool and At the point where all of all bitcoins have been introduced Youll no longer gain financially from mining in that regard how you will then Gain be through transaction fees and hes where people can Give up certain amount of their trank action, okay? I want to send you He will get a bitcoin Ive got five in my county ahead for rather than camping for back to me Maybe I can three and a half back to me, and I k give the other half to the Minor and during that way youll be financially complicated for The work of of mining so its a bit like a currency exchange or PayPal little taste their feet dirty nose Is this dislike this distribution if these miners are effectively actually like the ages? affiliation well it to the extent where you know that there will be the transaction page which of them at the Moment You know should have not Taking a big part of the network because people are still getting money just from doing the computation work of curing the hash by George But as a system evolved and relies more upon Transaction fees then yes. They will book that have more of a role to play within the network But theyre still likely to be Far below your standards Transaction fees for exchanging Dalek pounds from its original conception theyll only ever intended and designed to be 21 million bitcoins in existence, and you can clearly like to radioactive halflife controlling the release of those were going and how thats reflected is the level of rewards for mining so every and every 21, 000 bitcoins In the bin the book collection area that have produced The rewards for mining and creating a block its aft and show youre introducing half the amount of in network if you were previously in Chianti, so forth until eventually All 21 million bitcoins have been introduced to the network same process in reverse Using the same key and then they get hello back out the other end, and thats nice and simple it works, and it was once Sort of the only way that people did, but it has a problem. Which you both need to know