Posted on Leave a comment

Lecture #1 in Blockchain

Video

Some terminology is in order.

Peer-to-peer versus Client-Server:

Just a human observation before we begin. When I say you are my peer, I mean to say that you are my equal. A peer-to-peer transmission simply means communication between two equals. When there are more than two peers we have a “Network”. The opposite of a peer-to-peer relationship is a client-server relationship. Ironically the word “server” is not intuitive. Server means that you are in control of the reins. The President of a country is the server of the people. The central bank serves our monetary needs . The motto of Prince Charles, for instance, is Ich dein – I serve. People who imagine that they can tell the server what to do are deluded. They are actually “clients”. On the other hand a Peer to Peer system is truly democratic because it is decentralized.

Continuing the computer analogy, Peer-to-peer (P2Pcomputing or networking is a distributed application architecture (meaning that it is not centralized) that partitions tasks or workloads between peersPeers are equally privileged, equiponent participants in the application. They are said to form a peer-to-peer network of nodes.


The opposite of P2P is Client-Server. If two computers are on a centralized network in which there is a server, for example, this is not a peer to peer relationship inasmuch as the server plays a more important role than any individual PC. Our current monetary system is a client server system in which a central server (or authority) controls everything that happens. Now, let’s begin.

0:00 [MUSIC] Welcome to the first course of the blockchain specialization titled blockchain basics.Let’s start by asking ourselves, what is a blockchain? Why should you care about it? Unlike traditional methods, blockchain enables peer to peer transfer of digital assets without any intermediaries. It was a technology originally created to support the famous cryptocurrency,BitCoin. The blockchain by itself has taken a life of its own and permeated a broad range of applications across many industries, including finance, healthcare, government, manufacturing, and distribution. The blockchain is poised to innovate and transform a wide range of applications, including goods transfer, for example, supply chain. Digital media transfer, for example, sale of art. Remote services delivery, example, travel and tourism. Platform for decentralized business logic, for example, moving computing to data sources. And distributed intelligence, example, education credentialing. Additional applications of blockchain include distributed resources, for example, power generation and distribution. Crowd funding for example, startup fund raising. Crowd operations, for example, electronic voting. Identity management, for example, one ID for all your life’s functions. And government public records and open governing. Moreover, blockchain can enable an inclusive economy. It can enable a person in a remote corner of the world to partake in a democratic process. Opportunities for innovative applications are endless. There is a dire need for critical thinkers, designers and developers who can envision and create newer application models on blockchain to benefit the world. This course is a first step in addressing this need. At the end of this course, you will be able to explain the three fundamental characteristic that define the blockchain using Bitcoin blockchain.

2:10 Bitcoin is not the only player in town. By the end of the first module, we move beyond Bitcoin into introducing the next generation blockchains with Ethereum. You will also be able to discuss the important features of Ethereum blockchain that is used as a reference implementation in many newer blockchains. And explain the algorithms and techniques that enable the blockchain, including a public gate cryptography and hashing. Finally, you will be able to outline methods for realizing trust in a blockchain. [MUSIC] Let’s begin with an introduction of Bitcoin. Two major contributions of cryptocurrency Bitcoin are a continuously working digital currency system, and a model for autonomous decentralized application technology called the blockchain.

3:04 Though our focus is on a general blockchain, we’ve to understand the working of the technology behind Bitcoin to fully appreciate the innovation of blockchain. We can all agree that the advent of the internet in the world wide web has transformed every aspect of our lives, from stock markets to street corner food trucks. It has enabled a technology explosion with Web 2.0 and the world of e-commerce applications. Around 2008, 2009, when the institutions and markets we trusted went crumbling down, and everybody was running away from the Wall Street, a mysterious person, or persons, called Satoshi Nakamoto, introduced a new digital currency, a cryptocurrency called Bitcoin.

3:53 Bitcoin enabled an innovative platform for peer to peer transfer of value without any central authority.4:02With no central authority, how did Bitcoin realize trust and security?

4:07 By implementing software programs for validation, verification, consensus in a novel infrastructure called the blockchain. Later on in about 2012, 2013, computation elements were added to the blockchain infrastructure that has opened up a whole world of possibilities beyond simple currency transfer. These innovations are significantly shaping the direction of Web 3.0 as you will learn in the next four courses. What is a blockchain? Blockchain is about enabling peer to peer transaction in a decentralized network.

4:45 Establishing trust among unknown peers. Recording the transaction in an immutable distributed ledger.

4:54 Let’s understand centralized versus decentralized network using a common scenario. Consider a scenario where customer wants to buy an item using her credit card.

5:05 Let’s enumerate the intermediaries involved in accomplishing this task. We have a credit card agency, we have a customer bank, we have a credit cards bank, we have an exchange, we have the merchant’s bank, and finally, the merchant. This is an example of a centralized system that we are so used to. Now compare this with a system where peers can transact directly with each other irrespective of where they are located. Functions of the intermediaries are shifted to the periphery to the peer participant in the blockchain infrastructure. Peers are not necessarily known to each other. This is a decentralized system. How do we establish trust among the peers in such a decentralized system? By having a process in place to validate, verify, and confirm transactions. Record the transaction in a distributed ledger of blocks, create a tamper-proof record of blocks, chain of blocks, and implement a consensus protocol for agreement on the block to be added to the chain. So, validation, verification, consensus, andimmutable recording lead to the trust and security of the blockchain.

6:27 Now I’ll explain these concepts using another scenario.

6:31 I’m lending Amy $10,000. This is one single peer to peer transaction. We both make a note of it on a ledger.

6:41 What if I change my entry from 10,000 to 11,000? Alternatively, Amy changes hers from 10,000 to 1,000. To prevent this trust violation, we need to seek the help of people around us, Lisa, Allison, and Francis. Provide all of them a valid copy of this ledger.

7:04 This is the basic concept of an immutable distributed ledger defined in a blockchain process.

7:12 In this scenario, we were all physically present in one location, Amherst. Now imagine this to be an online transaction to an unknown peer. Also, scale up the one transaction to 10,000 transactions, how about a million transactions.

7:32 I should be able to transact with equal ease to any unknown peer in Amherst, Albany, or Albania, maybe to send some flowers to a friend in Albania. This is the tenet of a decentralized system supported by blockchain.

7:50 In the case just described, how do we trust our unknown peers? Through verification and validation. In our example, Amy requests Kevin to verify the amount I transacted with her.

8:03 Kevin checks it, oops, Kevin finds the amount of the transaction is not 10,000, but 300, not valid. Kevin rejects and nullifies the transaction. Similar to these, validation, then verification methods devised by the blockchain and implemented by the peers provide the collector trust needed in a decentralized system. Summarizing, blockchain technology supports methods fora decentralized peer-to-peer system, a collective trust model, and a distributed immutable ledger of records of transactions.

Week 1, Lesson 1 Resources: Bitcoin & Blockchain

The following resources were selected to provide an overview of the topic of Bitcoin & Blockchain. We would like to acknowledge the authors of the various web articles, videos, and papers for their insightful discussions and analytics which help formed the basis for some sections of the lessons and modules.

Title of resource: Bitcoin Whitepaper

Resource type: Website

Description: This is paper released by Satoshi Nakamoto prior to release of the now famous cryptocurrency Bitcoin.

Title of resource: Bitcoin’s Academic Pedigree

Resource type: Paper

Description: How Bitcoin, a radically different proposal for a decentralized cryptocurrency showed that digital cash could be viable.

Title of resource: What is Blockchain Technology? A Step-by-Step Guide For Beginners

Resource type: Website

Description: A step by step guide that goes into the details of what Blockchain technology is.

Title of resource: Blockchain: The Invisible Technology That’s Changing the World

Resource type: Website

Description: Article that expands on a new immutable digital fabric remaking the internet without people even realizing it. It also shows how Blockchain-based networks, decentralized apps (DApps), and distributed ledgers are becoming the foundation of digital life.

Video#2

0:00Here is the basic structure of a blockchain. Transaction is the basic element of the Bitcoin Blockchain. Transactions are validated and broadcast. Many transactions form a block. Many box form a chain through a digital data link. Blocks go through a consensus process, to select the next block that will be added to the chain. Chosen block is verified, and added to the current chain. Validation and consensus process are carried out by special peer nodes called miners. These are powerful computers executing software defined by the blockchain protocol.Let’s now discuss the details of a single transaction in bitcoin. A fundamental concept of a bitcoin network is an Unspent Transaction Output, also known as UTXO. The set of all UTXOs in a bitcoin network collectively defined the state of the Bitcoin Blockchain. UTXO’s are referenced as inputs in a transaction. UTXO’s those are also outputs generated by a transaction. All of that UTXO’s is in a system, are stored by the participant nodes in a database. Now let’s review the role of the UTXO’s in a Bitcoin Blockchain. The transaction uses the amount specified by one or more UTXOs and transmits it to one or more newly created output UTXOs, according to the request initiated by the sender. The structure of a given UTXO is very simple. It includes a unique identifier of the transaction that created this UTXO, an index or the position of the UTXO in the transaction output list, a value or the amount it is good for. And an optional script, the condition under which the output can be spent. The transaction itself includes a reference number of the current transaction, references to one no more input UTXOs, references to one or more output UTXOs newly generated by the current transaction, and the total input amount and output amount. Participants can validate the transaction contents. Does the UTXO’s reference input exist in the network state? This is the only one of the many validation criteria.Recall our demonstrated scenario. This is similar to Amy asking Kevin to verify the money in the envelope to be $10,000. Are these UTXOs valid? All right. It is time to explore the real transaction. It is available at this link. At the top left is the transaction number. Just below, there are three input UTXOs referenced. And an arrow points to the references of the two output UTXOs. Note that there are three input UTXOs and only two output UTXOs. This means that the total amount in three input UTXOs are spent to generate two new output UTXOs. Just below the output UTXOs is a total amount transferred in the Bitcoin value. And that is shown in green. Let’s now move on to learn about a block. As you can see, a block is composed of a header of information about the block, and a set of valid transaction. At first, we’ll examined the genesis block. It’s available at this link. We introduce this block number zero for posterity’s sake. This is where it all began. Satoshi Nakamoto initiated the Bitcoin Blockchain with one transaction of 50 Bitcoins or 50 BTC. This one transaction created a UTXO output for half in his address. The data the Blockchain creation is January third, 2009. There was no previous block. This field is all zeros. It also list a block reward or minus fees of 50 BTC. We’ll discuss minus reward in our later lessons. Let’s now look at the more recent block 482808. On the right panel, note the current block hash. The previous block hash that there’s a link to the previous block. And on the left panel down here, the Nonce. You will learn about the block hash computation in the module quiz and in the later lessons. Now, let’s look at the structure of the Blockchain by peeking into the Bitcoin Blockchain. Our goal is to understand the link between the blocks. Let’s consider the chain of three blocks: 488867, 488868. 488869. 488868 shown in the middle, has the hash of 488867 as its previous hash. Block 488869 has the hash of 488868 as its previous hash, forming the links in the chain. To summarize, transaction bring about transfer of value in the Bitcoin Blockchain. The concept of UTXO defines the inputs and outputs of such a transaction. Once a block is verified an algorithmic-ally agreed upon by the miners, it is added to the chain of blocks, namely the Blockchain.

Week 1, Lesson 2 Resources: Blockchain Structure

The following resources were selected to provide an overview of the topic of Blockchain Structure. We would like to acknowledge the authors of the various web articles, videos, and papers for their insightful discussions and analytics which help formed the basis for some sections of the lessons and modules.

Title of resource: Unspent Transaction Output, UTXO

Resource type: Website

Description: An online glossary for technical terms regarding Bitcoins. This link Provides the definition and synonyms for an “Unspent Transaction Output”.

Title of resource: Unspent Transaction Output, UTXO

Resource type: Website

Description: An explanation on how UTXO’s operate vs other methods.

Title of resource: How the NSA identified Satoshi Nakamoto

Resource type: Website

Description: An article written by Alexander Muse on Medium that explains how the NSA identified the creator of Bitcoin, Satoshi Nakamoto.

Video 3

0:05Now that we have reviewed the basics of a blockchain and its basic structure and origin, let’s consider the basic operations in a blockchain. Operations in the decentralized network are the responsibility of the peer participants and their respective computational nodes. For example, laptop, desktop, and server racks. These operations include validation transactions, gathering the transactions for a block, broadcasting the ballot transactions in the block, and consensus on the next block creation, and chaining the blocks to form an immutable record. In this lesson, we explore some of the fundamental operations of the bitcoin blockchain. First, we have to discuss the participants. There are two major roles for the participants. Participants that initiate transfer of value by creating a transaction, additional participants called miners, who pick on added work or computation to verify transactions, broadcast transaction, compete to claim the right to create a block, work on reaching consensus by validating the block, broadcasting the newly created block, and confirming transactions. You might wonder why participant would take on additional work. Well, the miners are incentivised with bitcoins for the efforts in managing the blockchain, as we’ll find out. Transaction validation is carried out independently by all miners. The process involves validation of more than 20 criteria, including size, syntax, et cetera. Some of these criteria are: Referenced Input Unspent Transaction Output, UTXOs are valid, recall, UTXO is well-defined earlier in lesson two, reference output UTXOs are correct, reference input amount and output amount matched sufficiently, invalid transactions are rejected and will not be broadcast. All the valid transactions are added to a pool of transactions. Miners select a set of transaction from this pool to create a block. This creates a challenge. If every miner adds the block to the chain, there will be many branches to the chain, resulting in inconsistent state. Recall, the blockchain is a single consistent linked chain of flux. We need a system to overcome this challenge, the solution. Miners compete to solving a puzzle to determine who earn the right to create the next block. In the case of bitcoin blockchain, this parcel is a computation of parcel and the central processing unit or CPU intensive. Once a miner solves the puzzle, the announcement is broadcast to the network and the block is also broadcast to the network. Then, other participant verify the new block.Participants reach a consensus to add a new block to the chain. This new block is added to their local copy of the blockchain. Thus, a new set of transactions are recorded and confirmed.The algorithm for consensus is called proof-of -work protocol, since it involves work a computational power to solve the puzzle and to claim the right to form the next block.Transaction zero, index zero of the confirmed block is created by the miner of the block. It has a special UTXO and does not have any input UTXO. It is called the coinbase transaction that generates a minor’s fees for the block creation. Currently, the minor’s fees is 12.5 BTC for a bitcoin. This is how new coin is maintained in bitcoin. To summarize, the main operations in a blockchain are transaction validation and block creation with the consensus of the participants. There are many underlying implicit operations as well in the bitcoin blockchain.

Week 1, Lesson 3 Resources: Basic Operations

The following resources were selected to provide an overview of the topic of Basic Operations. We would like to acknowledge the authors of the various web articles, videos, and papers for their insightful discussions and analytics which help formed the basis for some sections of the lessons and modules.

Title of resource: How a Bitcoin Transaction Works

Resource type: Website

Description: This article explains what a bitcoin transaction is, its purpose and outcome. The explanation in this article is suitable for both novice and intermediate bitcoin users.

Title of resource: How does the Blockchain Work? (Part 1)

Resource type: Website

Description: An article written by Collin Thompson on Medium that gives a simple and easy explanation on how blockchain works.

Title of resource: How Does the Blockchain Work?

Resource type: Website

Description: An article written by Michele D’Aliessi on Medium that explains blockchain technology in simple words.

video 4

0:04Let’s now look beyond Bitcoin. Bitcoin blockchain is open-source and the entire code is available on the GitHub. During the initial years beginning roughly in 2009, this open-source code was extended to release different cryptocurrencies. About 300 plus cryptocurrencies were introduced. Bitcoin supports an optional and special feature called scripts for conditional transfer of values. Ethereum Blockchain extended the scripting feature into a full-blown code execution framework called smart contract. A smart contract provide the very powerful capability of code execution for embedding business logic on the blockchain. Based on such capabilities, three major types of blockchains emerge from Bitcoin foundation. Type one deals with the coins in cryptocurrency currency chain. Example, Bitcoin. Type two supports cryptocurrency and a business logic layer supported by code execution. Example, ethereum. Type three involves no currency but supports software execution for business logic. Example, The Linux Foundation’s Hyperledger. With the addition of code execution, comes the serious consideration about public access to the blockchain hence, the classification of public, private, and permissioned blockchains based on access limits. We have been watching Bitcoin blockchain continuously operational since its inception. All supported by its public participants. Thus Bitcoin is a fantastic example of a public blockchain class. Anybody can join and leave as they wish. Transaction blocks and the blockchain are publicly observable even though participants are anonymous. It is open-source. You can also create new coin digital currency by modifying the Bitcoin code. Wallet applications provide the basic interface to transfer value through the Bitcoin blockchain. In a private blockchain, access to the blockchain is limited to selected participants for example, those participants within an organization. This restriction helps in simplifying the normal operations such as block creation and contingence model. The third classification of blockchain is permissioned blockchain, also called consortium blockchain. It is meant for a consortium of collaborating parties to transact on a blockchain for ease of governance, provenance, and accountability for example, a consortium of all automobile companies or healthcare organizations. Permissioned blockchain has the benefits of a public blockchain with allowing only users with permission to collaborate and transact. In summary, significant innovations such as smart contracts have opened up broader applications for blockchain technology. Private and permissioned blockchain allow forcontrolled access to the blockchain enabling many diverse business models.

Week 1 – Defining a Blockchain

Quiz Resources

The following resources are provided to assist you in answering the quiz questions. We would like to acknowledge the authors of the various websites for their platform and transactions which help formed the basis for some sections of the lessons and modules.

Title of Resource: 1. Blockchain

Resource Type: Website

Description: Blockchain is the world’s leading software platform for digital assets. Offering the largest production blockchain platform in the world and using new technology to build a radically better financial system.You can use this website to explore and answer questions related to Bitcoin Blockchain.

Title of Resource: 2. Bitcoin Block Explorer

Resource Type: Website

Description: Block Explorer is an open source web tool that allows you to view information about blocks, addresses, and transactions on the Bitcoin blockchain. You can use this website to explore and answer questions related to Bitcoin Blockchain.

Title of Resource: 3. Etherscan

Resource Type: Website

Description: EtherScan is a Block Explorer, Search, API and Analytics Platform for Ethereum, a decentralized smart contracts platform. You can use this website to explore and answer questions related to Ethereum Blockchain.

Note: Use Blockchain or Bitcoin Block Explorer to explore Bitcoin Blockchain. Use Etherscan to explore Ethereum Blockchain.

Quiz Directions

Task 1: Understanding the Genesis Block (Q2-Q3)

In this task, you will explore the Genesis blocks (i.e. Block 0), for 2 different implementations of Blockchain, i.e. Bitcoin Blockchain (resource 1 or resource 2) and Ethereum Blockchain (resource 3). You need to check the previous block hash, transactions, and the reward.

Task 2: Exploring a block in the Bitcoin Blockchain (Q4-Q5)

In this task, you will inspect and explore block #490624 on either resource 1 or resource 2 provided above. Locate the hash of this block, the hash of the previous block and the number of transactions in that block. You may explore other things contained in the block as well. After this, you will go to the previous block (by block number) and verify the hash of this block is the same as mentioned in the block you were exploring before.

QUIZ

Blockchain Defined – Week 1

9 questions To Pass 78% or higher Attempts 3 every 8 hours Deadline 6 days hence, 11:59 PM PDT


Question 11
point

1. Question 1

What is the genesis block?

The last block created in the Blockchain

The first block of a Blockchain

Any block created by the founder

The first transaction in each blockQuestion 21
point

2. Question 2

Inspect and explore block #0 using this link to solve the below question.

How many transactions are there in the Genesis block in Bitcoin?

0

1

8893

10Question 31
point

3. Question 3

Inspect and explore block #0 using this link to solve the below question.

How many transactions are there in the Genesis block in Ethereum (other than the transaction for Miner fee)?

50

0

8893

11
point

4. Question 4

Inspect and explore block #490624 using this link to solve the below question.

What is the hash of the previous block for Bitcoin block #490624? Copy and paste the answer into the box below.Question 51
point

5. Question 5

Inspect and explore block #490624 using this link to solve the below question.

Which of these fields is present in a Bitcoin block summary?

Gas Used

Private Key of the Sender

Difficulty

Gas LimitQuestion 61
point

6. Question 6

Where are the transactions recorded in a blockchain?

On a centralized immutable ledger

On a SQL Database

On a distributed immutable ledger

On a SQLite DatabaseQuestion 71
point

7. Question 7

What are UTXOs in a Bitcoin Blockchain?

These are rewards for miners

These form the inputs and outputs for transactions

These are actual currency that is sent to the receiver of a transaction

These are transaction output that has been expendedQuestion 81
point

8. Question 8

Blockchain was created to support security and trust in a ___________ environment of the cryptocurrency Bitcoin.

decentralized trustless

centralized trusted

centralized trustless

decentralized trustedQuestion 91
point

9. Question 9

What/Who are miners in a blockchain?

A person who just initiates a transaction in the blockchain

An algorithm that you can use to calculate the next block in a blockchain

A person who receives money as the receiver of the transaction

Computers that validate and process blockchain transactions and solve the cryptographic puzzle to add new blocksI understand that submitting work that isn’t my own may result in permanent failure of this course or deactivation of my Coursera account. Learn more about Coursera’s Honor Code

Upon completing this 6 day course you may consider certification HERE

Leave a Reply

Your email address will not be published. Required fields are marked *