SlideShare a Scribd company logo
1 of 72
𝑏=1
𝑛
𝑓(𝑏) =
3
𝑑𝑒𝑠𝑖3 𝑟2 𝑒 3D
BlockChain
ARAF KARSH HAMID
Co-Founder / CTO
MetaMagic Global Inc., NJ, USA
@arafkarsh
arafkarsh World Summit 2.0
February 1st, 2019,
Vivanta By Taj, Bengaluru, India
https://www.clavent.com/event-list/blockchain2-0-bangalore-2018/
Agenda
01-02-2019 2
1. Why do we need Blockchain?
o Problem Statement
o How Blockchain solves this problem
o Business Requirement
o Distributed Ledger
o HyperLedger Fabric
1 4. Fabric Getting Started
o Fabric Internals
o Blockchain Network
o Transaction Flow
o Private Data Usage
o Setting up Fabric Network
o Fabric Example (Node.JS)
3
6. Conclusion
o Ethereum Vs. Fabric Vs. Corda
o Blockchain Benefits
o Industry Scenarios – Media
o References
4U HyperLedger Fabric Architecture
o Fabric Key Components
o Microservices Architecture
o 3 Components of Fabric
o Fabric Models (Assets, Chaincode..)
o Fabric Channels
o Gossip Protocol
2
Problem Statement
01-02-2019 3
1
Customer A
Records
Insurer
Records
Bank
Records
Regulators
Records
Auditors
Records
Merchant A
Records
Expensive, Vulnerable & Inefficient
Source:BuildingBlockchainAppsforNode.JSdevelopers
withHyperLedgerComposer–SimonStoneIBM
How Blockchain Solves this Problem…
01-02-2019 4
1
Customer A
Records
Insurer
Records
Bank
Records
Regulators
Records
Auditors
Records
Merchant A
Records
Blockchain Ledger
A shared, replicated, permissioned ledger
 Consensus
 Immutability
 Provenance
 Finality
Source: Building Blockchain Apps for Node.JS developers with HyperLedger Composer – Simon Stone IBM
Business Requirements
01-02-2019 5
Shared Ledger
Append only
immutable
database
shared across
the business
network.
Business logic
is embedded
within the
database and
executed to
validate and
store the
transactions.
Smart Contract
Transactions are
secure,
authenticated
and access
controls are
enabled for
granular access.Privacy Trust
All the
transactions
are verified
and endorsed
by the trusted
relevant
parties
1
Properties of a Distributed Ledger
01-02-2019 6
o Decentralized, replicated across many
participants, each of whom collaborate in
its maintenance.
o Information recorded is append-only.
Immutable.
o Immutability makes it simple to
determine the provenance of the
information.
o These properties makes it called as
“Systems of Proof”
1 - - - - - - - - - - - n
1
How it differs from Bitcoin
01-02-2019 7
1
HyperLedger Fabric Bitcoin
Provides Identity Anonymity
Selective Endorsement Proof of Work
Assets Cryptocurrency
Bitcoin is a specific implementation of Blockchain technology
HyperLedger Fabric Key Features
01-02-2019 8
1
Source: http://hyperledger-fabric.readthedocs.io/en/latest/functionalities.html
o It is private and permission based
o Members of HyperLedger Fabric enrolls
thru MSP - Membership Service
Provider
o Different MSPs are supported
o Ledger data can be stored in multiple
formats.
o Consensus mechanisms can be
switched in and out
o Ability to create channels - Allowing a
group of participants to create a
separate ledger of transactions.
o Provides Membership Identity
Service that manages User IDs
and authenticates all participants
on the network.
o Access control lists can be used
to Provide additional layers of
permission.
o A Specific user ID could be
permitted to invoke a Chaincode
application but blocked from
deploying a Chaincode.
Identity Management
HyperLedger Fabric Key Features
01-02-2019 9
1
Source: http://hyperledger-fabric.readthedocs.io/en/latest/functionalities.html
o Transaction execution is
separated from
transaction ordering and
commitment.
o Division of labor un
burdens ordering nodes
from the demands of
transaction execution and
ledger maintenance,
o while peer nodes are
freed from ordering
(consensus) workloads.
Efficient Processing
o Chaincode Applications
encode logic that is
invoked by specific
types of transactions on
the channel.
o System Chaincode is
distinguish as
Chaincode that defines
operating params for
the entire channel.
Chaincode Functionality
o Private channels are
restricted messaging paths
that can be used to provide
transaction privacy and
confidentiality for specific
subset of network members.
o All data including transaction,
member and channel
information, on a channel are
invisible and inaccessible to
any network members not
explicitly access to that
channel.
Privacy & Confidentiality
Summary – Why do we need Blockchain?
01-02-2019 10
1
Reconciliation Issues in a
Multi Party environment.
o Expensive
o Vulnerable
o Inefficient
Problem Statement
o Consensus among the Parties
before a transaction is committed.
o Provenance – Origin of the asset
can be easily Tracked.
o Immutable – Transactions are
tamper proof
o Finality – Single Source of Truth
Solution
Fabric Architecture
01-02-2019 11
HyperLedger Fabric Architecture
12
2
Orderer
• Consensus
verification
• Creates Blocks
CA
• Registration
of identities
• Manage
Certificates
Peer
• Endorses Tx
• Simulates Tx
• Commits Tx
All these components can be clustered for scalability and to avoid Single Point of Failure
3 Components of Fabric
Ledger
Blockchain & World State
Smart Contract
• createCar
• queryAllCars
• queryCarProperties
• changeCarColor
• changeCarOwner
Other Concepts
• Assets : Anything that’s
valuable for the Organization
• Transactions (State changes
of Assets)
• Endorsement Policies
• Gossip Protocol : The glue
that keeps the peers in
healthy state.
Channels
• Private subnet for
a set of parties
based on Smart
contract
• Ledger / Channel
• Peers can have
multiple Channels
• Private Data
1
2
01-02-2019
01-02-2019 13
Fabric
Deployment
Model in every
Enterprise Customer A Merchant B Bank Insurer
RESTful Services
Two Roles = Endorser & Committer
Smart Contracts (Chaincode) – Programmable Ledger
Persistence Layer - Ledger
GetPut
Blockchain
Events
Block
Peer
2
Gossip Protocol for P2P Communication
Orderer
• Consensus
Verification
• Creates Blocks
CA
• Registration
of identities.
• Certificate
Management
Blockchain & World State
Multiple Channels
Blockchain & World State
01-02-2019 1414
Monolithic / Micro Services Architecture
Traditional Monolithic App using
Single Technology Stack
Micro Services with Multiple Technology Stack
Event Stream
API Gateway (Zuul Edge Server)
Load Balancer (Ribbon)
Circuit Breaker (Hysterix)
Service Discovery (Eureka)
Load Balancer (Ribbon)
Circuit Breaker (Hysterix)
Load Balancer (Ribbon)
Circuit Breaker (Hysterix)
UI Layer
Web Services
Business Logic
Database Layer
Database
UI Layer
Web Services
Business Logic
Database Layer
Micro
Service
1
EE 7
Container
UI Layer
Web Services
Business Logic
Database Layer
Micro
Service
2
Container
SE 8
UI Layer
Web Services
Business Logic
Database Layer
Micro
Service
4
Container
UI Layer
Web Services
Business Logic
Database Layer
Micro
Service
3
Container
2
HyperLedger Fabric – Ledger
01-02-2019 15
2
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/fabric_model.html
There is one ledger
per channel.
Couch DB
As well as a state database to
maintain current fabric state.
This is auto derived by the Peers.
Each transaction results in a set of asset key-
value pairs that are committed to the ledger
as creates, updates, or deletes.
o The ledger is the
sequenced, tamper-
resistant record of all state
transitions in the fabric.
o State transitions are a result
of Chaincode invocations
(‘transactions’) submitted
by participating parties.
Blockchain
Tx Tx Tx Tx
Blocks
Tx
Ledger
HyperLedger Fabric : 3 Components
16
2
o Registration of identities, or
connects to LDAP as the
user registry
o Issuance of Enrollment
Certificates (ECerts)
o Certificate renewal and
revocation
o Every Single operation
MUST be signed with a
Certificate.
o Certificates are per user.
Certificate Authority
o Before anything is committed to
the Ledger it must pass thru
Orderer Service.
o Provides Order of
Transactions.
o It creates the Blocks for the
Blockchain.
o Block size can be based on no.
of transactions and / or timeout
value.
o Orderer in two modes - Solo for
the Dev environment and Kafka
for the Production environment.
Orderer
o Can update or Query the
ledger.
o One Peer can be part of
multiple channels.
o Peer Endorse the
transaction.
o All the Peers find each other
and synchronizes
automatically.
o Peer manages the Ledger
which consists of the
Transaction Log (Blockchain)
and World State.
o Peer has two roles
Endorser and Committer.
Peer
Source: http://hyperledger-fabric-
ca.readthedocs.io/en/latest/users-guide.html
01-02-2019
HyperLedger Fabric – CA
17
http://www.haproxy.org/
2
Source: http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#table-of-contents
CA
HA
Proxy
Peer Network
Cluster
REST API
CA Cluster with HA Proxy Load balancer
Fabric CA Server can
be connected using
1. Fabric CA Client
2. Fabric CA SDK
(REST API Calls)
Fabric CA servers in a cluster share the same database for
keeping track of identities and certificates. If LDAP is configured,
the identity information is kept in LDAP rather than the
database.
This ensures that there is NO Single Point of Failure for CA.No Single Point of
Failure for Peers.
01-02-2019
HyperLedger Fabric – Peer
18
2Source:http://hyperledger-fabric.readthedocs.io/en/release-1.0/fabric_model.html
Blockchain
Tx Tx Tx Tx
Block
Peer
Query ledger
history for a key,
enabling data
provenance
scenarios.
Peer
CouchDB
Read-only queries
using a rich query
language (if using
CouchDB as state
database)
Transactions contain
signatures of every
endorsing peer and
are submitted to
ordering service.
Peer
Tx
Peer
Peers validate transactions
against endorsement policies and
enforce the policies.
Endorsement
Policies
Peer
Peers can have multiple Channels
Peer
Prior to appending a block, a
versioning check is performed to
ensure that states for assets that
were read have not changed
since Chaincode execution time.
Tx
$ docker run -it hyperledger/fabric-peer bash
# peer chaincode --help01-02-2019
HyperLedger Fabric – Peer CLI
01-02-2019 19
$ docker run -it hyperledger/fabric-peer bash
# peer chaincode –help
Usage:
peer chaincode [command]
Available Commands:
install Package the specified chaincode into a deployment spec
and save it on the peer's path.
instantiate Deploy the specified chaincode to the network.
invoke Invoke the specified chaincode.
package Package the specified chaincode into a deployment spec.
query Query using the specified chaincode.
signpackage Sign the specified chaincode package
upgrade Upgrade chaincode.
2
Source : http://hyperledger-fabric.readthedocs.io/en/release-1.0/chaincode4noah.html
HyperLedgerFabric–PeerCLI
20
Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
-C, --chainID string The chain on which this command should be executed (default "testchainid")
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-o, --orderer string Ordering service endpoint
-p, --path string Path to chaincode
-P, --policy string The endorsement policy associated to this chaincode
-t, --tid string Name of a custom ID generation algorithm (hashing and decoding)
e.g. sha256base64
--tls Use TLS when communicating with the orderer endpoint
-u, --username string Username for chaincode operations when security is enabled
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--logging-level string Default logging level and overrides, see core.yaml for full syntax
--test.coverprofile string Done (default "coverage.cov")
Use "peer chaincode [command] --help" for more information about a command.
2
Source : http://hyperledger-fabric.readthedocs.io/en/release-1.0/chaincode4noah.html01-02-2019
HyperLedger Fabric - Orderer
01-02-2019 21
2
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/kafka.html
Node 2
Orderer
Zookeeper
Node 1
Node 2
Node 3
Broker 1
Broker 2
Broker n
Broker ..
Kafka Zookeeper
Node 1
Orderer
Node 3
Orderer
Node 4
Orderer
Ordering
Service Client
Defining Consensus is
3 Phase Process
1. Endorsement
2. Ordering
3. Validation
ZooKeeper nodes 3,5,7
Service Type
1. Solo (Dev)
2. Kafka (Prod)
3. PBFT (Prod)* No Single Point of Failure for Orderer.
HyperLedger Fabric Model – Assets / Chaincode
01-02-2019 22
2
o The exchange of almost anything with monetary value over the network, from whole foods
to antique cars to currency futures.
o Represented as a collection of key-value pairs, with state changes recorded as transactions
on a Channel ledger.
o Assets can be represented in binary and/or JSON form.
Assets
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/fabric_model.html
o It defines an asset or assets, and the transaction instructions for modifying the asset(s). Its the
business logic.
o It enforces the rules for reading or altering key value pairs or other state database information.
o It execute against the ledger’s current state database & are initiated through a transaction proposal.
o It’s execution results in a set of key value writes (write set) that can be submitted to the network
and applied to the ledger on all peers.
Chaincode / Smart Contract
Fabric - Endorsement Policy
23
2
• Peer uses Endorsement policies to decide if the
transaction is properly Endorsed.
• Peer invokes VSCC (Validation System Chaincode)
associated with transaction’s Chaincode
• VSCC is tasked to do the following
• All Endorsements are valid (Valid signatures from
Valid Certificates)
• There is an appropriate number of Endorsements.
• Endorsement came from expected Source(s)
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/endorsement-policies.html
Examples
• Org1.admin
• Org2.member
• Org3.peer
Roles (of the
Signer) are
supported
1. Member
2. Admin
3. Client
4. Peer
4
01-02-2019
Fabric – Endorsement Policy Design
24Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/endorsement-policies.html
Endorsement Policy has two Components
P
A Principal (P) identifies the entity
whose signature is expected
T
A Threshold Gate <T> takes two inputs:
• <t> an integer : threshold
• [n] a list of : principals or gates
2
This Gate
essentially
captures the
expectation that:
• out of those
[n] principals
or gates,
• <t> are
requested to
be satisfied
T(2, ‘A’, ‘B’, ‘C’)
Requests a signature from any
2 Principals out of A,B,C
T(1, ‘A’, T(1, ‘B’, ‘C’))
Requests 1 signature from A or
1 from Principal B and C each.
01-02-2019
Fabric - Endorsement Policy using CLI
25
2
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/endorsement-policies.html
Principals are described as MSP.ROLE
Examples
• Org1.admin
• Org2.member
• Org3.peer
EXPR(E[, E...])
where EXPR is either AND or OR, representing the two Boolean expressions and E is
either a principal (with the syntax described above) or another nested call to EXPR.
For example:
• AND ('Org1.member', 'Org2.member', 'Org3.member') requests 1 signature from
each of the three principals
• OR ('Org1.member', 'Org2.member') requests 1 signature from either one of the
two principals
• OR ('Org1.member', AND('Org2.member', 'Org3.member')) requests either one
signature from a member of the Org1 MSP or 1 signature from a member of
the Org2 MSP and 1 signature from a member of the Org3 MSP.
Roles (of the
Signer) are
supported
1. Member
2. Admin
3. Client
4. Peer
4
The policy can be specified at instantiate time using the -P switch, followed
by the policy. For example:
$ peer chaincode instantiate -C <channelid> -n mycc -P "AND('Org1.member', 'Org2.member')"
01-02-2019
HyperLedger Fabric Channels
01-02-2019 26
2
o A Hyperledger Fabric channel is a private “subnet” of communication between two or
more specific network members, for the purpose of conducting private and confidential
transactions.
o Channel is a completely separate instance of HyperLedger Fabric. Every Channel is
completely isolated and will never talk to each other.
o To create a new channel, the client SDK calls configuration system Chaincode and
references properties such as anchor peer**s, and members (organizations). This
request creates a **genesis block for the channel ledger, which stores configuration
information about the channel policies, members and anchor peers.
o The consensus service orders transactions and delivers them, in a block, to each
leading peer, which then distributes the block to its member peers, and across the
channel, using the gossip protocol.
Why Channel is unique to Fabric?
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/channels.html
Gossip Protocol
01-02-2019 27
2
o Manages peer discovery and channel membership, by continually
identifying available member peers, and eventually detecting peers
that have gone offline.
o Disseminates ledger data across all peers on a channel. Any peer
with data that is out of sync with the rest of the channel identifies
the missing blocks and syncs itself by copying the correct data. A
state reconciliation process synchronizes world state across peers
on each channel. Each peer continually pulls blocks from other
peers on the channel, in order to repair its own state if
discrepancies are identified
o Bring newly connected peers up to speed by allowing peer-to-peer
state transfer update of ledger data.
Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/gossip.html
Summary – HyperLedger Fabric Architecture
28
2
Orderer
• Consensus
verification
• Creates Blocks
CA
• Registration
of identities
• Manage
Certificates
Peer
• Endorses Tx
• Simulates Tx
• Commits Tx
All these components can be clustered for scalability and to avoid Single Point of Failure
3 Components of Fabric
Ledger
Blockchain & World State
Smart Contract
• createCar
• queryAllCars
• queryCarProperties
• changeCarColor
• changeCarOwner
Other Concepts
• Endorsement Policies
• Assets : Anything that’s
valuable for the Organization
• Transactions (State changes
of Assets)
• Gossip Protocol : The glue
that keeps the peers in
healthy state.
Channels
• Private subnet for
a set of parties
based on Smart
contract
• Ledger / Channel
• Peers can have
multiple Channels
• Private Data
1
2
01-02-2019
Fabric : Internals
01-02-2019 29
Ledger
01-02-2019 30Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html
• Ledger L comprises blockchain B and World State W.
• Blockchain B determines World State W.
• Also expressed as: World state W is derived from blockchain B.
3
Blockchain Structure
01-02-2019 31Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html
In the above diagram, we can see that block B2 has a block data D2 which contains all its transactions: T5, T6, T7.
Most importantly, B2 has a block header H2, which contains a cryptographic hash of all the transactions in D2 as
well as with the equivalent hash from the previous block B1. In this way, blocks are inextricably and immutably linked
to each other, which the term blockchain so neatly captures!
3
Blockchain Blocks
01-02-2019 32
Block Header
This section comprises three fields, written when a block is created.
• Block number: An integer starting at 0 (the genesis block), and increased by 1 for every new
block appended to the blockchain.
• Current Block Hash: The hash of all the transactions contained in the current block.
• Previous Block Hash: A copy of the hash from the previous block in the blockchain.
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html
3
Transactions
01-02-2019 33Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html
3
Peers
01-02-2019 34
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
Peers and Channels
01-02-2019 35
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
Peers and Organizations
01-02-2019 36
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
Blockchain Network
01-02-2019 37
Blockchain Network
01-02-2019 38
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/network/network.html
Blockchain Network
01-02-2019 39
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/network/network.html
Four organizations, R1, R2, R3 and
R4 have jointly decided, and written
into an agreement, that they will set
up and exploit a Hyperledger Fabric
network. R4 has been assigned to be
the network initiator – it has been
given the power to set up the initial
version of the network. R4 has no
intention to perform business
transactions on the network.
• R1 and R2 have a need for a private communications within the overall network, as do R2 and R3.
• Organization R1 has a client application that can perform business transactions within channel C1.
• Organization R2 has a client application that can do similar work both in channel C1 and C2.
• Organization R3 has a client application that can do this on channel C2.
• Peer node P1 maintains a copy of the ledger L1 associated with C1.
• Peer node P2 maintains a copy of the ledger L1 associated with C1 and a copy of ledger L2
associated with C2.
• Peer node P3 maintains a copy of the ledger L2 associated with C2.
Blockchain Network
01-02-2019 40
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/network/network.html
• The channel C1 is under the control of organizations R1 and R2.
• Channel C2 is governed according to the policy rules specified in channel configuration CC2;
• the channel is under the control of organizations R2 and R3.
• There is an ordering service O4 that services as a network administration point for N, and uses the
system channel.
• The ordering service also supports application channels C1 and C2, for the purposes of transaction
ordering into blocks for distribution.
• Each of the four organizations has a preferred Certificate Authority.
• The network is governed
according to policy rules
specified in network
configuration NC4,
• the network is under the
control of organizations R1
and R4.
• Channel C1 is governed
according to the policy rules
specified in channel
configuration CC1;
Fabric : Transaction Flow
01-02-2019 41
Fabric: Transaction Flow
42
3 Source:
http://hyperledger-fabric.readthedocs.io/en/release-1.0/txflow.html
1
2
Customer wants to order Red Roses
from Merchant for a new price.
Scenario
Customer Merchant
Customer
PeerBPeerA
Tx Proposal
• Endorsement Policy in the Chaincode states
proposal must be accepted by all parties.
• Proposal includes the function of the Chaincode
that needs to be triggered and other params.
• The SDK packages the transaction proposal into
the properly architected format (protocol buffer
over gRPC) and takes the user’s cryptographic
credentials to produce a unique signature for this
transaction proposal. Endorsing Peers
2.1 The Endorsing Peers : Verification
1. The transaction Proposal is well formed
2. It has not been submitted already in the past (replay attack protection)
3. The signature is valid using (MSP) and the
4. Submitter (Customer) is properly authorized to perform the proposed operation on the Channel.
01-02-2019
Fabric: Transaction Flow
43
3 Source:
http://hyperledger-fabric.readthedocs.io/en/release-1.0/txflow.html
2
2.2 The Endorsing Peers : Execute
1. The endorsing peers take the transaction proposal
inputs as arguments to the invoked chaincode’s
function It has not been submitted already in the
past (replay attack protection)
2. The chaincode is then executed against the current
state database to produce transaction results
including a response value, read set, and write set.
• No updates are made to the ledger at this point. Signed Proposal
3
Proposal Responses are inspected
1. App verifies the endorsing peer signatures.
2. Checks if the Endorsement policy is fulfilled (ie.
Customer and the Merchant Peer both endorse the
proposal).
01-02-2019
01-02-2019 44
Fabric: Transaction Flow3
Convert Endorsement to transaction
1. The App “broadcasts” the transaction proposal and
response within a “transaction message” to the
Ordering Service
2. The transaction will contain the read/write sets. The
endorsement signatures and Channel ID.
3. The ordering service doesn't need to inspect the
content of the transaction.
4. It receives transactions from all the channels from
the network and orders them chronologically by the
Channel and
5. Creates blocks of transactions per channel.
4 Ordering
Service
Channels
01-02-2019 45
Fabric: Transaction Flow3
Transaction Validated and Committed
1. The blocks of transactions are delivered to all Peers
in the network based on the Channel ID.
2. Validate the transaction based on Endorsement
policy.
3. Ensure that no change in the Ledger state based on
the Read-set variables since the read-set was
generated by the transaction execution.
4. Transactions in the block are tagged as being Valid
or Invalid.
5
Ordering
Service
Peers
01-02-2019 46
Fabric: Transaction Flow3
6
Ledger Updated
1. Each Peer appends the Block to the
Channels chain.
2. For Each VALID transactions the write-set is
committed to the World State Database.
3. An Event is emitted to Notify the Client
Application.
4. Transactions in the block are tagged as being
Valid or Invalid.
Block
appended
to Tx Chain
Sends Notification
01-02-2019 47
Fabric: Transaction Flow Summary3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
Fabric : Private Data
01-02-2019 48
HyperLedger Fabric v1.2 onwards
Private Data
01-02-2019 49
3
Private Data
06/12/18 43
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/private-data/private-data.html
Private Data – Use Case
01-02-2019 50
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/private-data/private-data.html
• A Farmer selling his goods
abroad
• A Distributor moving goods
abroad
• A Shipper moving goods
between parties
• A Wholesaler purchasing
goods from distributors
• A Retailer purchasing
goods from shippers and
wholesalers
Private Data – Transaction Flow
01-02-2019 51
3
Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/private-data/private-data.html
1. The client application submits a proposal request to invoke a chaincode.
2. The endorsing peers simulate the transaction and store the private data in a transient data store (a
temporary storage local to the peer). They distribute the private data, based on the collection policy,
to authorized peers via gossip protocol.
3. The endorsing peer sends the proposal response back to the client with public data, including a hash
of the private data key and value. No private data is sent back to the client.
4. The client application submits the transaction to the ordering service (with hashes of the private
data) which gets distributed into blocks as normal. The block with the hashed values is distributed to
all the peers.
5. At block-committal time, authorized peers use the collection policy to determine if they are
authorized to have access to the private data. If they do, they will first check their
local transient data store to determine if they have already received the private data at chaincode
endorsement time. If not, they will attempt to pull the private data from another peer. Then they will
validate the private data against the hashes in the public block and commit the transaction and the
block. Upon validation/commit, the private data is moved to their copy of the private state database
and private writeset storage.
Fabric : Getting Started
01-02-2019 52
Fabric Example : Pre requisites – Fabric Network
01-02-2019 53
3
$ git clone -b master https://github.com/hyperledger/fabric-samples.git
$ cd fabric-samples
$ git checkout {TAG}
Source: http://hyperledger-fabric.readthedocs.io/en/latest/samples.html
To ensure the samples are compatible with the version of Fabric binaries you download below,
checkout the samples {TAG} that matches your Fabric version, for example, v1.1.0. To see a list
of all fabric-samples tags, use command “git tag”.
$ curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0
Please execute the following command from within the directory into which you will extract the
platform-specific binaries:
If you get an error running the above curl command, you may have too old a version of curl that
does not handle redirects or an unsupported environment.
$ export PATH=<path to download location>/bin:$PATH
The script lists out the Docker images installed upon conclusion.
Fabric Example : Writing your First App
01-02-2019 54Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
We will show the process for interacting with a Certificate
Authority and generating enrollment certificates, after which
we will leverage these generated identities (user objects) to
query and update a ledger.
1. Set up the Development Environment
2. Learn the parameters of Smart
Contract
3. Develop Apps that can Query and
Update the Ledger
3
Smart
Contract
Blockchain Network
CAOrderer
QueryExecute Smart Contracts
Get Ledger Updates
Ledger
Fabric Example : Install the Fabcar Example
55
3
$ cd fabric-samples/fabcar && ls *.js
enrollAdmin. js Invoke.js query.js registerUser.js
You will see for Node JS Programs as follows
Do a cleanup before u start installing the Sample App in the Ledger
$ docker rm -f $(docker ps -aq)
$ docker network prune
$ docker rmi dev-peer0.org1.example.com-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba
$ npm install
$ ./startFabric.sh
Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html01-02-2019
Fabric Example : Enroll User
01-02-2019 56
3
Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
$ node enrollAdmin.js
An admin user - admin - was registered with our Certificate Authority. Now we need to send an
enroll call to the CA server and retrieve the enrollment certificate (eCert) for this user.
This program will invoke a certificate signing request (CSR) and ultimately output an eCert and
key material into a newly created folder - hfc-key-store - at the root of this project.
$ node registerUser.js
Newly generated admin eCert, we will now communicate with the CA server once more to
register and enroll a new user. This user - user1 - will be the identity we use when querying and
updating the ledger.
Similar to the admin enrollment, this program invokes a CSR and outputs the keys and eCert
into the hfc-key-store subdirectory. So now we have identity material for two separate users -
admin & user1
Fabric Example : Smart Contract Functions
01-02-2019 57
Smart Contract
Chaincode (GoLang / NodeJS)
Blockchain Network
CAOrderer
Ledger
• createCar
• queryAllCars
• queryCarProperties
• changeCarColor
• changeCarOwner
3
01-02-2019 58
3
Chaincode Constructor
Invoke(stub) method is called as result
of an application request to the
Chaincode
Ledger Persistence Calls – Commands
createCar(stub, args)
changeCarOwner(stub, args)
01-02-2019 59
3
queryCar(stub, args)
Ledger Persistence Calls – Queries
queryAllCars(stub, args)
Fabric Example : Query The Ledger
01-02-2019 60
3
$ node query.js
Similar to the admin enrollment, this program invokes a CSR and outputs the keys and eCert
into the hfc-key-store subdirectory. So now we have identity material for two separate users -
admin & user1
Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
Smart
Contract
Blockchain Network
CAOrderer
QueryRun the query
Return Query Results
Queries are how you read data from the ledger. This data is stored as a
series of key-value pairs, and you can query for the value of a single
key, multiple keys, or – if the ledger is written in a rich data storage
format like JSON – perform complex searches against it (looking for all
assets that contain certain keywords, for example)
fabric_client.getUserContext('user1', true);
Ledger
HyperLedger Fabric – Node.JS Client API
61Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/write_first_app.html
1. Initialize the Client API
2. Create a Channel
3. Create a Peer
4. Add Peer to the Channel
3
Query ChainCode: fabcar
Query Function: queryAllCars
$ node query.js
GetHistoryForKey()
GetHistoryForKey()
01-02-2019
HyperLedger Fabric – Node.JS Client API
01-02-2019 62
3
1. Get a Transaction ID based on the
user assigned to the client.
2. Send Transaction Proposal for
3. createCar() function in the
Chaincode creates a new transaction
4. changeCarOwner() function in the
Chaincode updates the owner.
Update function doesn't update the Blockchain instead it will have a new record with the latest status of the Asset.
$ node invoke.js
Conclusion
01-02-2019 63
Ethereum Vs. HyperLedger Fabric Vs. R3 Corda
64
4
Characteristics Ethereum HyperLedger Fabric R3 Corda
Description of
the Platform
Generic Blockchain Platform Modular Blockchain Platform
Specialized distributed ledger
platform for Financial Industry
Release History July 2015
v0.6 Sept 2016, v1.0 July 2017,
v1.3 2018
v-m0.0 May 2016, v1.0 Oct 2017,
v3.0 Mar 2018
Crypto Currency
Ether / Tokens (Usage, Work) via
Smart Contract
None
Currency and Tokens via Chaincode
None
Governance
Ethereum Developers
Enterprise Ethereum Alliance
Linux Foundation
IBM
R3
Consensus
Mining based on Proof of Work
(POW) – All participants need to
agree.
Ledger Level
Selective Endorsement. Consensus
can be even within a channel with
select parties instead of everyone.
Transaction Level
Specific understanding of
Consensus. (Validity, Uniqueness)
Transaction Level
Network Permissionless, Public or Private Permissioned, Private Permissioned, Private
State Account Data
Key-value Database
Transaction Log, World State
Vault contains States
Historic & Current State
Smart Contracts Solidity Chaincode (GoLang, Node.JS, Java) Smart Contract (Kotlin, Java)
Development
Languages
GoLang, C++, Python Java, Node.JS, Python (Post 1.0) Java, Kotlin
01-02-2019
Summary – Benefits of Blockchain Technologies
01-02-2019 65
4
Saves Time
Immutable
transaction across
parties done at the
same time.
Remove Cost
Overheads on
maintaining and
synchronizing silos.
Increases Trust
Through shared process
and unified Systems of
Record. For end
consumers it’s a System
of Proof.
Reduces Risk
Tampering of data,
fraud and cyber crime
is avoided.
Disrupting the Media Value Chain
01-02-2019 66
Introduction of
Blockchain will
result in
deprecation of
critical
roles/operations
played by some
of the Business
Entities.
4
Content Bypassing the Aggregators
67
Source: Deloitte : Blockchain @ Media
Content Producer
/ Artist Aggregator Consumer
Current Scenario
Content Producer
/ Artist
Distributed
Ledger Consumer
After Introduction of Blockchain
Benefits
• Direct Customer Artist
relationship.
• Easy to measure marketing and
performance.
Challenges
• Content Aggregators and
Advertising networks to loose
their dominant position.
• Blockchain has the potential to
make DRMsystems obsolete or at
least to reduce it’s complexity
4
01-02-2019
Distribution of Royalty Payments
68
Artist Aggregator User
Current Scenario
Music
Publisher Distributor
Artist User
After Introduction of Blockchain
Distributed Ledger Distributor
Source: Deloitte : Blockchain @ Media
Benefits
• Near Real-time distribution of
Royalty payments based on Smart
Contracts
• Every usage and consumption is
tracked in Blockchain
Challenges
• Handling large amount of Data
• All the parties agreeing to
common Blockchain Platform.
4
01-02-2019
01-02-2019 69
References
Blockchain Video Tutorials
• Blockchain Use Cases: https://wiki.hyperledger.org/groups/requirements/use-case-inventory
• Hyperledger Fabric Explainer: https://www.youtube.com/watch?v=js3Zjxbo8TM
• Blockchain Technology : https://www.youtube.com/watch?v=qOVAbKKSH10
• Smart Contracts : https://www.youtube.com/watch?v=ZE2HxTmxfrI
• Hyperledger Fabric v1.1 Node.JS Chaincode : https://www.youtube.com/watch?v=dzwR0dwzXNs
• Hyperledger Fabric v1.0 : https://www.youtube.com/watch?v=6nGIptzBZis
• Hyperledger Fabric for Beginners : https://www.youtube.com/watch?v=Y177TCUc4g0
• Fabric Composer : https://www.youtube.com/watch?v=fdFUsrsv5iw
• Hyperledger Composer : https://www.youtube.com/watch?v=iRlm4uY_9pA
• How does it works: Blockchain : https://www.youtube.com/watch?v=lD9KAnkZUjU
• How does Blockchain work: https://www.youtube.com/watch?v=LZEHOlZY2To
• 19 Industries The Blockchain will disrupt : https://www.youtube.com/watch?v=G3psxs3gyf8
• What is the difference between Bitcoin & Blockchain? : https://www.youtube.com/watch?v=MKwa-BqnJDg
• Bitcoin: What Bill Gates, Buffet, Elon Mush & Richard Branson has to say about Bitcoin?
4
70
1. HyperLedger Architecture Volume 1
2. Creating Tokens in Hyperledger Fabric : https://github.com/Kunstmaan/hyperleder-fabric-kuma-token-example/
3. Karame, Androulaki, & Capkun. (2012). Double spending fast payments in bitcoin. ACM Conference on Computer and
communications security, (pp. 906-917).
4. King, N. (2012). PPCoin: Peer to peer cryptocurrency with proof of stake.
5. Kwon. (2014). Tendermint: Consensus without Mining. Cornell Edu.
6. Mazieres, D. (2015). The Stellar Consensus Protocol: Federated Model for Internet level consensus. Stellar Development
Foundation.
7. Narayanan, B. F. (2016). Bitcoin and cryptocurrency technologies. Princeton: Princeton University Press.
8. O'Dwyer, & Malone. (2014). Bitcoin mining and its energy footprint. Irish Signals and Systems Conference, pp. 280-285
9. Byzantine Fault Tolerance : https://en.wikipedia.org/wiki/Byzantine_fault_tolerance
10. Building Blockchain Apps for Node.JS developers with HyperLedger Composer – Simon Stone IBM
References
My Slide share Presentations
1. Enterprise Software Architecture – http://www.slideshare.net/arafkarsh/software-architecture-styles-64537120
2. Functional Reactive Programming – https://www.slideshare.net/arafkarsh/functional-reactive-programming-64780160
3. Microservices – Part 1: https://www.slideshare.net/arafkarsh/micro-services-architecture-80571009
4. Event Storming and Saga Design Pattern – Part 2 : https://www.slideshare.net/arafkarsh/event-storming-and-saga
5. Docker and Linux Containers : https://www.slideshare.net/arafkarsh/docker-container-linux-container
6. Function Point Analysis : http://www.slideshare.net/arafkarsh/functional-reactive-programming-64780160
4
01-02-2019
71
Araf Karsh Hamid : Co-Founder / CTO
araf.karsh@metamagic.in
USA: +1 (973) 969-2921
India: +91.999.545.8627
Skype / LinkedIn / Twitter / Slideshare : arafkarsh
http://www.slideshare.net/arafkarsh
https://www.linkedin.com/in/arafkarsh/
http://www.arafkarsh.com/
DREAM | AUTOMATE | EMPOWER
01-02-2019
Transaction Proposal to Commit
01-02-2019 72
3

More Related Content

What's hot

Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainJordan Harris
 
What is tokenization in blockchain?
What is tokenization in blockchain?What is tokenization in blockchain?
What is tokenization in blockchain?Ulf Mattsson
 
Hyperledger fabric 20180528
Hyperledger fabric 20180528Hyperledger fabric 20180528
Hyperledger fabric 20180528Arnaud Le Hors
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain PresentationZied GUESMI
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxGene Leybzon
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithmsAnurag Dashputre
 
02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric  02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric Merlec Mpyana
 
Introduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart ContractsIntroduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart ContractsTechracers
 
Blockchain 101 by imran bashir
Blockchain 101  by imran bashirBlockchain 101  by imran bashir
Blockchain 101 by imran bashirImran Bashir
 
PoW vs. PoS - Key Differences
PoW vs. PoS - Key DifferencesPoW vs. PoS - Key Differences
PoW vs. PoS - Key Differences101 Blockchains
 
Hyperledger Fabric and Tools
Hyperledger Fabric and ToolsHyperledger Fabric and Tools
Hyperledger Fabric and ToolsRihusoft
 
Smart Contract & Ethereum
Smart Contract & EthereumSmart Contract & Ethereum
Smart Contract & EthereumAkshay Singh
 
An introduction to block chain technology
An introduction to block chain technologyAn introduction to block chain technology
An introduction to block chain technologyyaminisindhurabandar
 
An Introduction to Blockchain Technology
An Introduction to Blockchain Technology An Introduction to Blockchain Technology
An Introduction to Blockchain Technology Niuversity
 

What's hot (20)

Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
What is tokenization in blockchain?
What is tokenization in blockchain?What is tokenization in blockchain?
What is tokenization in blockchain?
 
Hyperledger fabric 20180528
Hyperledger fabric 20180528Hyperledger fabric 20180528
Hyperledger fabric 20180528
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
 
An Introduction to Blockchain
An Introduction to BlockchainAn Introduction to Blockchain
An Introduction to Blockchain
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithms
 
02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric  02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric
 
Blockchain 2.0
Blockchain 2.0Blockchain 2.0
Blockchain 2.0
 
Introduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart ContractsIntroduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart Contracts
 
Blockchain 101 by imran bashir
Blockchain 101  by imran bashirBlockchain 101  by imran bashir
Blockchain 101 by imran bashir
 
PoW vs. PoS - Key Differences
PoW vs. PoS - Key DifferencesPoW vs. PoS - Key Differences
PoW vs. PoS - Key Differences
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
 
Hyperledger Fabric and Tools
Hyperledger Fabric and ToolsHyperledger Fabric and Tools
Hyperledger Fabric and Tools
 
Smart Contract & Ethereum
Smart Contract & EthereumSmart Contract & Ethereum
Smart Contract & Ethereum
 
An introduction to block chain technology
An introduction to block chain technologyAn introduction to block chain technology
An introduction to block chain technology
 
Blockchain ppt
Blockchain pptBlockchain ppt
Blockchain ppt
 
An Introduction to Blockchain Technology
An Introduction to Blockchain Technology An Introduction to Blockchain Technology
An Introduction to Blockchain Technology
 
Blockchain
BlockchainBlockchain
Blockchain
 

Similar to Blockchain HyperLedger Fabric Internals - Clavent

Blockchain Hyper Ledger Fabric : Bangkok Conference
Blockchain Hyper Ledger Fabric : Bangkok ConferenceBlockchain Hyper Ledger Fabric : Bangkok Conference
Blockchain Hyper Ledger Fabric : Bangkok ConferenceAraf Karsh Hamid
 
Iata blockchain presentation icaew suisse branch
Iata blockchain presentation   icaew suisse branchIata blockchain presentation   icaew suisse branch
Iata blockchain presentation icaew suisse branchTim Moss
 
Wwc developing hyperledger applications v4
Wwc  developing hyperledger applications v4Wwc  developing hyperledger applications v4
Wwc developing hyperledger applications v4LennartF
 
hyperledger-chaincode & hyperl fabric.pptx
hyperledger-chaincode & hyperl fabric.pptxhyperledger-chaincode & hyperl fabric.pptx
hyperledger-chaincode & hyperl fabric.pptxdeepaksingh160910
 
Blockchain architected
Blockchain architectedBlockchain architected
Blockchain architectedIBM Sverige
 
Blockchain - Primer for City CIOs v05 01 22.pdf
Blockchain - Primer for City CIOs v05 01 22.pdfBlockchain - Primer for City CIOs v05 01 22.pdf
Blockchain - Primer for City CIOs v05 01 22.pdfssusera441c2
 
Blockchin architecture & use cases -part-2
Blockchin architecture & use cases -part-2Blockchin architecture & use cases -part-2
Blockchin architecture & use cases -part-2Mohammad Asif
 
Blockchain Tech Approach Whitepaper
Blockchain Tech Approach WhitepaperBlockchain Tech Approach Whitepaper
Blockchain Tech Approach WhitepaperProperty Bihar
 
An introduction to blockchain and hyperledger v ru
An introduction to blockchain and hyperledger v ruAn introduction to blockchain and hyperledger v ru
An introduction to blockchain and hyperledger v ruLennartF
 
How to Build a Decentralized Blockchain App with the Oracle Blockchain Platform
How to Build a Decentralized BlockchainApp with the Oracle Blockchain PlatformHow to Build a Decentralized BlockchainApp with the Oracle Blockchain Platform
How to Build a Decentralized Blockchain App with the Oracle Blockchain PlatformJuarez Junior
 
IRJET- Different Blockchain Platforms and Algorithms
IRJET-  	  Different Blockchain Platforms and AlgorithmsIRJET-  	  Different Blockchain Platforms and Algorithms
IRJET- Different Blockchain Platforms and AlgorithmsIRJET Journal
 
Blockchain Explored: A technical deep-dive
Blockchain Explored: A technical deep-diveBlockchain Explored: A technical deep-dive
Blockchain Explored: A technical deep-diveBinh Nguyen
 
Blockchain, Hyperledger and the Oracle Blockchain Platform
Blockchain, Hyperledger and the Oracle Blockchain PlatformBlockchain, Hyperledger and the Oracle Blockchain Platform
Blockchain, Hyperledger and the Oracle Blockchain PlatformJuarez Junior
 
Oracle Blockchain Experience Day
Oracle Blockchain Experience DayOracle Blockchain Experience Day
Oracle Blockchain Experience DayJuarez Junior
 
IRJET- Proof of Document using Multichain and Ethereum
IRJET- Proof of Document using Multichain and EthereumIRJET- Proof of Document using Multichain and Ethereum
IRJET- Proof of Document using Multichain and EthereumIRJET Journal
 
IRJET- Study of Blockchain and its Concepts
IRJET-  	  Study of Blockchain and its ConceptsIRJET-  	  Study of Blockchain and its Concepts
IRJET- Study of Blockchain and its ConceptsIRJET Journal
 
Anatomy of a hyperledger application
Anatomy of a hyperledger applicationAnatomy of a hyperledger application
Anatomy of a hyperledger applicationEric Cattoir
 
Decentralized Car Hailing Application
Decentralized Car Hailing ApplicationDecentralized Car Hailing Application
Decentralized Car Hailing ApplicationIRJET Journal
 
Blockchain and BPM - Reflections on Four Years of Research and Applications
Blockchain and BPM - Reflections on Four Years of Research and ApplicationsBlockchain and BPM - Reflections on Four Years of Research and Applications
Blockchain and BPM - Reflections on Four Years of Research and ApplicationsIngo Weber
 

Similar to Blockchain HyperLedger Fabric Internals - Clavent (20)

Blockchain Hyper Ledger Fabric : Bangkok Conference
Blockchain Hyper Ledger Fabric : Bangkok ConferenceBlockchain Hyper Ledger Fabric : Bangkok Conference
Blockchain Hyper Ledger Fabric : Bangkok Conference
 
Blockchain hyerledger-fabric
Blockchain hyerledger-fabricBlockchain hyerledger-fabric
Blockchain hyerledger-fabric
 
Iata blockchain presentation icaew suisse branch
Iata blockchain presentation   icaew suisse branchIata blockchain presentation   icaew suisse branch
Iata blockchain presentation icaew suisse branch
 
Wwc developing hyperledger applications v4
Wwc  developing hyperledger applications v4Wwc  developing hyperledger applications v4
Wwc developing hyperledger applications v4
 
hyperledger-chaincode & hyperl fabric.pptx
hyperledger-chaincode & hyperl fabric.pptxhyperledger-chaincode & hyperl fabric.pptx
hyperledger-chaincode & hyperl fabric.pptx
 
Blockchain architected
Blockchain architectedBlockchain architected
Blockchain architected
 
Blockchain - Primer for City CIOs v05 01 22.pdf
Blockchain - Primer for City CIOs v05 01 22.pdfBlockchain - Primer for City CIOs v05 01 22.pdf
Blockchain - Primer for City CIOs v05 01 22.pdf
 
Blockchin architecture & use cases -part-2
Blockchin architecture & use cases -part-2Blockchin architecture & use cases -part-2
Blockchin architecture & use cases -part-2
 
Blockchain Tech Approach Whitepaper
Blockchain Tech Approach WhitepaperBlockchain Tech Approach Whitepaper
Blockchain Tech Approach Whitepaper
 
An introduction to blockchain and hyperledger v ru
An introduction to blockchain and hyperledger v ruAn introduction to blockchain and hyperledger v ru
An introduction to blockchain and hyperledger v ru
 
How to Build a Decentralized Blockchain App with the Oracle Blockchain Platform
How to Build a Decentralized BlockchainApp with the Oracle Blockchain PlatformHow to Build a Decentralized BlockchainApp with the Oracle Blockchain Platform
How to Build a Decentralized Blockchain App with the Oracle Blockchain Platform
 
IRJET- Different Blockchain Platforms and Algorithms
IRJET-  	  Different Blockchain Platforms and AlgorithmsIRJET-  	  Different Blockchain Platforms and Algorithms
IRJET- Different Blockchain Platforms and Algorithms
 
Blockchain Explored: A technical deep-dive
Blockchain Explored: A technical deep-diveBlockchain Explored: A technical deep-dive
Blockchain Explored: A technical deep-dive
 
Blockchain, Hyperledger and the Oracle Blockchain Platform
Blockchain, Hyperledger and the Oracle Blockchain PlatformBlockchain, Hyperledger and the Oracle Blockchain Platform
Blockchain, Hyperledger and the Oracle Blockchain Platform
 
Oracle Blockchain Experience Day
Oracle Blockchain Experience DayOracle Blockchain Experience Day
Oracle Blockchain Experience Day
 
IRJET- Proof of Document using Multichain and Ethereum
IRJET- Proof of Document using Multichain and EthereumIRJET- Proof of Document using Multichain and Ethereum
IRJET- Proof of Document using Multichain and Ethereum
 
IRJET- Study of Blockchain and its Concepts
IRJET-  	  Study of Blockchain and its ConceptsIRJET-  	  Study of Blockchain and its Concepts
IRJET- Study of Blockchain and its Concepts
 
Anatomy of a hyperledger application
Anatomy of a hyperledger applicationAnatomy of a hyperledger application
Anatomy of a hyperledger application
 
Decentralized Car Hailing Application
Decentralized Car Hailing ApplicationDecentralized Car Hailing Application
Decentralized Car Hailing Application
 
Blockchain and BPM - Reflections on Four Years of Research and Applications
Blockchain and BPM - Reflections on Four Years of Research and ApplicationsBlockchain and BPM - Reflections on Four Years of Research and Applications
Blockchain and BPM - Reflections on Four Years of Research and Applications
 

More from Araf Karsh Hamid

Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - ObservabilityAraf Karsh Hamid
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SREAraf Karsh Hamid
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton Araf Karsh Hamid
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseAraf Karsh Hamid
 
Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioAraf Karsh Hamid
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactAraf Karsh Hamid
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsAraf Karsh Hamid
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingAraf Karsh Hamid
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Araf Karsh Hamid
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQAraf Karsh Hamid
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAraf Karsh Hamid
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsAraf Karsh Hamid
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREAraf Karsh Hamid
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Araf Karsh Hamid
 

More from Araf Karsh Hamid (20)

Elastic-Engineering
Elastic-EngineeringElastic-Engineering
Elastic-Engineering
 
Zero-Trust SASE DevSecOps
Zero-Trust SASE DevSecOpsZero-Trust SASE DevSecOps
Zero-Trust SASE DevSecOps
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - Observability
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SRE
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-Premise
 
Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes Istio
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito Pact
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration Patterns
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb Sharding
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven Design
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 

Recently uploaded

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Recently uploaded (20)

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

Blockchain HyperLedger Fabric Internals - Clavent

  • 1. 𝑏=1 𝑛 𝑓(𝑏) = 3 𝑑𝑒𝑠𝑖3 𝑟2 𝑒 3D BlockChain ARAF KARSH HAMID Co-Founder / CTO MetaMagic Global Inc., NJ, USA @arafkarsh arafkarsh World Summit 2.0 February 1st, 2019, Vivanta By Taj, Bengaluru, India https://www.clavent.com/event-list/blockchain2-0-bangalore-2018/
  • 2. Agenda 01-02-2019 2 1. Why do we need Blockchain? o Problem Statement o How Blockchain solves this problem o Business Requirement o Distributed Ledger o HyperLedger Fabric 1 4. Fabric Getting Started o Fabric Internals o Blockchain Network o Transaction Flow o Private Data Usage o Setting up Fabric Network o Fabric Example (Node.JS) 3 6. Conclusion o Ethereum Vs. Fabric Vs. Corda o Blockchain Benefits o Industry Scenarios – Media o References 4U HyperLedger Fabric Architecture o Fabric Key Components o Microservices Architecture o 3 Components of Fabric o Fabric Models (Assets, Chaincode..) o Fabric Channels o Gossip Protocol 2
  • 3. Problem Statement 01-02-2019 3 1 Customer A Records Insurer Records Bank Records Regulators Records Auditors Records Merchant A Records Expensive, Vulnerable & Inefficient Source:BuildingBlockchainAppsforNode.JSdevelopers withHyperLedgerComposer–SimonStoneIBM
  • 4. How Blockchain Solves this Problem… 01-02-2019 4 1 Customer A Records Insurer Records Bank Records Regulators Records Auditors Records Merchant A Records Blockchain Ledger A shared, replicated, permissioned ledger  Consensus  Immutability  Provenance  Finality Source: Building Blockchain Apps for Node.JS developers with HyperLedger Composer – Simon Stone IBM
  • 5. Business Requirements 01-02-2019 5 Shared Ledger Append only immutable database shared across the business network. Business logic is embedded within the database and executed to validate and store the transactions. Smart Contract Transactions are secure, authenticated and access controls are enabled for granular access.Privacy Trust All the transactions are verified and endorsed by the trusted relevant parties 1
  • 6. Properties of a Distributed Ledger 01-02-2019 6 o Decentralized, replicated across many participants, each of whom collaborate in its maintenance. o Information recorded is append-only. Immutable. o Immutability makes it simple to determine the provenance of the information. o These properties makes it called as “Systems of Proof” 1 - - - - - - - - - - - n 1
  • 7. How it differs from Bitcoin 01-02-2019 7 1 HyperLedger Fabric Bitcoin Provides Identity Anonymity Selective Endorsement Proof of Work Assets Cryptocurrency Bitcoin is a specific implementation of Blockchain technology
  • 8. HyperLedger Fabric Key Features 01-02-2019 8 1 Source: http://hyperledger-fabric.readthedocs.io/en/latest/functionalities.html o It is private and permission based o Members of HyperLedger Fabric enrolls thru MSP - Membership Service Provider o Different MSPs are supported o Ledger data can be stored in multiple formats. o Consensus mechanisms can be switched in and out o Ability to create channels - Allowing a group of participants to create a separate ledger of transactions. o Provides Membership Identity Service that manages User IDs and authenticates all participants on the network. o Access control lists can be used to Provide additional layers of permission. o A Specific user ID could be permitted to invoke a Chaincode application but blocked from deploying a Chaincode. Identity Management
  • 9. HyperLedger Fabric Key Features 01-02-2019 9 1 Source: http://hyperledger-fabric.readthedocs.io/en/latest/functionalities.html o Transaction execution is separated from transaction ordering and commitment. o Division of labor un burdens ordering nodes from the demands of transaction execution and ledger maintenance, o while peer nodes are freed from ordering (consensus) workloads. Efficient Processing o Chaincode Applications encode logic that is invoked by specific types of transactions on the channel. o System Chaincode is distinguish as Chaincode that defines operating params for the entire channel. Chaincode Functionality o Private channels are restricted messaging paths that can be used to provide transaction privacy and confidentiality for specific subset of network members. o All data including transaction, member and channel information, on a channel are invisible and inaccessible to any network members not explicitly access to that channel. Privacy & Confidentiality
  • 10. Summary – Why do we need Blockchain? 01-02-2019 10 1 Reconciliation Issues in a Multi Party environment. o Expensive o Vulnerable o Inefficient Problem Statement o Consensus among the Parties before a transaction is committed. o Provenance – Origin of the asset can be easily Tracked. o Immutable – Transactions are tamper proof o Finality – Single Source of Truth Solution
  • 12. HyperLedger Fabric Architecture 12 2 Orderer • Consensus verification • Creates Blocks CA • Registration of identities • Manage Certificates Peer • Endorses Tx • Simulates Tx • Commits Tx All these components can be clustered for scalability and to avoid Single Point of Failure 3 Components of Fabric Ledger Blockchain & World State Smart Contract • createCar • queryAllCars • queryCarProperties • changeCarColor • changeCarOwner Other Concepts • Assets : Anything that’s valuable for the Organization • Transactions (State changes of Assets) • Endorsement Policies • Gossip Protocol : The glue that keeps the peers in healthy state. Channels • Private subnet for a set of parties based on Smart contract • Ledger / Channel • Peers can have multiple Channels • Private Data 1 2 01-02-2019
  • 13. 01-02-2019 13 Fabric Deployment Model in every Enterprise Customer A Merchant B Bank Insurer RESTful Services Two Roles = Endorser & Committer Smart Contracts (Chaincode) – Programmable Ledger Persistence Layer - Ledger GetPut Blockchain Events Block Peer 2 Gossip Protocol for P2P Communication Orderer • Consensus Verification • Creates Blocks CA • Registration of identities. • Certificate Management Blockchain & World State Multiple Channels Blockchain & World State
  • 14. 01-02-2019 1414 Monolithic / Micro Services Architecture Traditional Monolithic App using Single Technology Stack Micro Services with Multiple Technology Stack Event Stream API Gateway (Zuul Edge Server) Load Balancer (Ribbon) Circuit Breaker (Hysterix) Service Discovery (Eureka) Load Balancer (Ribbon) Circuit Breaker (Hysterix) Load Balancer (Ribbon) Circuit Breaker (Hysterix) UI Layer Web Services Business Logic Database Layer Database UI Layer Web Services Business Logic Database Layer Micro Service 1 EE 7 Container UI Layer Web Services Business Logic Database Layer Micro Service 2 Container SE 8 UI Layer Web Services Business Logic Database Layer Micro Service 4 Container UI Layer Web Services Business Logic Database Layer Micro Service 3 Container 2
  • 15. HyperLedger Fabric – Ledger 01-02-2019 15 2 Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/fabric_model.html There is one ledger per channel. Couch DB As well as a state database to maintain current fabric state. This is auto derived by the Peers. Each transaction results in a set of asset key- value pairs that are committed to the ledger as creates, updates, or deletes. o The ledger is the sequenced, tamper- resistant record of all state transitions in the fabric. o State transitions are a result of Chaincode invocations (‘transactions’) submitted by participating parties. Blockchain Tx Tx Tx Tx Blocks Tx Ledger
  • 16. HyperLedger Fabric : 3 Components 16 2 o Registration of identities, or connects to LDAP as the user registry o Issuance of Enrollment Certificates (ECerts) o Certificate renewal and revocation o Every Single operation MUST be signed with a Certificate. o Certificates are per user. Certificate Authority o Before anything is committed to the Ledger it must pass thru Orderer Service. o Provides Order of Transactions. o It creates the Blocks for the Blockchain. o Block size can be based on no. of transactions and / or timeout value. o Orderer in two modes - Solo for the Dev environment and Kafka for the Production environment. Orderer o Can update or Query the ledger. o One Peer can be part of multiple channels. o Peer Endorse the transaction. o All the Peers find each other and synchronizes automatically. o Peer manages the Ledger which consists of the Transaction Log (Blockchain) and World State. o Peer has two roles Endorser and Committer. Peer Source: http://hyperledger-fabric- ca.readthedocs.io/en/latest/users-guide.html 01-02-2019
  • 17. HyperLedger Fabric – CA 17 http://www.haproxy.org/ 2 Source: http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#table-of-contents CA HA Proxy Peer Network Cluster REST API CA Cluster with HA Proxy Load balancer Fabric CA Server can be connected using 1. Fabric CA Client 2. Fabric CA SDK (REST API Calls) Fabric CA servers in a cluster share the same database for keeping track of identities and certificates. If LDAP is configured, the identity information is kept in LDAP rather than the database. This ensures that there is NO Single Point of Failure for CA.No Single Point of Failure for Peers. 01-02-2019
  • 18. HyperLedger Fabric – Peer 18 2Source:http://hyperledger-fabric.readthedocs.io/en/release-1.0/fabric_model.html Blockchain Tx Tx Tx Tx Block Peer Query ledger history for a key, enabling data provenance scenarios. Peer CouchDB Read-only queries using a rich query language (if using CouchDB as state database) Transactions contain signatures of every endorsing peer and are submitted to ordering service. Peer Tx Peer Peers validate transactions against endorsement policies and enforce the policies. Endorsement Policies Peer Peers can have multiple Channels Peer Prior to appending a block, a versioning check is performed to ensure that states for assets that were read have not changed since Chaincode execution time. Tx $ docker run -it hyperledger/fabric-peer bash # peer chaincode --help01-02-2019
  • 19. HyperLedger Fabric – Peer CLI 01-02-2019 19 $ docker run -it hyperledger/fabric-peer bash # peer chaincode –help Usage: peer chaincode [command] Available Commands: install Package the specified chaincode into a deployment spec and save it on the peer's path. instantiate Deploy the specified chaincode to the network. invoke Invoke the specified chaincode. package Package the specified chaincode into a deployment spec. query Query using the specified chaincode. signpackage Sign the specified chaincode package upgrade Upgrade chaincode. 2 Source : http://hyperledger-fabric.readthedocs.io/en/release-1.0/chaincode4noah.html
  • 20. HyperLedgerFabric–PeerCLI 20 Flags: --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint -C, --chainID string The chain on which this command should be executed (default "testchainid") -c, --ctor string Constructor message for the chaincode in JSON format (default "{}") -E, --escc string The name of the endorsement system chaincode to be used for this chaincode -l, --lang string Language the chaincode is written in (default "golang") -n, --name string Name of the chaincode -o, --orderer string Ordering service endpoint -p, --path string Path to chaincode -P, --policy string The endorsement policy associated to this chaincode -t, --tid string Name of a custom ID generation algorithm (hashing and decoding) e.g. sha256base64 --tls Use TLS when communicating with the orderer endpoint -u, --username string Username for chaincode operations when security is enabled -v, --version string Version of the chaincode specified in install/instantiate/upgrade commands -V, --vscc string The name of the verification system chaincode to be used for this chaincode Global Flags: --logging-level string Default logging level and overrides, see core.yaml for full syntax --test.coverprofile string Done (default "coverage.cov") Use "peer chaincode [command] --help" for more information about a command. 2 Source : http://hyperledger-fabric.readthedocs.io/en/release-1.0/chaincode4noah.html01-02-2019
  • 21. HyperLedger Fabric - Orderer 01-02-2019 21 2 Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/kafka.html Node 2 Orderer Zookeeper Node 1 Node 2 Node 3 Broker 1 Broker 2 Broker n Broker .. Kafka Zookeeper Node 1 Orderer Node 3 Orderer Node 4 Orderer Ordering Service Client Defining Consensus is 3 Phase Process 1. Endorsement 2. Ordering 3. Validation ZooKeeper nodes 3,5,7 Service Type 1. Solo (Dev) 2. Kafka (Prod) 3. PBFT (Prod)* No Single Point of Failure for Orderer.
  • 22. HyperLedger Fabric Model – Assets / Chaincode 01-02-2019 22 2 o The exchange of almost anything with monetary value over the network, from whole foods to antique cars to currency futures. o Represented as a collection of key-value pairs, with state changes recorded as transactions on a Channel ledger. o Assets can be represented in binary and/or JSON form. Assets Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/fabric_model.html o It defines an asset or assets, and the transaction instructions for modifying the asset(s). Its the business logic. o It enforces the rules for reading or altering key value pairs or other state database information. o It execute against the ledger’s current state database & are initiated through a transaction proposal. o It’s execution results in a set of key value writes (write set) that can be submitted to the network and applied to the ledger on all peers. Chaincode / Smart Contract
  • 23. Fabric - Endorsement Policy 23 2 • Peer uses Endorsement policies to decide if the transaction is properly Endorsed. • Peer invokes VSCC (Validation System Chaincode) associated with transaction’s Chaincode • VSCC is tasked to do the following • All Endorsements are valid (Valid signatures from Valid Certificates) • There is an appropriate number of Endorsements. • Endorsement came from expected Source(s) Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/endorsement-policies.html Examples • Org1.admin • Org2.member • Org3.peer Roles (of the Signer) are supported 1. Member 2. Admin 3. Client 4. Peer 4 01-02-2019
  • 24. Fabric – Endorsement Policy Design 24Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/endorsement-policies.html Endorsement Policy has two Components P A Principal (P) identifies the entity whose signature is expected T A Threshold Gate <T> takes two inputs: • <t> an integer : threshold • [n] a list of : principals or gates 2 This Gate essentially captures the expectation that: • out of those [n] principals or gates, • <t> are requested to be satisfied T(2, ‘A’, ‘B’, ‘C’) Requests a signature from any 2 Principals out of A,B,C T(1, ‘A’, T(1, ‘B’, ‘C’)) Requests 1 signature from A or 1 from Principal B and C each. 01-02-2019
  • 25. Fabric - Endorsement Policy using CLI 25 2 Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/endorsement-policies.html Principals are described as MSP.ROLE Examples • Org1.admin • Org2.member • Org3.peer EXPR(E[, E...]) where EXPR is either AND or OR, representing the two Boolean expressions and E is either a principal (with the syntax described above) or another nested call to EXPR. For example: • AND ('Org1.member', 'Org2.member', 'Org3.member') requests 1 signature from each of the three principals • OR ('Org1.member', 'Org2.member') requests 1 signature from either one of the two principals • OR ('Org1.member', AND('Org2.member', 'Org3.member')) requests either one signature from a member of the Org1 MSP or 1 signature from a member of the Org2 MSP and 1 signature from a member of the Org3 MSP. Roles (of the Signer) are supported 1. Member 2. Admin 3. Client 4. Peer 4 The policy can be specified at instantiate time using the -P switch, followed by the policy. For example: $ peer chaincode instantiate -C <channelid> -n mycc -P "AND('Org1.member', 'Org2.member')" 01-02-2019
  • 26. HyperLedger Fabric Channels 01-02-2019 26 2 o A Hyperledger Fabric channel is a private “subnet” of communication between two or more specific network members, for the purpose of conducting private and confidential transactions. o Channel is a completely separate instance of HyperLedger Fabric. Every Channel is completely isolated and will never talk to each other. o To create a new channel, the client SDK calls configuration system Chaincode and references properties such as anchor peer**s, and members (organizations). This request creates a **genesis block for the channel ledger, which stores configuration information about the channel policies, members and anchor peers. o The consensus service orders transactions and delivers them, in a block, to each leading peer, which then distributes the block to its member peers, and across the channel, using the gossip protocol. Why Channel is unique to Fabric? Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/channels.html
  • 27. Gossip Protocol 01-02-2019 27 2 o Manages peer discovery and channel membership, by continually identifying available member peers, and eventually detecting peers that have gone offline. o Disseminates ledger data across all peers on a channel. Any peer with data that is out of sync with the rest of the channel identifies the missing blocks and syncs itself by copying the correct data. A state reconciliation process synchronizes world state across peers on each channel. Each peer continually pulls blocks from other peers on the channel, in order to repair its own state if discrepancies are identified o Bring newly connected peers up to speed by allowing peer-to-peer state transfer update of ledger data. Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/gossip.html
  • 28. Summary – HyperLedger Fabric Architecture 28 2 Orderer • Consensus verification • Creates Blocks CA • Registration of identities • Manage Certificates Peer • Endorses Tx • Simulates Tx • Commits Tx All these components can be clustered for scalability and to avoid Single Point of Failure 3 Components of Fabric Ledger Blockchain & World State Smart Contract • createCar • queryAllCars • queryCarProperties • changeCarColor • changeCarOwner Other Concepts • Endorsement Policies • Assets : Anything that’s valuable for the Organization • Transactions (State changes of Assets) • Gossip Protocol : The glue that keeps the peers in healthy state. Channels • Private subnet for a set of parties based on Smart contract • Ledger / Channel • Peers can have multiple Channels • Private Data 1 2 01-02-2019
  • 30. Ledger 01-02-2019 30Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html • Ledger L comprises blockchain B and World State W. • Blockchain B determines World State W. • Also expressed as: World state W is derived from blockchain B. 3
  • 31. Blockchain Structure 01-02-2019 31Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html In the above diagram, we can see that block B2 has a block data D2 which contains all its transactions: T5, T6, T7. Most importantly, B2 has a block header H2, which contains a cryptographic hash of all the transactions in D2 as well as with the equivalent hash from the previous block B1. In this way, blocks are inextricably and immutably linked to each other, which the term blockchain so neatly captures! 3
  • 32. Blockchain Blocks 01-02-2019 32 Block Header This section comprises three fields, written when a block is created. • Block number: An integer starting at 0 (the genesis block), and increased by 1 for every new block appended to the blockchain. • Current Block Hash: The hash of all the transactions contained in the current block. • Previous Block Hash: A copy of the hash from the previous block in the blockchain. Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/ledger/ledger.html 3
  • 35. Peers and Channels 01-02-2019 35 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
  • 36. Peers and Organizations 01-02-2019 36 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
  • 38. Blockchain Network 01-02-2019 38 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/network/network.html
  • 39. Blockchain Network 01-02-2019 39 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/network/network.html Four organizations, R1, R2, R3 and R4 have jointly decided, and written into an agreement, that they will set up and exploit a Hyperledger Fabric network. R4 has been assigned to be the network initiator – it has been given the power to set up the initial version of the network. R4 has no intention to perform business transactions on the network. • R1 and R2 have a need for a private communications within the overall network, as do R2 and R3. • Organization R1 has a client application that can perform business transactions within channel C1. • Organization R2 has a client application that can do similar work both in channel C1 and C2. • Organization R3 has a client application that can do this on channel C2. • Peer node P1 maintains a copy of the ledger L1 associated with C1. • Peer node P2 maintains a copy of the ledger L1 associated with C1 and a copy of ledger L2 associated with C2. • Peer node P3 maintains a copy of the ledger L2 associated with C2.
  • 40. Blockchain Network 01-02-2019 40 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/network/network.html • The channel C1 is under the control of organizations R1 and R2. • Channel C2 is governed according to the policy rules specified in channel configuration CC2; • the channel is under the control of organizations R2 and R3. • There is an ordering service O4 that services as a network administration point for N, and uses the system channel. • The ordering service also supports application channels C1 and C2, for the purposes of transaction ordering into blocks for distribution. • Each of the four organizations has a preferred Certificate Authority. • The network is governed according to policy rules specified in network configuration NC4, • the network is under the control of organizations R1 and R4. • Channel C1 is governed according to the policy rules specified in channel configuration CC1;
  • 41. Fabric : Transaction Flow 01-02-2019 41
  • 42. Fabric: Transaction Flow 42 3 Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/txflow.html 1 2 Customer wants to order Red Roses from Merchant for a new price. Scenario Customer Merchant Customer PeerBPeerA Tx Proposal • Endorsement Policy in the Chaincode states proposal must be accepted by all parties. • Proposal includes the function of the Chaincode that needs to be triggered and other params. • The SDK packages the transaction proposal into the properly architected format (protocol buffer over gRPC) and takes the user’s cryptographic credentials to produce a unique signature for this transaction proposal. Endorsing Peers 2.1 The Endorsing Peers : Verification 1. The transaction Proposal is well formed 2. It has not been submitted already in the past (replay attack protection) 3. The signature is valid using (MSP) and the 4. Submitter (Customer) is properly authorized to perform the proposed operation on the Channel. 01-02-2019
  • 43. Fabric: Transaction Flow 43 3 Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/txflow.html 2 2.2 The Endorsing Peers : Execute 1. The endorsing peers take the transaction proposal inputs as arguments to the invoked chaincode’s function It has not been submitted already in the past (replay attack protection) 2. The chaincode is then executed against the current state database to produce transaction results including a response value, read set, and write set. • No updates are made to the ledger at this point. Signed Proposal 3 Proposal Responses are inspected 1. App verifies the endorsing peer signatures. 2. Checks if the Endorsement policy is fulfilled (ie. Customer and the Merchant Peer both endorse the proposal). 01-02-2019
  • 44. 01-02-2019 44 Fabric: Transaction Flow3 Convert Endorsement to transaction 1. The App “broadcasts” the transaction proposal and response within a “transaction message” to the Ordering Service 2. The transaction will contain the read/write sets. The endorsement signatures and Channel ID. 3. The ordering service doesn't need to inspect the content of the transaction. 4. It receives transactions from all the channels from the network and orders them chronologically by the Channel and 5. Creates blocks of transactions per channel. 4 Ordering Service Channels
  • 45. 01-02-2019 45 Fabric: Transaction Flow3 Transaction Validated and Committed 1. The blocks of transactions are delivered to all Peers in the network based on the Channel ID. 2. Validate the transaction based on Endorsement policy. 3. Ensure that no change in the Ledger state based on the Read-set variables since the read-set was generated by the transaction execution. 4. Transactions in the block are tagged as being Valid or Invalid. 5 Ordering Service Peers
  • 46. 01-02-2019 46 Fabric: Transaction Flow3 6 Ledger Updated 1. Each Peer appends the Block to the Channels chain. 2. For Each VALID transactions the write-set is committed to the World State Database. 3. An Event is emitted to Notify the Client Application. 4. Transactions in the block are tagged as being Valid or Invalid. Block appended to Tx Chain Sends Notification
  • 47. 01-02-2019 47 Fabric: Transaction Flow Summary3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/peers/peers.html
  • 48. Fabric : Private Data 01-02-2019 48 HyperLedger Fabric v1.2 onwards
  • 49. Private Data 01-02-2019 49 3 Private Data 06/12/18 43 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/private-data/private-data.html
  • 50. Private Data – Use Case 01-02-2019 50 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/private-data/private-data.html • A Farmer selling his goods abroad • A Distributor moving goods abroad • A Shipper moving goods between parties • A Wholesaler purchasing goods from distributors • A Retailer purchasing goods from shippers and wholesalers
  • 51. Private Data – Transaction Flow 01-02-2019 51 3 Source: https://hyperledger-fabric.readthedocs.io/en/release-1.3/private-data/private-data.html 1. The client application submits a proposal request to invoke a chaincode. 2. The endorsing peers simulate the transaction and store the private data in a transient data store (a temporary storage local to the peer). They distribute the private data, based on the collection policy, to authorized peers via gossip protocol. 3. The endorsing peer sends the proposal response back to the client with public data, including a hash of the private data key and value. No private data is sent back to the client. 4. The client application submits the transaction to the ordering service (with hashes of the private data) which gets distributed into blocks as normal. The block with the hashed values is distributed to all the peers. 5. At block-committal time, authorized peers use the collection policy to determine if they are authorized to have access to the private data. If they do, they will first check their local transient data store to determine if they have already received the private data at chaincode endorsement time. If not, they will attempt to pull the private data from another peer. Then they will validate the private data against the hashes in the public block and commit the transaction and the block. Upon validation/commit, the private data is moved to their copy of the private state database and private writeset storage.
  • 52. Fabric : Getting Started 01-02-2019 52
  • 53. Fabric Example : Pre requisites – Fabric Network 01-02-2019 53 3 $ git clone -b master https://github.com/hyperledger/fabric-samples.git $ cd fabric-samples $ git checkout {TAG} Source: http://hyperledger-fabric.readthedocs.io/en/latest/samples.html To ensure the samples are compatible with the version of Fabric binaries you download below, checkout the samples {TAG} that matches your Fabric version, for example, v1.1.0. To see a list of all fabric-samples tags, use command “git tag”. $ curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0 Please execute the following command from within the directory into which you will extract the platform-specific binaries: If you get an error running the above curl command, you may have too old a version of curl that does not handle redirects or an unsupported environment. $ export PATH=<path to download location>/bin:$PATH The script lists out the Docker images installed upon conclusion.
  • 54. Fabric Example : Writing your First App 01-02-2019 54Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html We will show the process for interacting with a Certificate Authority and generating enrollment certificates, after which we will leverage these generated identities (user objects) to query and update a ledger. 1. Set up the Development Environment 2. Learn the parameters of Smart Contract 3. Develop Apps that can Query and Update the Ledger 3 Smart Contract Blockchain Network CAOrderer QueryExecute Smart Contracts Get Ledger Updates Ledger
  • 55. Fabric Example : Install the Fabcar Example 55 3 $ cd fabric-samples/fabcar && ls *.js enrollAdmin. js Invoke.js query.js registerUser.js You will see for Node JS Programs as follows Do a cleanup before u start installing the Sample App in the Ledger $ docker rm -f $(docker ps -aq) $ docker network prune $ docker rmi dev-peer0.org1.example.com-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba $ npm install $ ./startFabric.sh Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html01-02-2019
  • 56. Fabric Example : Enroll User 01-02-2019 56 3 Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html $ node enrollAdmin.js An admin user - admin - was registered with our Certificate Authority. Now we need to send an enroll call to the CA server and retrieve the enrollment certificate (eCert) for this user. This program will invoke a certificate signing request (CSR) and ultimately output an eCert and key material into a newly created folder - hfc-key-store - at the root of this project. $ node registerUser.js Newly generated admin eCert, we will now communicate with the CA server once more to register and enroll a new user. This user - user1 - will be the identity we use when querying and updating the ledger. Similar to the admin enrollment, this program invokes a CSR and outputs the keys and eCert into the hfc-key-store subdirectory. So now we have identity material for two separate users - admin & user1
  • 57. Fabric Example : Smart Contract Functions 01-02-2019 57 Smart Contract Chaincode (GoLang / NodeJS) Blockchain Network CAOrderer Ledger • createCar • queryAllCars • queryCarProperties • changeCarColor • changeCarOwner 3
  • 58. 01-02-2019 58 3 Chaincode Constructor Invoke(stub) method is called as result of an application request to the Chaincode Ledger Persistence Calls – Commands createCar(stub, args) changeCarOwner(stub, args)
  • 59. 01-02-2019 59 3 queryCar(stub, args) Ledger Persistence Calls – Queries queryAllCars(stub, args)
  • 60. Fabric Example : Query The Ledger 01-02-2019 60 3 $ node query.js Similar to the admin enrollment, this program invokes a CSR and outputs the keys and eCert into the hfc-key-store subdirectory. So now we have identity material for two separate users - admin & user1 Source: http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html Smart Contract Blockchain Network CAOrderer QueryRun the query Return Query Results Queries are how you read data from the ledger. This data is stored as a series of key-value pairs, and you can query for the value of a single key, multiple keys, or – if the ledger is written in a rich data storage format like JSON – perform complex searches against it (looking for all assets that contain certain keywords, for example) fabric_client.getUserContext('user1', true); Ledger
  • 61. HyperLedger Fabric – Node.JS Client API 61Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/write_first_app.html 1. Initialize the Client API 2. Create a Channel 3. Create a Peer 4. Add Peer to the Channel 3 Query ChainCode: fabcar Query Function: queryAllCars $ node query.js GetHistoryForKey() GetHistoryForKey() 01-02-2019
  • 62. HyperLedger Fabric – Node.JS Client API 01-02-2019 62 3 1. Get a Transaction ID based on the user assigned to the client. 2. Send Transaction Proposal for 3. createCar() function in the Chaincode creates a new transaction 4. changeCarOwner() function in the Chaincode updates the owner. Update function doesn't update the Blockchain instead it will have a new record with the latest status of the Asset. $ node invoke.js
  • 64. Ethereum Vs. HyperLedger Fabric Vs. R3 Corda 64 4 Characteristics Ethereum HyperLedger Fabric R3 Corda Description of the Platform Generic Blockchain Platform Modular Blockchain Platform Specialized distributed ledger platform for Financial Industry Release History July 2015 v0.6 Sept 2016, v1.0 July 2017, v1.3 2018 v-m0.0 May 2016, v1.0 Oct 2017, v3.0 Mar 2018 Crypto Currency Ether / Tokens (Usage, Work) via Smart Contract None Currency and Tokens via Chaincode None Governance Ethereum Developers Enterprise Ethereum Alliance Linux Foundation IBM R3 Consensus Mining based on Proof of Work (POW) – All participants need to agree. Ledger Level Selective Endorsement. Consensus can be even within a channel with select parties instead of everyone. Transaction Level Specific understanding of Consensus. (Validity, Uniqueness) Transaction Level Network Permissionless, Public or Private Permissioned, Private Permissioned, Private State Account Data Key-value Database Transaction Log, World State Vault contains States Historic & Current State Smart Contracts Solidity Chaincode (GoLang, Node.JS, Java) Smart Contract (Kotlin, Java) Development Languages GoLang, C++, Python Java, Node.JS, Python (Post 1.0) Java, Kotlin 01-02-2019
  • 65. Summary – Benefits of Blockchain Technologies 01-02-2019 65 4 Saves Time Immutable transaction across parties done at the same time. Remove Cost Overheads on maintaining and synchronizing silos. Increases Trust Through shared process and unified Systems of Record. For end consumers it’s a System of Proof. Reduces Risk Tampering of data, fraud and cyber crime is avoided.
  • 66. Disrupting the Media Value Chain 01-02-2019 66 Introduction of Blockchain will result in deprecation of critical roles/operations played by some of the Business Entities. 4
  • 67. Content Bypassing the Aggregators 67 Source: Deloitte : Blockchain @ Media Content Producer / Artist Aggregator Consumer Current Scenario Content Producer / Artist Distributed Ledger Consumer After Introduction of Blockchain Benefits • Direct Customer Artist relationship. • Easy to measure marketing and performance. Challenges • Content Aggregators and Advertising networks to loose their dominant position. • Blockchain has the potential to make DRMsystems obsolete or at least to reduce it’s complexity 4 01-02-2019
  • 68. Distribution of Royalty Payments 68 Artist Aggregator User Current Scenario Music Publisher Distributor Artist User After Introduction of Blockchain Distributed Ledger Distributor Source: Deloitte : Blockchain @ Media Benefits • Near Real-time distribution of Royalty payments based on Smart Contracts • Every usage and consumption is tracked in Blockchain Challenges • Handling large amount of Data • All the parties agreeing to common Blockchain Platform. 4 01-02-2019
  • 69. 01-02-2019 69 References Blockchain Video Tutorials • Blockchain Use Cases: https://wiki.hyperledger.org/groups/requirements/use-case-inventory • Hyperledger Fabric Explainer: https://www.youtube.com/watch?v=js3Zjxbo8TM • Blockchain Technology : https://www.youtube.com/watch?v=qOVAbKKSH10 • Smart Contracts : https://www.youtube.com/watch?v=ZE2HxTmxfrI • Hyperledger Fabric v1.1 Node.JS Chaincode : https://www.youtube.com/watch?v=dzwR0dwzXNs • Hyperledger Fabric v1.0 : https://www.youtube.com/watch?v=6nGIptzBZis • Hyperledger Fabric for Beginners : https://www.youtube.com/watch?v=Y177TCUc4g0 • Fabric Composer : https://www.youtube.com/watch?v=fdFUsrsv5iw • Hyperledger Composer : https://www.youtube.com/watch?v=iRlm4uY_9pA • How does it works: Blockchain : https://www.youtube.com/watch?v=lD9KAnkZUjU • How does Blockchain work: https://www.youtube.com/watch?v=LZEHOlZY2To • 19 Industries The Blockchain will disrupt : https://www.youtube.com/watch?v=G3psxs3gyf8 • What is the difference between Bitcoin & Blockchain? : https://www.youtube.com/watch?v=MKwa-BqnJDg • Bitcoin: What Bill Gates, Buffet, Elon Mush & Richard Branson has to say about Bitcoin? 4
  • 70. 70 1. HyperLedger Architecture Volume 1 2. Creating Tokens in Hyperledger Fabric : https://github.com/Kunstmaan/hyperleder-fabric-kuma-token-example/ 3. Karame, Androulaki, & Capkun. (2012). Double spending fast payments in bitcoin. ACM Conference on Computer and communications security, (pp. 906-917). 4. King, N. (2012). PPCoin: Peer to peer cryptocurrency with proof of stake. 5. Kwon. (2014). Tendermint: Consensus without Mining. Cornell Edu. 6. Mazieres, D. (2015). The Stellar Consensus Protocol: Federated Model for Internet level consensus. Stellar Development Foundation. 7. Narayanan, B. F. (2016). Bitcoin and cryptocurrency technologies. Princeton: Princeton University Press. 8. O'Dwyer, & Malone. (2014). Bitcoin mining and its energy footprint. Irish Signals and Systems Conference, pp. 280-285 9. Byzantine Fault Tolerance : https://en.wikipedia.org/wiki/Byzantine_fault_tolerance 10. Building Blockchain Apps for Node.JS developers with HyperLedger Composer – Simon Stone IBM References My Slide share Presentations 1. Enterprise Software Architecture – http://www.slideshare.net/arafkarsh/software-architecture-styles-64537120 2. Functional Reactive Programming – https://www.slideshare.net/arafkarsh/functional-reactive-programming-64780160 3. Microservices – Part 1: https://www.slideshare.net/arafkarsh/micro-services-architecture-80571009 4. Event Storming and Saga Design Pattern – Part 2 : https://www.slideshare.net/arafkarsh/event-storming-and-saga 5. Docker and Linux Containers : https://www.slideshare.net/arafkarsh/docker-container-linux-container 6. Function Point Analysis : http://www.slideshare.net/arafkarsh/functional-reactive-programming-64780160 4 01-02-2019
  • 71. 71 Araf Karsh Hamid : Co-Founder / CTO araf.karsh@metamagic.in USA: +1 (973) 969-2921 India: +91.999.545.8627 Skype / LinkedIn / Twitter / Slideshare : arafkarsh http://www.slideshare.net/arafkarsh https://www.linkedin.com/in/arafkarsh/ http://www.arafkarsh.com/ DREAM | AUTOMATE | EMPOWER 01-02-2019
  • 72. Transaction Proposal to Commit 01-02-2019 72 3

Editor's Notes

  1. MASA = Mesh App and Service Architecture
  2. http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#table-of-contents
  3. https://godoc.org/github.com/hyperledger/fabric https://github.com/hyperledger-archives/fabric/blob/master/docs/protocol-spec.md#3.4-Pluggable-Consensus-Framework https://docs.google.com/document/d/1vNMaM7XhOlu9tB_10dKnlrhy5d7b1u8lSY8a-kVjCO4/edit Multi Channel Consensus https://docs.google.com/document/d/1eRNxxQ0P8yp4Wh__Vi6ddaN_vhN2RQHP-IruHNUwyhc/edit https://github.com/hyperledger/fabric/blob/master/proposals/r1/Next-Consensus-Architecture-Proposal.md https://docs.confluent.io/current/zookeeper/deployment.html#multi-node-setup http://hyperledger-fabric.readthedocs.io/en/release-1.0/write_first_app.html https://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/ https://jobs.zalando.com/tech/blog/rock-solid-kafka/?gh_src=4n3gxh1
  4. For example: AND('Org1.member', 'Org2.member', 'Org3.member') requests 1 signature from each of the three principals OR('Org1.member', 'Org2.member') requests 1 signature from either one of the two principals OR('Org1.member', AND('Org2.member', 'Org3.member')) requests either one signature from a member of the Org1 MSP or 1 signature from a member of the Org2 MSP and 1 signature from a member of the Org3 MSP.
  5. https://gerrit.hyperledger.org/r/gitweb?p=fabric.git;a=blob;f=docs/endorsement-policies.md;h=1eecf359c12c3f7c1ddc63759a0b5f3141b07f13;hb=HEAD Endorsement policy syntax in the CLI In the CLI, a simple language is used to express policies in terms of boolean expressions over principals. A principal is described in terms of the MSP that is tasked to validate the identity of the signer and of the role that the signer has within that MSP. Four roles are supported: member, admin, client, and peer. Principals are described as MSP.ROLE, where MSP is the MSP ID that is required, and ROLE is one of the four strings member, admin, client and peer. Examples of valid principals are 'Org0.admin' (any administrator of the Org0 MSP) or 'Org1.member' (any member of the Org1 MSP), 'Org1.client' (any client of the Org1 MSP), and 'Org1.peer' (any peer of the Org1 MSP). The syntax of the language is: EXPR(E[, E...]) where EXPR is either AND or OR, representing the two boolean expressions and E is either a principal (with the syntax described above) or another nested call to EXPR. For example:AND('Org1.member', 'Org2.member', 'Org3.member') requests 1 signature from each of the three principals OR('Org1.member', 'Org2.member') requests 1 signature from either one of the two principals OR('Org1.member', AND('Org2.member', 'Org3.member')) requests either one signature from a member of the Org1 MSP or 1 signature from a member of the Org2 MSP and 1 signature from a member of the Org3 MSP.
  6. For example: AND('Org1.member', 'Org2.member', 'Org3.member') requests 1 signature from each of the three principals OR('Org1.member', 'Org2.member') requests 1 signature from either one of the two principals OR('Org1.member', AND('Org2.member', 'Org3.member')) requests either one signature from a member of the Org1 MSP or 1 signature from a member of the Org2 MSP and 1 signature from a member of the Org3 MSP.
  7. Source: http://hyperledger-fabric.readthedocs.io/en/release-1.0/Style-guides/go-style.html#generating-grpc-code
  8. https://docs.google.com/document/d/1vNMaM7XhOlu9tB_10dKnlrhy5d7b1u8lSY8a-kVjCO4/edit GetHistoryForKey()
  9. Hyperledger Fabric SDKs Hyperledger Fabric intends to offer a number of SDKs for a wide variety of programming languages. The first two delivered SDKs are the Node.js and Java SDKs. Python and Go SDKs soon after the 1.0.0 release. https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/j-chaincode-for-java-developers-pdf.pdf https://docs.corda.net/key-concepts-states.html http://explore-ip.com/2017_Comparison-of-Ethereum-Hyperledger-Corda.pdf
  10. https://www.hyperledger.org/wp-content/uploads/2017/08/Hyperledger_Arch_WG_Paper_1_Consensus.pdf https://github.com/Kunstmaan/hyperleder-fabric-kuma-token-example/