Search Header Logo
Lecture 7 : Mining and Consensus (Part 1)

Lecture 7 : Mining and Consensus (Part 1)

Assessment

Presentation

Science

University

Practice Problem

Medium

NGSS
K-ESS3-1, 2-LS2-1, K-ESS2-1

+5

Standards-aligned

Created by

Anonymous Anonymous

Used 2+ times

FREE Resource

18 Slides • 7 Questions

1

Lecture 7 : Mining and Consensus (Part 1)

2

Introduction

  • Word "mining" is somewhat misleading - extraction of precious metals.

  • It focuses our attention on the reward for mining, the new bitcoin created in each block.

  • Mining is the invention that makes bitcoin special, a decentralized security mechanism that is the basis for P2P digital cash.

3

" The purpose of mining is not the creation of new bitcoin. That’s the incentive system. Mining is the mechanism by which bitcoin’s security is decentralized. " 

4

  • Miners validate new transactions and record them on the global ledger.

  • A new block, containing transactions that occurred since the last block, is “mined” every 10 minutes on average, thereby adding those transactions to the blockchain.

  • Miners receive two types of rewards in return for the security provided by mining:

    • new coins created with each new block

    • transaction fees from all the transactions included in the block.

5

How Miners earn the rewards?

  • miners compete to solve a difficult mathematical problem based on a cryptographic hash algorithm - Proof-of-Work.

  • The competition to solve the Proof-of-Work algorithm to earn the reward and the right to record transactions on the blockchain is the basis for bitcoin’s security model.

  • The process is called mining because the reward (new coin generation) is designed to simulate diminishing returns, just like mining for precious metals.

6

  • Bitcoin’s money supply is created through mining, similar to how a central bank issues new money by printing bank notes.

media

7

8

Multiple Choice

What is the 'difficulty' in Bitcoin mining?

1

The cost of electricity required for mining

2

The complexity of the cryptographic puzzles that miners must solve

3

The complexity of the cryptographic puzzles that miners must solve

4

The fluctuation in the price of Bitcoin

9

Multiple Choice

As of in April 2023, what is the block reward for mining a new Bitcoin block?

1

50 BTC

2

25 BTC

3

12.5 BTC

4

6.25 BTC

10

Multiple Choice

What happens approximately every four years, affecting the reward for Bitcoin mining?

1

The Bitcoin Halving

2

The Bitcoin Reset

3

The Bitcoin Boom

4

The Bitcoin Adjustment

11

Decentralized Consensus

  • All traditional payment systems depend on a trust model that has a central authority providing a clearinghouse service, basically verifying and clearing all transactions.

  • Bitcoin has no central authority. But how can everyone in the network agree on a single universal “truth” about who owns what, without having to trust anyone?

  • Every full node has a complete copy of a public ledger that it can trust as the authoritative record.

12

  • Satoshi Nakamoto’s main invention is the decentralized mechanism for emergent consensus. Emergent, because consensus is not achieved explicitly—there is no election or fixed moment when consensus occurs.

  • Instead, consensus is an emergent artifact of the asynchronous interaction of thousands of independent nodes, all following simple rules.

  • All the properties of bitcoin, including currency, transactions, payments, and the security model that does not depend on central authority or trust, derive from this invention.

13

Bitcoin’s decentralized consensus emerges from the interplay of four processes that occur independently on nodes across the network:

- Independent verification of each transaction, by every full node, based on a comprehensive list of criteria.

- Independent aggregation of those transactions into new blocks by mining nodes, coupled with demonstrated computation through a Proof-of-Work algorithm

- Independent verification of the new blocks by every node and assembly into a chain

-Independent selection, by every node, of the chain with the most cumulative computation demonstrated through Proof-of-Work

14

​Independent Verification of Transactions

  • UTXO-The resulting transaction is then sent to the neighboring nodes in the bitcoin network so that it can be propagated across the entire bitcoin network. ( We discuss this in previous chapter).

  • Every bitcoin node that receives a transaction will first verify the transaction. This ensures that only valid transactions are propagated across the network, while invalid transactions are discarded

    at the first node that encounters them.


15

  • Each node verifies every transaction against a long checklist of criteria. ( Please refer to text book page 219)

  • Note that the conditions change over time, to address new types of denial-of-service attacks or sometimes to relax the rules

    so as to include more types of transactions.

  • By independently verifying each transaction as it is received and before propagating it, every node builds a pool of valid (but unconfirmed) transactions known as the transaction pool, memory pool, or mempool.

16

  • For example : Jing earn bitcoin by running a "mining rig" - Computer hardware system designed to mine bitcoin.

  • Like every other full node, Jing’s node receives and propagates unconfirmed transactions on the bitcoin network.

  • Jing’s node is listening for new blocks, propagated on the bitcoin network, as do all nodes. However, the arrival of a new block has special significance for a mining node.

    • Competition end

    • Act as announcement of winner.

    • Beginning of the next round.

17

Aggregating Transactions into Blocks

  • After validating transactions, a bitcoin node will add them to the memory pool, or transaction pool, where transactions await until they can be included (mined) into a block.

  • By the time Alice buys the cup of coffee, Jing’s node has assembled a chain up to block 277,314. Jing’s node is listening for transactions, trying to mine a new block and also listening for blocks discovered by other nodes.

  • As Jing’s node is mining, it receives block 277,315 through the bitcoin network. The arrival of this block signifies the end of the competition for block 277,315 and the beginning of the competition to create block 277,316.

18

  • During the previous 10 minutes, while Jing’s node was searching for a solution to block 277,315, it was also collecting transactions in preparation for the next block. By now it has collected a few hundred transactions in the memory pool.

  • Upon receiving block 277,315 and validating it, Jing’s node will also compare it against all the transactions in the memory pool and remove any that were included in block 277,315.

  • Whatever transactions remain in the memory pool are unconfirmed and are waiting to be recorded in a new block.

19

  • Jing’s node immediately constructs a new empty block, a candidate for block 277,316. This block is called a candidate block because it is not yet a valid block, as it does not contain a valid Proof-of-Work.

  • The block becomes valid only if the miner succeeds in finding a solution to the Proof-of-Work algorithm.

  • Question: Alice's transaction included in which block?

20

Multiple Choice

What mechanism does Bitcoin use to achieve decentralized consensus?

1

Proof of Stake (PoS)

2

Proof of Work (PoW)

3

Delegated Proof of Stake (DPoS)

4

Byzantine Fault Tolerance (BFT)

21

Multiple Choice

In Bitcoin's blockchain, how often are new blocks typically added?

1

Every 10 minutes

2

Every 30 minutes

3

Every hour

4

Every day

22

Multiple Choice

What does it mean for a transaction to be 'confirmed' in the Bitcoin network?

1

It has been verified by a central authority

2

It has been included in a block and added to the blockchain

3

It has been broadcast to at least one node

4

It has been executed and the bitcoins have been transferred

23

Multiple Choice

What is the purpose of cryptographic hashing in Bitcoin transactions?

1

To encrypt the transaction data

2

To generate Bitcoin addresses

3

To ensure the integrity and immutability of transaction data

4

To speed up the transaction process

24

​Constructing the Block Header

  • To construct the block header, the mining node needs to fill in six fields.

media

25

  • With all the other fields filled, the block header is now complete and the process of mining can begin.

  • The goal is now to find a value for the nonce that results in a block

    header hash that is less than the target.

  • The mining node will need to test billions or trillions of nonce values before a nonce is found that satisfies the requirement.

  • "In the simplest terms, mining is the process of hashing the block header repeatedly, changing one parameter, until the resulting hash matches a specific target."

Lecture 7 : Mining and Consensus (Part 1)

Show answer

Auto Play

Slide 1 / 25

SLIDE