0% found this document useful (0 votes)
35 views88 pages

Module 3

The document discusses blockchain technology including its evolution from barter systems and gold coins to modern cryptocurrencies like Bitcoin. It describes key aspects of blockchain like decentralization, immutability, and security through cryptography. Blockchain benefits include improved efficiency, transparency, and reduced costs. Smart contracts are discussed as self-executing digital agreements enabled by blockchain. Different types of blockchain are also summarized like public, private, and hybrid models.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views88 pages

Module 3

The document discusses blockchain technology including its evolution from barter systems and gold coins to modern cryptocurrencies like Bitcoin. It describes key aspects of blockchain like decentralization, immutability, and security through cryptography. Blockchain benefits include improved efficiency, transparency, and reduced costs. Smart contracts are discussed as self-executing digital agreements enabled by blockchain. Different types of blockchain are also summarized like public, private, and hybrid models.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

Module 3

● Implementing Blockchain as a service


● Capturing,
● Analysing and Visualizing real-time data,
● Making prediction with machine learning.

Reference Book: IoT, AI, and Blockchain for .NET Building


a Next-Generation Application from the Ground Up
(Apress)
Chapter 8,9 and 10

Understanding Blockchain
● Evolution of Cryptocurrency
○ Barter
○ Era of Gold Coins
○ FIAT Currency
○ Using Checks
○ Promises of E-Wallet
■ The biggest problem with e-wallet is that it is still tied up with an existing financial
structure.
■ financial systems can have a good degree of corruption
■ People started making mass withdrawals from banks.
■ They had two options at that time. Either to keep all their money at home, which is not a
great idea, or keep it in a bank, which they no longer trusted
■ https://www.britannica.com/video/187664/history-money

Understanding Blockchain: Blessings in Disguise:


Bitcoin

Understanding Blockchain: Blessings in Disguise: Bitcoin


● The idea of Bitcoin is peer-to-peer, without requiring a third-party trust-based
intermediary. The Bitcoin system comprises the following:
○ Resolving the double spending issue through the use of a peer-to-peer network. ○
Ensuring participants identity can be hidden and they can be anonymous.
○ No requirement of trusted parties. In fact, you don’t need to trust any one but the system. ○
New coins of cryptocurrency can be generated through hash cryptography proof of work. ●
The
Blockchain is the underlying technology behind Bitcoin. ● Bitcoin is just an
application created using Blockchain
● https://www.investopedia.com/terms/b/bitcoin.asp
● https://youtu.be/5LMS0PIzGh8


Understanding Blockchain:Centralized Systems
Understanding Blockchain:Decentralized
Systems
Understanding Blockchain:Distributed Systems
What Is Blockchain?
What Is Blockchain?
centralized systems
● central database, a person can modify and hack the records. Such hacking
has happened to many banks and customers have suffered.
● valuation of the property and ensure that it belongs to the person from whom
you are buying it? Property information can easily be tampered with, making
you pay more than it’s worth
● identifying organic vegetables from non-organic one. It would be hard to just
trust those labels, which can easily be stamped on.
● case of leasing a car for a couple of years. How do you ensure that car is
insured and within regulations for that country for driving?

Blockchain systems
● The Blockchain is transforming the way we maintain ledgers. ●
https://youtu.be/SSo_EIwHSd4

Unique features that Blockchain


● Blockchain is distributed and
decentralized in nature.
● Every computer that joins
the Blockchain network, as
shown in Figure 7-11, gets a
copy of Blockchain
immediately.
● These computer nodes are
then used to validate and
relay transactions.
Unique features that Blockchain
● The Blockchain, as shown in
Figure 7-12, is immutable in
nature.
● This means the Blockchain
transaction cannot be edited
or
deleted.
● If you want to modify or undo a
transaction, you must propose
new transactions, which go
through the same process of
approval.
● Only when the majority of nodes
approve it will it be accepted.

Unique features that Blockchain


● Blockchain is fully secure in nature as it uses hash cryptography for handling
identities.
● Every record added to the Blockchain ledger has a unique key associated with
it.
● Every record added is trusted and stamped by the party that added that
record.
● When the next record is written, everything from the first record including the
key and the content of the second record is put in the formula, generating the
key for the second record.
Blockchain is an immutable distributed ledger that can be used to record
everything of value

What Is a Block?
● A block is a unit containing a set of
confirmed transactions. If Blockchain is
a ledger, think of a block as a page or
book
● Each block, as shown in Figure 7-13, is
composed of the header, which contains
information like the previous block hash
reference, the timestamp on which block is
generated, and so on, along with the body.
● The body of the block contains a list of the
accepted transaction. The header is hashed
cryptographically to generate a new block. ●
https://youtu.be/J2EMvYQHRXc

What Is a Block?
● Every transaction is encrypted (hashed)
with a public-private key and every header
is hashed to generate a new block.
● Due to this implementation, every
transaction has a record associated with
the new block.
● The header also contains the address of the
previous block, thus the chain becomes
incorruptible.
● As more and more transactions happen, the
Blockchain transaction appends only and
creates a chronologically growing timestamp
database of transactional data, as shown in
Figure 7-14.
● It thereby creates a chain block, hence the
name Blockchain.

Benefits of Blockchain

● Improves the efficiency of the system.


● All the changes on the public Blockchain can be viewed publicly by all parties,
thereby creating transparent systems.
● Ensures transactions are immutable in nature, which means transactions cannot
be altered or deleted.
● In order to modify existing transactions, the new transaction needs to be
proposed.
● Blockchain transaction is processed 24/7 and can also help reduce transaction
time to minutes

Benefits of Blockchain

● Provides a secured way to avoid cybersecurity and fraud risk by using trust
secured algorithms.
● By eliminating third-party intermediaries and overhead cost, ●
Blockchain has great potential to reduce transaction feeds. ●
Provides alternate options of trust using centralized systems. ●
Provides ways for identification and verification.

Smart Contracts

● Smart Contracts are self-executing contracts. They are also known as digital
contracts.
● The Smart Contract can be treated as a computer program that helps in
executing contracts digitally
● Smart Contracts, computers can take an action if some requirements get
fulfilled
● Smart Contracts are a suite of various if-else statements
● Smart Contracts also bring options to revise, execute, or even propose
contracts, thereby ensuring the highest level of traceability and trust

Smart Contracts

● All insurance companies use the manual process of paperwork, complex


execution, administration costs, etc.
● It would indeed be beneficial to execute these claims using Smart Contracts to
ensure a hassle-free claiming process, less administration cost, and the
highest level of transparency.
● Take another case of payment where you pay to the contractors only when
they fulfills your requirement.
● Smart Contracts and Blockchain can be used to remove a lot of inefficiencies
that exist in the contracts management process.
○ https://youtu.be/pWGLtjG-F5c

Types of Blockchain

● The original concept for using Blockchain was primarily as a public,


transparent, disintermediate way to store cryptocurrency.
● The initial success of cryptocurrency and its usage pushed across industry
verticals to ensure and utilize Blockchain in an effective manner. ● This has
led to different flavors of the original Blockchain implementation. ○ Public
Blockchain
■ The original form of how Blockchain was coined.
■ Anyone from the public can join the network, write the data under the consensus protocol,
and read it.
■ The advantage of this Blockchain type lies in being fully decentralized, transparent, and
anonymous.
■ These types of public Blockchains are applicable across various cryptocurrencies,
including Bitcoin, Ethereum, litecoin, etc.

Types of Blockchain

● This has led to different flavors of the original Blockchain implementation.


○ Private Blockchain
■ Also known as internal Blockchain, this type of Blockchain implementation is designed for
private networks and governed by one organization.
■ This organization is responsible for setting up the rules to join the network and read data. ■
Some of the trusted nodes get the higher privilege of providing acceptance of the transaction.
■ Such types of Blockchain implementation are less expensive, faster, confidential, and only
allow authenticated parties to participate in the network.
■ Some of the examples are the Kadena chain, Iroha, and Blockchain implemented by
organization internally for their processes.
○ Hybrid Blockchain
Types of Blockchain

● This has led to different flavors of the original Blockchain implementation.


○ Hybrid Blockchain
■ Hybrid Blockchain is a combination of public and private Blockchain so it is a partly
private, permissioned Blockchain.
■ These types of Blockchain implementations are owned by a group of companies, forming a
consortium.
■ Such a Blockchain is efficiently used for working in a shared platform.
■ These Blockchains only allow specific parties or nodes to be part of the Blockchain,
participating in the transaction. Some of the examples include R3 Corda, Multichain, etc. ●
https://youtu.be/yU8d_trx9GY
● https://youtu.be/FcfPU3rYVAk


Implementing Blockchain as a Service

● Microsoft provides a suite of The setup done by these companies was called
Blockchain as a Service (BaaS).
● Ethereum is open source and is more suited for creating a private Blockchain.
● Compared to Bitcoin, Ethereum can execute transactions faster
● Ethereum Virtual Machine (EVM):
○ The Ethereum network is made up of various computers or large decentralized computers that
are together called the Ethereum Virtual Machine (EVM).
● Ethereum Nodes
○ All the nodes that implement the Ethereum protocol are called Ethereum nodes
○ These nodes have the complete installation of Blockchain.
○ As and when the new transaction gets added, it is replicated to these nodes instantly. ●
Consortium
○ Consortium refers to a group in Ethereum. This group includes all the consortium members of
Blockchain that use the same infrastructure.
○ When you are working within or across an organization utilizing Blockchain to set up their own
private Blockchain, you are setting up a consortium that has a leader called a consortium leader
Etherium
● Ability of Bitcoin to build its own currency or smart contract without requiring the need to build the
entire Blockchain
● Need for a scripting language on top of the Bitcoin system so it can be used for application
development and more broader uses.
● Since Bitcoin implementation of Blockchain is more public and based on the shared distributed ledger, it
was not possible for the Bitcoin team to implement this suggestion and they refused.

● Ethereum is a shared computing platform that enables people to build smart contracts and
cryptocurrencies without having people to build their own Blockchain.
● It has its own Turing complete programming language that allows developers to create custom
applications
○ https://youtu.be/UQDQ27YluZI
● Summary https://youtu.be/EYAwz0Jp1Og
● Consensus : https://youtu.be/ojxfbN78WFQ
Setting Up Ethereum
BaaS offering from Azure to quickly set up Ethereum in a matter of minutes.
Default templates ensure the transaction and mining nodes are part of the VPN and are
isolated from each other, apart from creating a genesis block.
A genesis block is like a blank distributed ledger or a distributed ledger with no data.
Once the genesis block is created, the transaction can be written on top of the block.
It is also an important prerequisite and for the safety aspects, that mining node should
not accessible outside the private network

Creating a Blockchain Consortium Leader from the


Azure Portal
Creating a Blockchain Consortium Leader from the
Azure Portal
Creating a Blockchain Consortium Leader from the
Azure Portal
Creating a Blockchain Consortium Leader from the Azure
Portal

Creating a Blockchain Consortium Leader from the Azure


Portal

Creating a Blockchain Consortium Leader from the


Azure Portal
Creating a Blockchain Consortium Leader from the
Azure Portal

Exploring the Newly Created Ethereum Account


Exploring the Newly Created Ethereum Account
Exploring the Newly Created Ethereum Account
Exploring the Newly Created Ethereum
Account
Developing Smart Contracts
Developing Smart Contracts

Developing Smart Contracts


Refer video
difference between bitcoin and etherium
https://youtu.be/owFY_z5fF-Y
etherium
https://youtu.be/EYAwz0Jp1Og
solidity
https://youtu.be/yXfUiXFHE3A
https://youtu.be/C7VsNfri4uk

Azure Stream Analytics


Azure Stream Analytics
Creating an Azure Stream Analytics Job
Adding an Input to an ASA Job
Testing Your Input
Testing Your Input
Testing Your Input
Adding an Output to an ASA Job
Adding an Output to an ASA Job
Visualizing ASA Results Using Power BI
Creating Dashboards in Power BI
Creating Dashboards in Power BI
Making Predictions with Machine Learning
● Natural language understanding: There can be hundreds of ways to say the
same sentence in just one language, owing to different dialects, slangs,
grammatical flow, etc.
● Email spam filtering: Spammers are consistently producing new kinds of
spam and phishing emails every day.
● In-game AI: When playing a computer game against non-human enemies
(bots), the behavior and actions of bots must adapt according to your unique
style.
● Face recognition: One just cannot explicitly train a computer to recognize all
the faces in the world.

Making Predictions with Machine Learning


ML and Data Science
To perform their tasks, ML algorithms borrow heavily from
well-established statistical techniques. Its data-driven approach and
use of statistics sometimes makes it look synonymous with data
science.

Although both fields are technically similar, they differ heavily in terms of
applications and use.

In other words, machine learning is not the same as data science.


ML and Data Science
While both the fields deal with massive amounts of data to produce models, their
focus areas are different.

On one hand where data science focuses on data analytics to arrive at actionable
insights that can help the management at an organization take effective decisions,
on the other hand machine learning focuses on creating predictive models that
can be used by other software components (rather than human beings) to produce
accurate, data-driven results

ML and Data Science


Features and Target
Features and Target

Training and Loss


Training and Loss
Problems that ML Solves: Classification
Problems that ML Solves:
Regression

Anomaly Detection
Problems that ML Solves: Clustering
Types of Machine Learning
Supervised Learning: Supervised if the sentences we supply to the algorithm are
explicitly labeled with the language it’s written in: sentences written in French and
ones not in French. Classification, regression, and anomaly detection are all forms
of supervised learning.

Unsupervised Learning training data is not labeled. Due to a lack of labels, an


algorithm cannot, of course, learn to magically tell the exact language of a
sentence, but it can differentiate one language from another. Clustering algorithms
are a form of unsupervised learning

Types of Machine Learning


Reinforcement Learning: machine is not explicitly supplied training data. It must
interact with the environment in order to achieve a goal.
Due to a lack of training data, it must learn by itself from the scratch and rely on a
trial-and-error technique to take decisions and discover its own correct paths. .
For each action the machine takes, there’s a consequence, and for each consequence it
is given a numerical reward.
So, if an action produces a desirable result, it receives “good” remarks. And if the result is
disastrous, it receives “very, very bad” remarks.
Reinforcement learning can also be applied to create AIs that can create drawings,
images, music, and even songs on their own by learning from examples.

Azure Machine Learning Studio


Azure Machine Learning Studio

You might also like