This video belongs to the openHPI course Blockchain - Revealing the Myth. Do you want to see more?
An error occurred while loading the video player, or it takes a long time to initialize. You can try clearing your browser cache. Please try again later and contact the helpdesk if the problem persists.
Scroll to current position
- 00:00In our openHPI course "Blockchain: Revealing the Myth", we now consider the second
- 00:07component of the bitcoin system - the blocks and the chain of blocks.
- 00:13Let's shortly review that we already discussed that there is a majority decision
- 00:19by the longest chain of
- 00:25the history of the transactions.
- 00:28We have no central authority, there is no trusted third party,
- 00:33all transactions are publicly announced, users are pseudonymous,
- 00:39and we have a system for participants to agree on a single history
- 00:44of the order in which transactions were received and the majority decision is represented
- 00:51by the longest chain in which the greatest proof of a work effort is invested.
- 00:58In order to prevent fraud in order to prevent double spending
- 01:02a peer to peer distributed timestamping is used that generates a computational proof
- 01:09of the chronological order of the transactions and the transactions
- 01:14that are computationally impractical to reverse protect sellers from fraud.
- 01:23The system now we have, but if we would implemented and uses in practice
- 01:28it would be much too slow. If you think for each transaction this
- 01:34proof of work need to be done too inter-connected,
- 01:38so we cannot do this every time a new transaction arrives.
- 01:44So the users have to solve a computational complex task
- 01:50and to cryptographically link by generating hashes all the
- 01:55transactions individually with each other.
- 01:59And exactly to make this process more efficient,
- 02:03each user first collects a number of received transactions
- 02:09into a so-called block.
- 02:11A block of a specified size.
- 02:16And then work on finding a difficult proof of work for this new block
- 02:22is done and this proof together with a hash of the previous block
- 02:27are added to the new block.
- 02:29So we have here exactly behave in the same way like we explained
- 02:37on the level of transactions. Now to make the system more efficient,
- 02:41we do this on the level of blocks and blocks are a collection of a transactions
- 02:48received with the users.
- 02:52Now let's have a closer look to this computational task that demands
- 02:59a huge CPU effort work.
- 03:02Like previously we mentioned this work proves
- 03:08that the block chain is in the right order and makes it difficult to manipulate.
- 03:16How this computation tax looks like? And this computational task
- 03:22consists of simply trying out a number of hash values
- 03:27to find a value that corresponds to a given target.
- 03:32You remember, hash functions are one-way functions, so one can
- 03:36do something and computes a hash value than can manipulate
- 03:40and then the next hash value is computed. Here we insist that the resulting hash value
- 03:48is below a given target.
- 03:53To do this, the user needs something to change
- 03:59the block, to change the block for providing a new hash
- 04:04and of course this could not be as a transactions and other important information,
- 04:09so there is a nonce edit.
- 04:13So an arbitrary number which is called a nonce and this is used together
- 04:19with the information inside the block to compute the hash.
- 04:25And this nonce can be changed to come up with
- 04:30a new hash value which is hopefully below of the target.
- 04:37So this nonce, this is typically combination of symbols
- 04:43that is only used once in the respective context in this context is
- 04:49to provide the possibility to vary
- 04:53in the hash values of a block without touching the transactions inside the block.
- 05:01So if result at hash isn't below of the target
- 05:07the user keeps trying to incrementing the nonce in the block
- 05:12until a value is found that gives the block a hash
- 05:16that is below of the target and this can be seen that it starts with the required
- 05:24zero bits. The smaller the number of the more
- 05:28zeroes we have. So here this is the idea
- 05:33and incrementing the announce does not mean that the hash value is incremented
- 05:39because the hash value does not content depend from the content
- 05:46of the value. So in this way we have a block
- 05:51and we add this nonce, we compute the hash,
- 05:56the hash its here if we look to hexadecimal numbers we have a target,
- 06:04a target, this is where we have to find a nonce that our hash
- 06:10is below of the target.
- 06:12You see here is the number of zeros,
- 06:16this gives the size of the target and we have to find a nonce
- 06:25set the hash value of the block
- 06:29with all the credentials with all the transactions plus a nonce
- 06:33is smaller sends the target and if not we have to redo.
- 06:40So if this proof of work would be too easy to solve,
- 06:46we would get a large number of forks, because many people come
- 06:50up with the result eventually working with other
- 06:54with other collections of transactions inside the block, so
- 06:59this needs to be prevented. So there should be a gap
- 07:03between the different block creations
- 07:07in the bitcoin system, ten minutes are considered as a good gap
- 07:13to save for stability of the network and not get too much forks.
- 07:22so the computational task need so difficult that it needs
- 07:29around ten minutes to find the solution that needs a huge amount of
- 07:36CPU power, it needs a huge amount of energy to provide this.
- 07:43So the solution implemented in bitcoin system is to vary
- 07:48the proof of work difficulty, that means to adjust the target
- 07:53according to the change in the hash rate of the network.
- 07:58So it is ruled in the bitcoin that the target
- 08:03adjust every two thousand and sixteen blocks.
- 08:07This is roughly produced in two weeks
- 08:10such that ten minutes are required to create the new block,
- 08:15so that the target could be made more difficult to reach, can be
- 08:20changed every two thousand and sixteen blocks to hold this gap,
- 08:24stable this gap of ten minutes between the production of new
- 08:30blocks remained stable.
- 08:34If the computing power of the entire network increases,
- 08:38or eventually decreases and the two thousand and sixty blocks
- 08:41are found in less or more than two weeks, then the level of difficulty is raised
- 08:48or lowered accordingly. So in this way as
- 08:53a stable increase on the chain of the blocks can be guaranteed.
- 09:00Now the question is what is the incentive
- 09:04for the users to stay honest?
- 09:08To encourage them to stay honest, to expend a lot of CPU power, to expend electricity
- 09:18by forming such blocks.
- 09:21Such valid blocks. It's a huge work it's a huge amount of energy
- 09:27and it's needed, otherwise we could not run our peer to peer network
- 09:33in a safe way.
- 09:36It would be definitely wrong to assume that all users act rationally
- 09:41and follow the set rules strictly
- 09:44only to have the option of a cash system without a third party
- 09:50and using the peer to peer electronic cash system also for similar values.
- 09:57So what is necessary? We have to have a closer look
- 10:03to the network to discuss and understand what could be the incentives
- 10:08for the users to stay healthy or to invest this proof of work in running
- 10:16the bitcoin network in a correct stable way.
- 10:22To summarize what we have had up to this moment,
- 10:27to make the process of cryptographic linking more efficient all users first
- 10:33collect transactions received a into a block.
- 10:38So they do not this proof of work with every new transaction
- 10:43they collect transaction into a block and then they do this work.
- 10:49So the need to generate the hash of the block
- 10:54and work on finding a difficult proof of work
- 10:57forces a new block and this proof together with the hash of the previous block
- 11:03are added to the new block.
- 11:06So in the new block with adding the hash as as a proof of work
- 11:12gives the other users information that this user who produced this block
- 11:19has really invested this proof of work.
- 11:27The proof of work is represented by a nonce, by an
- 11:33additional value, which in combination with a block
- 11:38after hash function gives a value that's below the current
- 11:42target as a current target and here with announce one can play
- 11:47and can look to find such a nonce said the hash of the block
- 11:53and the nonce is below of the target and this target is adapted
- 11:59from time to time in such a way that this proof of work
- 12:05needs around ten minutes.
To enable the transcript, please select a language in the video player settings menu.