In blockchain technology, hashes serve as unique identifiers for transactions that cannot be reversed, and Merkle trees combine these hashes hierarchically to create a summary hash for each block, enabling immediate detection of any tampering. Mining involves solving computational puzzles where miners guess a nonce value and hash the previous block hash, transaction summary, timestamp, and nonce together, with the winning condition being a hash output starting with four leading zeros. The difficulty of this puzzle is automatically adjusted based on statistical probabilities to maintain an average block time of approximately 10 minutes, creating a self-regulating system where factors like energy costs, Bitcoin price, and equipment efficiency influence miner participation and network security.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Hashes Merkle Trees & Mining
Added:[Music] okay let's talk about hashes uh the merkle tree and mining and how it all fits together it's important to understand about the hashes again like we said they're unique identifiers uh they can be tied to a specific transaction statement right they can't be tied back and um and and knowing one transaction statement doesn't give you any more information about knowing the second or third so i'm gonna i'm to go straight to this slide because i think it starts to explain it so while one input always represents one output we can do something called blending hashes so what i mean by that is let's say we take these top three inputs right the circle the circle with the dot in it and the square we can create a hash of each one of those right now this is just an example of a hash because a real ha a real shot t36 hash would be much larger and be in a hexadecimal format but we can take these three hashes and we can we can essentially hash them together to get this summary hash of these three and we can do the same thing with the bottom two hashes we can hash them individually and then hash them together to get this summary hash and then we could take these two hashes the top summary in the bottom summary hash them together to get this this this summary hash and so if there's any change that's made to any of these inputs right so let's say i took this little dot out of the center here it would radically change this hash 46271 which would radically change this hash 83513 which would radically change this final hash so if there were a hundred copies of this blockchain and they all had the most recent block hashed and my block my hash was different than everybody else's everybody would realize that my copy of the blockchain had been corrupted and they would all reject it right and and that's how this is used in blockchain now this relationship of hashes from here to here is what's referred to as the merkle tree so in a blockchain if each one of these um if each transaction is run through a sha-256 generator and is hashed right the block essentially has a has a hashes of each of the transactions which i can hash together into this one summary block right and and then what i can do is i can take so let's say in this very first genesis block i take all of the transaction statements i create a hash of them i create a summary hash of the whole block i can embed that into the second block and in the second block i can take um all of the hashes in the second block blend them together along with the summary hash from the previous block blend all of that together get a new hash and drop that into the third block in which case i'm going to have all of the hashes of the transactions in this block along with the summary hash of the last block create a new hash and that will go into the fourth block you're probably starting to see the pattern here and that way if anybody makes a change to any transactions anywhere in this chain right it will become immediately available to the most recent block or become immediately identifiable that there's something wrong with this block this this block is out of sync with with all the rest so really the purpose of the previous hash is a couple things one is it saves time so when a newcomer a newcomer comes onto the network they actually don't need to download everything in history all they need to do is download the most recent block it saves disk space you know you don't need uh blocks prior to the latest block since the latest block is a has a mix of all the previous vlogs now let's go a little deeper so here are each the blocks they have the transactions of all of the um all the transactions in that block they have that hash that's that's put into the subsequent block which is done here and here now in addition to the hash of the previous block and the summary of all of the transactions it also has a date timestamp and it has one more thing it has something called a nonce now what is it not well we talked before about what the miners do right the miners have to solve a computational puzzle right and so here's here's what here's how they do that they guess some random value and they put it in the nonce and they hash the block of the previous block the summary of all of the transactions the date timestamp and this nonce and when the miner takes these four inputs and runs them through a sha-256 generator they're going to get some random set of numbers and letters a through f and zero through nine now here's how they win the contest right and then when they win a contest they get a block reward and their block gets added to everybody's blockchain but here's how it happens there's a rule set that says if the minor has four leading zeros when they hash all of those things together then they win now remember any character in a sha-256 output can be either an a through f or a zero through nine so what what's the likelihood that all four of the fir the first four characters would be a zero pretty pretty low odds so then they'll guess again what's the chance still pretty low they'll guess again and again and again and again and again until finally they'll put some value in the nonce so that when all four of those things are hashed together the first four digits of the output will be four zeros and at that point figuratively that computer raises its hand and it says hey i figured it out if we take all of these transactions the previous block we take the date timestamp and this nonce that we just guessed is uh abc123 and you put all these together the output is gonna be is gonna start with four leading zeros and remember it's very difficult to guess but it's very easy to check when the rest of the computers at least at least more than half of those computers verify they said yep when i put those four numbers in i get it i get an output that has four leading zeros yep check check check check i agree i agree when when over 50 of them agree then they'll say okay it passes we'll let's all take a copy of this block and add it to our copy the blockchain and now all of the blockchains have been updated with the most recent copy that happens every 10 minutes and if somebody's trying to falsify the system or they're trying to guess and check they would have to do it in less than 10 minutes because 10 minutes from now that next block is going to be added and it's going to completely change the dynamics it's going to because now you'll have a new summary hash to deal with so i hope that that's clear i i know that when i teach this in person uh it's a challenging concept to get so i can only imagine what it's like to uh to get on the other side of the video screen but there's one other thing i have to share with you so remember um i said that a bitcoin um blockchain is going to mint a new block about every 10 minutes well how can you assure it's going to be 10 minutes when this is all about guessing and and somebody might guess guess the right answer in one minute they may not guess the right answer for 30 minutes right so how can you say it's going to happen every 10 minutes it's based on statistical probabilities so given the number of minors that are competing right given a number of factors the difficulty level will be increased or decreased so that statistically the average of block time is about 10 minutes so some will be more some will be less now you're asking how do you adjust the difficulty level if it's based on everyone guessing and checking and they have to get four zeros then how do you make it easier or harder well the number of leading zeros is what determines how difficult or easy it is so if if it's taking longer than 10 minutes right then the protocol would automatically make the guessing easier and they would make the guessing easier by making it instead of four zero making three zeros right or if people were solving solving the the challenge in in less than 10 minutes maybe on average eight or nine minutes then it would add a zero to uh the first four leading to so say that it would have to be maybe the first five leading zeroes right and then that would make it more difficult so the difficulty of the uh of the nonce challenge is is is changed based on the statistical probability that the solution will be arrived in about 10 minutes and that's a little bit about about how that works now one more thing that's not on the slides is a little bit about the ecosystem because people are always talking about energy here's the thing energy is not uniformly um available in some places it's scarce and in other places it's abundant there's some places where there's an excess capacity of energy right and so um and so uh that's going the the amount of energy the price of energy those things are going to impact whether or not miners actually decide to turn on their mining machines or turn them off another thing that will impact it is the price of bitcoin because when a miner solves a challenge and their block gets gets selected to be added to the blockchain that miner is rewarded today i think it's 6.25 bitcoins right so um if the price of bitcoin is very high there's a big economic incentive for people to mine because periodically if they're occasionally if they if they crack the code if they win that's that 6.25 bitcoins is very lucrative right now if the price drops and the price of electricity goes up well a lot of miners will drop out of the mining pool right and if a lot of miners drop out of the mining pool the difficulty level will be adjusted down so that statistically there's a likelihood that a block will be added every 10 minutes another thing that will determine whether or not a a miner is going to participate is the the age and efficiency of his equipment so a lot of bitcoin mining com mining machine companies they will be introducing new faster equipment on a regular basis well if you're competing with other miners and they have equipment that's mining bitcoin at a faster rate than you are right or guessing and checking at a faster rate your likelihood of winning diminishes and if your likelihood of winning diminishes you're probably going to make less money and if the price of bitcoin is low and you're not winning because you have an older machine right that's just not as fast as the newer machines these these are some other factors that would cause you to turn your machines off so the price of bitcoin the cost of energy the the speed and capability of your machine and the difficulty of the protocol all of those things combined create a self-regulating environment so it's really it's really fascinating right now the blockchain and the nonce and and the hashing and all that stuff all that does is tell us whether or not we can trust the blockchain but remember all of those transactions are hashed so we can't read them we we can't use this to determine how many bitcoins are in a particular address for that we have something called the transaction database and what the transaction database does it technically it technically doesn't use the term addresses technically it uses the term inputs and outputs but i'm going to use addresses just to kind of keep it simple and what this transaction database the way it works is it says if you have and again i'm going to call it address technically that's not correct but but hopefully it makes uh it makes sense and let's say you have 20 bitcoins and you want to send uh five of them to me right the the protocol for the transaction database is that any address can you can't have partial a partial quantity there meaning if i have 20 i'm going to send five to you and i want to send 15 back to me it's going to come to a new address right but the transaction database will have the the balances and amounts of each technically it's not called an address technically it's called an output of each output and that's connected to the blockchain so that when you go to do a transaction you'll go to the blockchain you'll see the transaction database the blockchain will tell you whether or not you can trust it and if you can trust it then you'll know how many bitcoins are in that particular address if you have the key to be able to read it right and then a wallet we'll talk about this more a little bit later a wallet is essentially your your your doorway to be able to read the the transaction database um and be able to write to it they basically assign a transaction that says i'm sending um some person three bitcoins so you can you can actually send that to the to the transaction database and you can sign in and then once that happens the blockchain is replicated across the network there is consensus and uh the idea that you have to have over 50 there's this concept called the 51 attack if you held 51 percent of the network it's uh there's a potential that you could essentially um uh create a false uh a false picture of uh of what's been upgraded all right this is generally um hack proof because like i said um with bitcoin it's going to change every 10 minutes it's going to be very difficult to hack this uh the solution and it's important to understand i've mentioned it a couple times but i i can't mention enough blockchain is a protocol there's a lot of different protocols when we talk about blockchain we uh are offering off oftentimes referring to things that are similar to the bitcoin blockchain although there are many very many many variations um which we'll cover in a subsequent module uh but these protocols essentially just like the internet uses http and uh tcpip it's a set of sort of language uh it's in its instructions to allow computers to participate in a blockchain solution right and i think that's it so on the next module we'll talk about what some of these different protocols are
Related Videos
LIVE: HYPE ATH! AERO & WLD Ripping?! SpaceX Huge Move. Big M&A Guest Today Then 21Shares Joins
TheRollupCo
763 views•2026-06-17
Checking In On Polygon
NoNonsenseForex
327 views•2026-06-14
Zebec Network Enables Stellar Enterprise Payroll Now Live! ZBCN
Cryptoneptune
644 views•2026-06-15
Majors steadier, alts battered: AAVE and UNI set the range, AVAX stands out weak
thecoindaily
25K views•2026-06-19
Is a Big Prize Possible with One Move? Cosmic Signature
onlyinvestors5666
391 views•2026-06-17
XRP Has 6 Weeks Left. Stop Ignoring This
The_Millionaire_Finance
219 views•2026-06-17
Chaos W Tokenomics Explained! Red Diamond, Trading, Minting & CROSS Rewards Beginner Guide
midosakinft
190 views•2026-06-19
Here We Go $2B Tokenized On Stellar XLM
2BitCrypto
387 views•2026-06-16











