TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Â
IBM Blockchain Platform Technical Introduction v1.1
1. IBM Blockchain Platform: Technical Introduction
Get started with using IBM Blockchain Platform
V1.1, 4 October 2019
IBM Blockchain Platform Technical Series
Architectural Good Practices
Modeling Blockchain Applications
Whatâs New in Technology
Using IBM Blockchain Platform
Technical Introduction
2. Hyperledger Fabric
Concepts
Understand the technology that underpins
IBM Blockchain Platform
IBM Blockchain Platform
Concepts
Technical overview of
IBM Blockchain Platform
Tools
IBM Blockchain Platform tools that
simplify development and operations
3. 4
Blockchain concepts
⢠Consider the business concepts that comprise blockchain solutions:
â Assets modeled as data structures
â Contracts modeled as algorithms
â Transactions modeled as invocations of algorithms
â Business Networks modeled as peer-to-peer networks
â Participants modeled as nodes on these networks
⢠IBM Blockchain Platform is based around Hyperledger Fabric
⢠We will now look at how Hyperledger Fabric exposes these
business concepts to the blockchain developer
⢠We will also look at the IBM Blockchain Platform tools that
help developers implement these concepts in a solution
4. Š 2018 IBM Corporation
5
A simple consensus example (1/4) â a puzzle!
⢠Situation: A presenter in a room with 100 people, 10 of whom are mathematicians!
⢠Problem: Answer the question: What is the square root of 49?
⢠Question: Can everyone agree on an answer?
You are here!
Or here!
But not here ;)
a puzzle
a process
a problem
a policy
P
M M M M M
M M M M M
A
A
A
A
P
M
audience
mathematician
presenter
attendant
5. Š 2018 IBM Corporation
6
A simple consensus example (2/4) â a process
Solution approach
1. The presenter asks every mathematician to calculate â49
2. Every mathematician writes their answer on a piece of paper, signs with their (digital) signature
3. The presenter collects every mathematician's signed response
4. The room attendants distribute copies of the signed answer to every member of the audience
5. Every audience member checks that every mathematician agrees the answer, or not!
6. Everyone is happy; there is consensus!
a puzzle
a process
a problem
a policy
P
M M M M M
M M M M M
A
A
A
6. Š 2018 IBM Corporation
7
A simple consensus example (3/4) â a problem
Issues
1. How many mathematicians should the presenter ask?
2. How many mathematicians need to agree for an answer to be correct?
3. What happens if the mathematics disagree on the answer, or the presenter selects a bad answer?
Ă Everyone needs to agree what constitutes a good answer
a puzzle
a process
a problem
a policy
P
M M M M M
M M M M M
A
A
A
7. Š 2018 IBM Corporation
8
A simple consensus example (4/4) â a policy
The importance of policy
1. The audience agrees a policy for good answers
2. Example policies:
â all mathematicians must agree
â the majority of mathematicians must agree
Ă Using this policy everyone can now agree what makes a good answer
a puzzle
a process
a problem
a policy
P
M M M M M
M M M M M
A
A
A
9. Š 2018 IBM Corporation
10
Hyperledger Fabric multi-party transactions
⢠A transaction describes a change to a system
Examples:
â a change in bank balance
â a student receives an academic qualification
â a parcel is delivered
⢠Traditionally transactions are signed by a single organization
â a bank signs payment transactions
â a university signs graduation transactions
â a logistics company signs parcel receipt transactions
⢠Multi-party transactions are the heart of Hyperledger Fabric
â e.g. buyer and seller sign car transfer transaction
â e.g. logistics and delivery companies both sign parcel transaction
⢠Understand multi-party transactions and you will understand Fabric!
car transfer transaction:
identifier: 1234567890
proposal:
input: {CAR1, seller, buyer}
signature: input*seller
response:
output:
{CAR1.oldOwner=seller,
CAR1.newOwner=buyer}
signatures:
output signed by seller
output signed by buyer
A transaction to transfer a car is signed by
both the buyer and the seller
10. Š 2018 IBM Corporation
11
A Hyperledger Fabric network
⢠A Hyperledger Fabric network comprises a set of nodes
⢠The most common type of node is a peer. Every peer hosts an instance of a ledger
⢠The network is decentralized; peer nodes are owned by different organizations
ORG 4
ORG 3
ORG 1
ORG 2
P7
P8
P9P4
P1
P2
P5
P6
P3
11. Š 2018 IBM Corporation
12
Applications can query the ledger
⢠Querying the ledger is the simplest operation an application can perform!
⢠Applications can query any peer's ledger to determine the value of an object â every instance is the same!
⢠Applications typically query their own organization's peers
A1
ORG 2
P7
P8
P9P3 P4
P1
P2
P5
P6
ORG 4
ORG 3
ORG 1
A2
A3A4
12. Š 2018 IBM Corporation
13
Applications submit transactions to the network
⢠Applications use smart contracts hosted on endorsing peers to create multi-party transactions
⢠Orderers group endorsed transactions into blocks which are distributed to every node
⢠Every node validates every transaction using the smart contract's endorsement policy
A1
S P
Every smart contract
has an endorsement
policy which defines the
organizations required
to sign its transactions
P1
S
ORG 1
P7
P8
P9P3 P4
P2
P6
ORG 2
P5
S
O1 O2 O3
TXN:1234
Signed:
ORG1
ORG2
1234
1234
1234
1234
1234
1234
1234
1234
1234
13. Š 2018 IBM Corporation
14
The importance of identity
⢠Every actor has an associated X.509 identity issued by its organization's Certificate Authority
⢠A peer, orderer, application, organization, CA uses its identity to determine its organizational role
⢠This role determines the level of access an actor has to network resources, e.g. read/write the ledger
ORG 4
CA3
ORG 3
CA4
ORG 2CA2
P5
P6O2
A2
P7
P8
P9
O3 A2
P4
P3
A4
P1
P2
A1
ORG 1 CA1
O1
14. Š 2018 IBM Corporation
15
Managing decentralized networks with policy
⢠Organizations in a consortium agree to form a network using a set of policies
⢠A network's policies encode each organization's rights, like a constitution
Examples:
â Every organization has the same authority over the network
â All organizations must agree any change to the network
â A majority of organizations must agree any change to the network
â A majority of organizations including particular organization must agree a change
⢠Hyperledger Fabric identity and policy â model the real world relationships between organizations
!
totality majority
approved
majority
transition between constitutions
with agreement
15. Š 2018 IBM Corporation
16
Programming smart contracts
⢠A smart contract governs the lifecycle of an object. e.g. createCar, queryCar, updateCar, scrapCar...
⢠Implemented as a class; method contains relevant transaction logic in JavaScript, TypeScript, Java & Go*
⢠Installed on relevant organizations' peer(s). Execution results in digitally signed transaction response.
@Contract(name="org.papernet.commercialpaper")
@Default
class CommercialPaper implements ContractInterface {
public Context createContext(ChaincodeStub stub) {
return new CommercialPaperContext(stub);
}
@Transaction
public CommercialPaper issue(
CommercialPaperContext ctx,
String issuer,
String value,
String date,
int faceValue) {
// Interact with the ledger
getState(existingPaper);
putState(newPaper);
...
* Go under development
16. Š 2018 IBM Corporation
17
Submitting transactions and querying the ledger
Path walletPath = Paths.get("wallet");
Wallet wallet = Wallet.createFileSystemWallet(walletPath); // Access file wallet
Path networkConfigPath = Paths.get("..", "..", "paper-network", "connection.json");
// Identify a network using a CCP
Gateway.Builder builder = Gateway.createBuilder(); // Create gateway to the network
builder.commitHandler(DefaultCommitHandlers.MSPID_SCOPE_ANYFORTX); // One peer from my organization to reply
builder.identity(wallet, "admin").networkConfig(networkConfigPath);
try (Gateway gateway = builder.connect()) { // connect to the gateway
Network network = gateway.getNetwork("market1234"); // get the network
Contract contract = network.getContract("commercial-paper"); // get contract in network
String paper = contract.submitTransaction("issue", "IBM", "1000000", "2019-10-31")
// issue paper by IBM
contract.submitTransaction("move", paper, "ACME", "900000")) // sell paper to ACME
} catch (Exception ex) {
ex.printStackTrace();
}
⢠SDK provides wallet, identity, gateway, network, contract classes to access smart contract
⢠Ledger query: contract.evaluateTransaction(); update: contract.submitTransaction()
⢠Consensus managed transparently by SDK. Applications focus on WHAT not HOW.
⢠gatewayOptions parameterize popular interactions. e.g. wait for any/all peers in my organization to confirm
20. 21
Interacting with smart contracts and the ledger
⢠submitTransaction()
â Adds a fully signed new transaction to the ledger
â SDK manages entire multi-peer, ordering process
â Returns control when E/O/V complete (default)
⢠evaluateTransaction()
â Executes a transaction, but doesn't order it
â Typically used to query the ledger
â Only needs to interact with one peer
(pluggable handlers can be used for multi-peer query)
MagnetoCorp DigiBank
user
App channel: bond
Peer9
DigiBank
bonds
contract
ledger
Peer1
MagnetoCorp
bonds
contract
ledger
Orderer
1
MagnetoCorp
Orderer
2
DigiBank
Ordering service
Peer3
MagnetoCorp
ledger
Peer8
DigiBank
ledger
Peer2
MagnetoCorp
ledger
Peer7
DigiBank
ledger
bonds.submitTransaction('sell',
'BOND007');
bonds.evaluateTransaction('queryBond',
'BOND007');
1a 1b
1c1d
1e 1f
1
1
2
2a
2
21. 22
Ledger notification interactions
⢠Three listener types:
â contract.addContractListener()
⢠wait for all transactions of given contract
â contract.addBlockListener()
⢠wait for blocks
â transaction.addTransactionListener()
⢠wait for specific transaction to be committed
const transaction = contract.createTransaction('sell');
transaction.addCommitListener(`${transactionId}-listener`, (err, txId, status, blockHeight) => {
...
if (status === âVALIDâ) {
console.info(âTransaction committedâ);
} else {
...
}, {checkpointer: false});
await transaction.submit('ibm', '1000000', '2019-03-31â);
MagnetoCorp DigiBank
issuer
App channel: papernet
Peer9
DigiBank
paper
contract
ledger
Peer1
MagnetoCorp
paper
contract
ledger
Orderer
1
MagnetoCorp
Orderer
2
DigiBank
Ordering service
Peer3
MagnetoCorp
ledger
Peer8
DigiBank
ledger
Peer2
MagnetoCorp
ledger
Peer7
DigiBank
ledger
1b
1a
1c
APIs under development in
FABN-1100, slated 2.0
22. 23
Customizing behavior with
connectionOptions
⢠connectionOptions specifies gateway behaviour
â wallet: & identity: must be set by app
â All other options have sensible defaults
⢠Strategies codify most popular behaviour
â e.g. "wait for any/all peers in my organization"
⢠EventStrategies.MSPID_SCOPE_ANYFORTX
⢠EventStrategies.MSPID_SCOPE_ALLFORTX
⢠Handlers for programmable interactions
â User function gets control at appropriate point in transaction lifecycle with relevant topology, i.e.
peers
⢠e.g. startListening(), waitForEvents(), cancelListening()...
â Keeps separate from application business logic. Advanced feature; only required for special
scenarios
Gateway
âtransferâ
application
Connection
options
Peer6
DealerCorp
channel: drivenet
ManCorp DealerCorp
Peer2
ManCorp
Peer7
DealerCorp
Isabella
Peer1
ManCorp
Peer3
ManCorp
ledger ledger ledger
ledger ledger
23. Hyperledger Fabric
Concepts
Understand the technology that underpins
IBM Blockchain Platform
IBM Blockchain Platform
Concepts
Technical overview of
IBM Blockchain Platform
Tools
IBM Blockchain Platform tools that
simplify development and operations
24. 25
IBM Blockchain Platform is a key part of IBMâs
Blockchain Strategy
Solutions
Services
Ecosystem
IBM Blockchain Platform
Collaborate
with services
teams from
ideation all the
way to
production
Tap into our diverse ecosystem to develop strategic
partnerships and create your competitive advantage
Solve critical industry challenges by building and
joining new business networks and applications
Build, operate and grow blockchain
networks in heterogeneous environments
A founding, premier member of Hyperledger, IBM is
committed to open source, standards & governance
25. 26
Advanced tooling
Create & manage smart contracts,
applications & networks
Open technology
Hyperledger Fabric,
Containers, Kubernetes
Deploy anywhere
Comprehensive cloud &
on-premises options
Introducing IBM Blockchain Platform
Build, operate and grow Hyperledger Fabric networks
Developer
tools
Operator
tools
kubernetes
Kubernetes
on
prem
IBM
Kubernetes
Service
Container virtualization &
orchestration
Multi-cloud deployment
kubernetes
26. 27
IBM Blockchain Platform Deployment Options
⢠There is just one IBM Blockchain Platform product
regardless of where it is deployed
â It sits on a Kubernetes container infrastructure on
your chosen provider
â Kubernetes provides common logging and
management services of the IBM Blockchain
Platform
⢠When run on IBM Cloud, the IBM Blockchain Platform
uses the IBM Cloud Kubernetes Service
â Use the free IBM Kubernetes tier for a free IBM
Blockchain Platform, or a paid IBM Kubernetes
tier for a paid IBM Blockchain Platform; free tiers
expire after 30 days
⢠When deployed on-premises or on any non-IBM cloud,
IBM Blockchain Platform uses Red Hat Openshift 3.11
â You provide your OpenShift instance
Developer
tools
Operator
tools
kubernetes
Kubernetes
on
prem
IBM
Kubernetes
Service
Container virtualization &
orchestration
Multi-cloud deployment
kubernetes
27. Hyperledger Fabric
Concepts
Understand the technology that underpins
IBM Blockchain Platform
IBM Blockchain Platform
Concepts
Technical overview of
IBM Blockchain Platform
Tools
IBM Blockchain Platform tools that
simplify development and operations
28. Š 2019 IBM Corporation
29
Getting Started with Hyperledger Fabric
⢠The IBM Blockchain Platform makes it easy to get started with Hyperledger Fabric
⢠Download VSCode developer tool from VSCode marketplace. Linux, Windows and MacOS)
⢠Create local networks, smart contracts and applications. Move to multi-cloud when you're ready!
https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform
29. 30
IBM Blockchain Platform Admin Console
⢠Multi-cloud administration tool
â Web UI to manage all IBP
components
⢠Configure infrastructure on IBM Cloud
â Configure IKS network, storage,
compute
⢠Connect & Manage components
â Peer, Orderer, CA, channel...
⢠Policy & Identity management
â Create, update, display channel
policies
⢠Smart contract package management
â Install, instantiate, upgrade, discover
30. 31
On IBM Cloud, your blockchain components are
deployed to an IBM Kubernetes service
⢠Blockchain resources are deployed
into your own Kubernetes cluster
⢠This allows you to maintain control
over your resources (CPU, storage,
memory)
⢠Scale up or down as required for your
blockchain environment
⢠Start small, pay as you grow for what
you use with no upfront investment
⢠Maintain control of private keys
31. 32
⢠The IBM Kubernetes Service
within IBM Cloud has a free cluster
and a paid cluster.
⢠Pick the cluster that works for you!
Selecting your Kubernetes cluster
32. 33
⢠Intuitive console lets you manage network
components in one place, no matter where they
are deployed
⢠Manage nodes running in any environment (on-
premises, public, hybrid clouds)
⢠Easily connect a single peer to multiple industry
networks
⢠Deploy only the blockchain components you need
(Peer, Ordering Service, Certificate Authority)
⢠Different organizations can be hosted by different
consortium members in different clusters in
different geographies (zones)
Flexible deployment
33. 34
⢠It is possible to use your own
certificates for peers and orderers
Adding your own certificates
34. 35
⢠When using the paid
cluster, operational tools
will allow you to scale up or
down.
⢠Peers, orderers, and
certificate authorities can
be managed to balance
cost and performance.
https://www.ibm.com/blogs/blockchain/2019/01/answering-your-questions-on-hyperledger-fabric-performance-and-scale
Scaling up and down
35. 36
⢠Easily invite or add
members to the consortium
without having to learn
fabric commands
Governance: Managing the Orderer
36. 37
⢠Governing a consortium network takes
work, but operational tools make it easier
⢠Examples:
⢠Update members
⢠Update roles (who can read, who
can write)
⢠Update ACLs (who can perform
specific operations within the
smart contract)
⢠Update channel policy (who needs
to approve updates to the channel)
Governance: Managing channels
37. 38
⢠Set up endorsement policy
on smart contracts
Governance: Endorsement policies
42. 43
⢠Get Metrics information for IKS
using Grafana or Sysdig
Logging and monitoring
43. Your Blockchain Service Your Infrastructure Resources
IBM Blockchain Platform
The instance that lets you deploy and manage your
Hyperledger Fabric nodes.
Learn more: https://cloud.ibm.com/docs/containers?topic=containers-ibm-cloud-kubernetes-service-technology
Operational Console (UI)
Hyperledger Fabric Components
Certificate
Authority
Peer Ordering Service
Peer Couch
GRPC-
Web
Chaincode
CA
Orderer
Containers
IBP VS Code extension (Development Tools)
FluentdInit
Init
Init
GRPC-
Web
Deployment Overview: IBP & IKS & Storage
44. Your Blockchain Service Your Infrastructure Resources
IBM Blockchain Platform
The instance that lets you deploy and manage your
Hyperledger Fabric nodes.
IBM Cloud Kubernetes Service
Your compute and memory that you allocate to your blockchain
instance
Cluster (e.g. 2CPU x 4GB RAM)
Worker Node
Pod
App (Containers)
Learn more: https://cloud.ibm.com/docs/containers?topic=containers-ibm-cloud-kubernetes-service-technology
Persistent Storage
Operational Console (UI)
Hyperledger Fabric Components
Certificate
Authority
Peer Ordering Service
Peer Couch
GRPC-
Web
Chaincode
CA
Orderer
Containers
File Storage (Default)
IBP VS Code extension (Development Tools)
FluentdInit
Init
Init
GRPC-
Web
Deployment Overview: IBP & IKS & Storage
45. Your Blockchain Service Your Infrastructure Resources
IBM Blockchain Platform
The instance that lets you deploy and manage your
Hyperledger Fabric nodes.
IBM Cloud Kubernetes Service
Your compute and memory that you allocate to your blockchain
instance
Cluster (e.g. 2CPU x 4GB RAM)
Worker Node
Pod
App (Containers)
Learn more: https://cloud.ibm.com/docs/containers?topic=containers-ibm-cloud-kubernetes-service-technology
Persistent Storage
Operational Console (UI)
Hyperledger Fabric Components
Certificate
Authority
Peer Ordering Service
Peer Couch
GRPC-
Web
Chaincode
CA
Orderer
Containers
CPU & Memory
Storage
File Storage (Default)
IBP VS Code extension (Development Tools)
Containers for
each component
are within the
Kubernetes Pod
and can be
managed as
standalone items
Each Fabric
component is
deployed into an
individual Pod
FluentdInit
Init
Init
GRPC-
Web
1 2 3
1 2 3
Deployment Overview: IBP & IKS & Storage
46. 47
Summary
⢠The Hyperledger Fabric transaction
â Structure drives system design and application architecture
⢠Smart contract
â Contains transaction definitions for entire lifecycle of business
object(s) stored in a decentralized ledger
â built-in contract class makes programming easy
⢠Application
â Consensus is complex, but the SDK makes it easy for
applications
â submitTransaction(), evaluateTransaction(), addListener()
â gateway connectionOptions for ultimate customizability
⢠The IBM Blockchain Platform difference
â Multi-cloud networks, developer & operator tools, IBM service and
support
47. Thank you
www.ibm.com/blockchain
developer.ibm.com/blockchain
www.hyperledger.org
Š Copyright IBM Corporation 2019. All rights reserved. The information contained in these
materials is provided for informational purposes only, and is provided AS IS without warranty
of any kind, express or implied. Any statement of direction represents IBM's current intent, is
subject to change or withdrawal, and represents only goals and objectives. IBM, the IBM
logo, and other IBM products and services are trademarks of the International Business
Machines Corporation, in the United States, other countries or both. Other company, product,
or service names may be trademarks or service marks of others.