• You are here:
  • Home »

Case Study 2020 Block Chain

About Paper 3

The paper is normally written on the same day as paper 2 and has a duration of 1 hour, with a maximum mark of 30, counting for 20% of the total subject grade. Every year, it is a based on a case study or scenario that changes.

Marking Bands

The CASE STUDY 

Click Here or View in PDF Viewer below


CASE STUDY Questions

  1. 1
    Explain how blockchain technology and the use of cryptocurrencies differ from the
    current banking system.
  2. 2
    Outline the process that takes place when a customer purchases an item using
    cryptocurrency.

CASE Study Student Notes

Write Notes under the following headings

Introduction

The MONS Project

The structure of the blockchain

The use of cryptocurrency in the MONS project

The digital signature


The proof of work

The blockchain

The Merkle tree

Promoting MONS to the citizens of Santa Monica

Challenges faced


CASE Study Knowledge and understanding:

  1. 1
    Explain the technology behind blockchain
  2. 2
    What is the job of a crypto miner?
  3. 3
    What is a transaction pool and how is it related to mining?
  4. 4
    How are transactions checked for accuracy?
  5. 5
    How is a blockchain structured?
  6. 6
    What is a block?
  7. 7
    How are new blocks added to a ledger?
  8. 8
    Explain what a Merkle tree is and how is it structured?
  9. 9
    How does a P2P network model differ from a client-server model?
  10. 10
     What is a network node?
  11. 11
    Why are graphics processing units (GPUs) used in mining?
  12. 12
    What is a cryptographic algorithm?
  13. 13
    Why does the MONS architecture need to be scalable?
  14. 14
    What are the ethical issues with mining

Terminology Guide

Read more: https://www.investopedia.com/terms/1/51-attack.asp

Video: https://www.youtube.com/watch?v=UxyGt58EPa4 

Part 1 - Hashing and the Blockchain

Block Chain Definition

A blockchain is defined as a public space including all Bitcoin transactions that have been made until the current transaction or the last transaction. As finished blocks are enclosed to it as and when the transactions are complete, the blockchain is becoming bigger and bigger. These blocks are coming into the blockchain following a chronological order, in a linear way. The computers which are part of the Bitcoin network are called nodes. All of these nodes receive a copy of the blockchain, this taking place automatically when a client joins the Bitcoin network. There is a lot of information included in the blockchain, for example the addresses and their balances from the beginning until the newest completed block.


Block Chain Video Explanation

Description of process click here or click here

Lesson One - Homework

Read the Case Study and summarize the introduction section

Describe the difference between a centralized and a decentralized ledger system, highlighting positive and negatives of each approach. 

Are block chains truly immutable? What is the 51% Rule ?

Submit above in writing This Wednesday for grading

Part 2 Nonce & Proof of Work

Review Lesson 1

Intro Video Block Chain

What is a HASHING function what is the SHA256 Hash Generator

Discovering the NONCE ( number used once )

The nonce is the number that blockchain miners are working to solve. When the solution is found, the blockchain miners are offered cryptocurrency in exchange.

The goal of the Miner is to find the NONCE. Why? To get rewarded

To find the NONCE is difficult and requires substantial computing power. 

Miners must create a hash that meets a set of requirements " The Target Hash  " ( typical x number of leading zeroes / can be less than as leading zeroes would still apply ) 

The nonce is a random string of numbers which if appended to the hashed contents of the block, and then rehashed meets the target hash requirements.

If the hash meets the requirements set forth in the target, then the block is added to the blockchain. Once a valid hash is found, it is broadcast to the network, and the block is added to the blockchain


Proof of Work

Generating just any hash for a set of bitcoin transactions would be trivial for a modern computer, so in order to turn the process into "work," the bitcoin network sets a certain level of "difficulty." This setting is adjusted so that a new block is "mined" – added to the blockchain by generating a valid hash – approximately every 10 minutes. Setting difficulty is accomplished by establishing a "target" for the hash: the lower the target, the smaller the set of valid hashes, and the harder it is to generate one. In practice, this means a hash that starts with a long string of zeros: the hash for block #429818, for example, is 000000000000000004dd3426129639082239efd583b5273b1bd75e8d78ff2e8d.

In your research so far have you come across any protocols ?

Part 4 Digital Signatures

Link to Slide Show Click Here

Part 5 Random Numbers Entropy

Link to Slide Show Click Here

What is Section

What is a Hashing Function

What is a Good Hashing Function

What is SHA256 Hash Generator

what is Immutable transaction

what is a trapdoor function

What is a Merkle Tree ( also known as a binary hash tree )

Discussion Points

Why merkle trees ? 

Do they help make scaling easier , why , how? 

Quiz Time

Click Here For Keywords in Case Study

The Block Chain is the Future : Smart Contracts Examples

Smart Contracts

Insurance Companies


Two insurance companies, Atlas Insurance in Malta and Axa in France, tested smart contracts in 2017. They had prototypes that compensated airline customers if their flights were delayed.

Let’s see an example:

John is about to fly from NYC to Los Angeles. He sends $5 worth of cryptocurrency to the Axa Insurance smart contract and provides his flight number. Axa sends $95 to the smart contract. So, there is $100 in the smart contract.

If John’s flight is on time, Axa is sent $100 from the smart contract. But if the plane is late, $100 is sent to John from the smart contract. Everything is automatic.

This saves lots of time and money. It also means that John does not have to trust that AXA will pay him the agreed amount if his flight is late — he knows that if it is late, the smart contract will instantly send him his compensation ($100).


Business Management


Businesses can benefit massively from smart contracts. Instead of paying staff to run payrolls, they can use smart contracts.

Businesses can just set up a smart contract that says WHEN the date is 28.03.18, the Business sends John 2 ETH. This means John will always be paid on time, and he will never be underpaid. The business benefits because it is all automated, saving them lots of time and money!

Applications like FollowMyVote use smart contracts and blockchain technology to protect votes from fraud. When the voting transaction is written to the blockchain, it cannot be changed. When the voting is over, the smart contract will send a token to an address that represents the winner of the vote.

This way, voting is always fair, meaning the winner is always correct.


Governments


For governments, smart contracts running on the blockchain can make voting systems completely trustless and much more secure.
Businesses can benefit massively from smart contracts. Instead of paying staff to run payrolls, they can use smart contracts.

Businesses can just set up a smart contract that says WHEN the date is 28.03.18, the Business sends John 2 ETH. This means John will always be paid on time, and he will never be underpaid. The business benefits because it is all automated, saving them lots of time and money!

Challenges

Some challenges of using a cryptocurrency are:
• how to create a transaction
• how to check that the transaction is accurate
• how to record a transaction in such a way that it cannot later be changed.

Double Spend & Block Chain Temporary Forks

What is a Block chain Fork ?

What happens if two miners find a block at almost the same point in time? PoW blockchains resolve such conflicts called blockchain fork and how attacks might utilize this resolution mechanism to perform double spending attacks.

A fork occurs when two miners arrive at a new block at roughly the same time. Both blocks solve the partial hash inversion problem, but only one of them can be part of the long-term blockchain. The discarded block is called an orphan block. The decision of which branch of the blockchain is the valid one is not taken by any party. Rather the dispute resolves itself organically.

The protocol determines that the correct blockchain is the longest one.

Transactions included in the blocks of a fork are not lost. When a fork is resolved and a branch of the blockchain is discarded, the transactions in that branch are introduced again into the unconfirmed transactions’ memory pool, ready to be included in the next block mined. Some of these transactions might already appear in a block of the legitimate branch of the fork. In this case, these transactions are discarded and excluded from the unconfirmed transactions’ memory pool. Every fork resolution produces winners (the miners that solved blocks in the accepted branch) and losers (miners whose solved orphaned blocks). The protocol avoids having a central party or group deciding about the correct branch, in line with the decentralization philosophy of Bitcoin.


You might be surprised to know that even before Bitcoin, there were attempts to create a sustainable digital monetary system. But all those attempts failed because an obvious problem with digital money is that transactions can be copied and spent twice

Double Spend 

Double spending means spending the same money twice.

You go to Starbucks and order a cappuccino worth $10. You pay in cash. Now that $10 in cash is in the cash vault of Starbucks. By all means, you simply cannot spend the same $10 somewhere else to make another purchase.

But Bitcoin is digital money, not physical cash. Hence, Bitcoin transactions have a possibility of being copied and rebroadcasted. This opens up the possibility that the same BTC could be spent twice by its owner.

How Bitcoin Handles The Double Spending Problem

The Bitcoin blockchain has implemented a protocol to counter double-spend attacks inspired by the traditional cash system. It’s a confirmation mechanism that maintains a “chronologically-ordered” blockchain starting with the first registered operation back in 2009.

Let’s say a holder plans to use one Bitcoin to make multiple purchases to other merchants. All transactions go into a pool where they have to wait for confirmation. The first transaction is validated and published on the blockchain. With every new block added to the ledger, the operation gets more confirmations.

The second transaction using the same input won’t be validated because miners can identify the double-spend attack based on the previous records.

So what happens if two of these transactions are pulled from the pool simultaneously? Miners will only validate the one with the higher number of confirmations, and this one will be the only transaction recorded on the blockchain.

Merchants accepting payment in Bitcoin should wait for the confirmation before releasing the goods or services to avoid scams. This way, sellers have the guarantee that the transaction is irreversible.

If you made a digital copy of your Bitcoin and tried to use it, you wouldn’t be able to spend the funds saved in your wallet in the future. Miners use complex mathematics and huge amounts of power to analyse previous records and avoid double-spending. With the copy already registered as spent on the blockchain, it’s impossible to use the digital coin a second time.

The downside? It slows down the buying process since merchants have to wait (sometimes for almost an hour) to get the confirmation they need.

How Double-Spend Attacks Can Happen

51% attack

If somehow an attacker captures 51% of the hash power of the network, double spending can happen.

“Hash power” means the computational power which verifies transactions and blocks. If an attacker has this control, he/she can reverse any transaction and make a private blockchain which everyone will consider as real.

But so far, no such attack has happened because controlling 51% of the network is highly cost intensive. It depends on the present difficulty of mining, the hardware price, and the electricity cost, all of which is infeasible to acquire.

Although people in the crypto community are very concerned about 51% attacks, these attacks are actually very difficult to execute in practice. The Bitcoin network consumes as much electricity as small countries do. In order for a miner to have a chance at successfully attacking the network, they would need to purchase a huge amount of specialized mining equipment and consume around half the electricity that it takes to power a small country. This is very discouraging to potential attackers and makes it very difficult for them to profit in a double-spend attack.

Race attack

When an attacker sends the same coin in rapid succession to two different addresses, the obvious outcome is that only one of them will get included.

Now, if you as a merchant don’t wait for confirmations of payment, then in a case like this, there’s a 50% chance you got the double spent coin (and you won’t receive that money).

Your customer can trick you if he/she sends the same coins again to his/her address.

Once the customer does both transactions, both transactions go to an unconfirmed pool of transactions. Whichever transaction gets verified first and gets 6 confirmations will be accepted, and the other will be discarded.

Home Class Work

Consider MONS and the introduction of a digital currency specific to residents of MON's. Will they be more liable to an attack by a bad actor? Will they be more susceptible to double spend compared to BITCOIN. Present your findings at the beginning of next class this Thursday

Scaling

Proof-of-work has proven to be an elegant system with a very small attack surface. However, there is 1 main drawback; it is pretty slow. In proof-of-work, security comes at the expense of speed. This has put strong limitations on what smart contract blockchains like Ethereum can achieve. In an attempt to achieve faster transaction speed while maintaining a high degree of security, Ethereum plans to switch to a consensus model called proof-of-stake. While proof-of-stake will not directly lead to faster transaction speeds, it is expected to enable sharding.


Video inside bitcoin mining 

Architecture 

Blocks

Blocks are data structures whose purpose is to bundle sets of transactions and be distributed to all nodes in the network. Blocks are created by miners. 

Blocks contain a block header, which is the metadata that helps verify the validity of a block.

These 6 fields constitute the block header. The rest of a block contains transactions that the miner has chosen to include in the block that they created.

Users create transactions and submit them to the network, where they sit in a pool waiting to be included in a block.

Slide Shows & Lessons

Structure of Block chains including Merkle Tree

Double Spend

Blockchain - DCA's  / Problems of Scaling

Digital Signature

Random Number Gen Keys and Entropy

Case Study Concerns  & Discussion Points

Digital Signature and Public Private Key


Class Work Home Work ( Compile into Slideshow presentation)


Create an ongoing  slideshow / Presentation  for the Case Study

Working in pairs or individually  create a presentation describing the role and purpose of using a NONCE and requiring Poof of Work (that is not insubstantial )  in adding a block to an existing block chain. ( make reference to the origins of each term). What happens if proof of work is trivial ? have cyrpto currenciens using block chains  been compromised before ? how and why , Can this be avoided in the MONS project? How ? 

1 Describe the Structure ( header and body ) of a typical Cryptocurrency
blockchain.

2 discuss the issue of double spend and how it can be prevented.

3 Describe role of the Merkle Tree in blockchian technology.

4 Create a section key words and update these with your understandings / definitions of the keywords we have covered so far. ( see section in case study), but do not limit yourself to just these if you come across other relevant keywords please add