Building Blockchain applications using Java
Using your existing Java skills to develop Blockchain applications
with the IBM Blockchain Platform and Hyperledger Fabric
V5.13, 4 October 2018
Simon Stone
2
Business networks, wealth and markets
• Business Networks benefit from connectivity
– Participants are customers, suppliers,
banks, partners
– Cross geography and regulatory boundary
• Wealth is generated by the flow of goods and
services across business network in transactions
and contracts
• Markets are central to this process:
– Public (fruit market, car auction), or
– Private (supply chain financing, bonds)
3
Transferring assets, building value
Anything that is capable of being owned or controlled to produce value, is an asset
Two fundamental
types of asset
Intangible assets
subdivide
Cash is also
an asset
• Tangible, e.g. a house
• Intangible, e.g. a mortgage
• Financial, e.g. bond
• Intellectual, e.g. patents
• Digital, e.g. music
• Has property of anonymity
4
Ledgers are key
Ledgers are THE system of record for a business.
Businesses will have multiple ledgers for the multiple
business networks in which they participate.
• Transaction: an asset transfer onto or off the ledger
– John gives a car to Anthony (simple)
• Contract: the conditions for a transaction to occur
– If Anthony pays John money, then car passes
from John to Anthony (simple)
– If car won't start, funds do not pass to John (as
decided by third party arbitrator) (more complex)
5
Problem
inefficient, expensive, vulnerable
Participant A’s records Participant B’s records Bank records
Insurer records Regulator records Auditor records
6
Blockchain
Participant A’s records Participant B’s records Bank records
Insurer records Regulator records Auditor records
Solution
A shared, replicated, permissioned ledger…
…with consensus, provenance, immutability and finality
7
Different types of blockchain
– The first blockchain application
– Defines a shadow-currency and its ledger
– Resource intensive
is an example of an
unpermissioned, public blockchain
• All blockchains aim to provide irrefutable proof that
a set of transactions occurred between participants
• Different types of blockchain exist:
• Blockchains for business are generally permissioned and private, and prioritize
– Identity over anonymity | Selective endorsement over proof of work | Assets over
cryptocurrency
8
Introducing the IBM Blockchain Platform
IBM Blockchain Platform is a fully integrated enterprise-
ready blockchain platform designed to accelerate the
development, governance, and operation of a multi-
institution business network
• Developer tools that will make use of Hyperledger
Fabric SDK, to quickly build your blockchain
application
• Hyperledger Fabric also provides the ledger, which
is managed through a set of intuitive operational
tools
• Governance tools for democratic management of the
business network
• Flexible deployment options, including a highly
secure and performant IBM Cloud environment
DeveloperTools
IBM Cloud
OperationalTools
GovernanceTools
Blockchain application
Hyperledger Fabric
9
Hyperledger: A Linux Foundation project
• IBM Blockchain Platform is underpinned
by technology from the Hyperledger
project
• Hyperledger is a collaborative effort
created to advance cross-industry
blockchain technologies for business
• Founded February 2016; now more than
270 member organizations
• Open source
Open standards
Open governance model
Source: https://www.hyperledger.org/members
Updated: 4 October 2018
Premier
Associate
Academia Associate
General
10
Distributed ledger
• An implementation of blockchain technology that is a
foundation for developing blockchain applications
• Emphasis on ledger, smart contracts, consensus,
confidentiality, resiliency and scalability.
• V1.2 released July 2018
– Includes significant confidentiality and service
discovery improvements
• IBM is one of the many contributing organizations
Fabric Explored
11
Blockchain
developer
Smart
Contract
submitsdevelops
develops
recorded
accesses
event
emits
emits
D
Ledger
‘get’, ‘put’, ‘delete’
Client
Application
SDK
!
!
World state
block
txn txn txn
Blockchain
Peer
event
How applications interact with the ledger
12
A demo of a blockchain application
• In this demo, you will see:
• A sample blockchain solution based around a
vehicle manufacturing business network.
• This solution includes a smart contract and a set
of applications for the different users and
businesses in the business network.
• You can try it yourself today here:
https://github.com/IBM-Blockchain/vehicle-manufacture
Mike
Arium Logistics
Employee
Debbie
VDA
Regulations
Administrator
Paul
Buyer/Owner
Tommen
Insurer
Vada
Police
Alex
Agency for Vehicle
Standards
B L O C K C H A I N
Tommen
Insurer
Vada
Police
Alex
Agency for Vehicle
Standards
Mike
Arium Logistics
Employee
Debbie
VDA
Regulations
Administrator
Paul
Buyer/Owner
B L O C K C H A I N
Tommen
Insurer
Vada
Police
Alex
Agency for Vehicle
Standards
Mike
Arium Logistics
Employee
Debbie
VDA
Regulations
Administrator
Paul
Buyer/Owner
Mobile
App
B L O C K C H A I N
Tommen
Insurer
Vada
Police
Alex
Agency for Vehicle
Standards
Mike
Arium Logistics
Employee
Debbie
VDA
Regulations
Administrator
Paul
Buyer/Owner
Mobile
App
Enterprise
Integration
Tools
ERP
IoT
B L O C K C H A I N
Tommen
Insurer
Vada
Police
Alex
Agency for Vehicle
Standards
Mike
Arium Logistics
Employee
Debbie
VDA
Regulations
Administrator
Paul
Buyer/Owner
Business
Rules
Analytics
Mobile
App
Enterprise
Integration
Tools
ERP
IoT
B L O C K C H A I N
18
Choice is key
• At IBM, we believe that choice is key when it
comes to the experience for blockchain
developers.
• The freedom to utilize your existing skills and your
programming language of choice:
– Develop smart contracts and applications
in Go, Java, and JavaScript
• The freedom to use your favorite editors, IDEs,
and tools to get the job done:
– Develop smart contracts and applications
in Visual Studio Code, Eclipse, Vim, etc
19
A code walkthrough for Java developers
• In this code walkthrough, you will see:
• A smart contract developed in Java, using Visual
Studio Code and the IBM Blockchain Platform
developer tools extension.
• An application developed in Java, using Eclipse.
• Everything you will see is available today, open
source software, and ready for you to try
yourselves.
Questions? Tweet us or go
to ibm.com/blockchain
@IBMBlockchain
IBM Blockchain
IBM Blockchain
Thank you
Simon Stone
© Copyright IBM Corporation 2018. 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.

Building blockchain applications using Java

  • 1.
    Building Blockchain applicationsusing Java Using your existing Java skills to develop Blockchain applications with the IBM Blockchain Platform and Hyperledger Fabric V5.13, 4 October 2018 Simon Stone
  • 2.
    2 Business networks, wealthand markets • Business Networks benefit from connectivity – Participants are customers, suppliers, banks, partners – Cross geography and regulatory boundary • Wealth is generated by the flow of goods and services across business network in transactions and contracts • Markets are central to this process: – Public (fruit market, car auction), or – Private (supply chain financing, bonds)
  • 3.
    3 Transferring assets, buildingvalue Anything that is capable of being owned or controlled to produce value, is an asset Two fundamental types of asset Intangible assets subdivide Cash is also an asset • Tangible, e.g. a house • Intangible, e.g. a mortgage • Financial, e.g. bond • Intellectual, e.g. patents • Digital, e.g. music • Has property of anonymity
  • 4.
    4 Ledgers are key Ledgersare THE system of record for a business. Businesses will have multiple ledgers for the multiple business networks in which they participate. • Transaction: an asset transfer onto or off the ledger – John gives a car to Anthony (simple) • Contract: the conditions for a transaction to occur – If Anthony pays John money, then car passes from John to Anthony (simple) – If car won't start, funds do not pass to John (as decided by third party arbitrator) (more complex)
  • 5.
    5 Problem inefficient, expensive, vulnerable ParticipantA’s records Participant B’s records Bank records Insurer records Regulator records Auditor records
  • 6.
    6 Blockchain Participant A’s recordsParticipant B’s records Bank records Insurer records Regulator records Auditor records Solution A shared, replicated, permissioned ledger… …with consensus, provenance, immutability and finality
  • 7.
    7 Different types ofblockchain – The first blockchain application – Defines a shadow-currency and its ledger – Resource intensive is an example of an unpermissioned, public blockchain • All blockchains aim to provide irrefutable proof that a set of transactions occurred between participants • Different types of blockchain exist: • Blockchains for business are generally permissioned and private, and prioritize – Identity over anonymity | Selective endorsement over proof of work | Assets over cryptocurrency
  • 8.
    8 Introducing the IBMBlockchain Platform IBM Blockchain Platform is a fully integrated enterprise- ready blockchain platform designed to accelerate the development, governance, and operation of a multi- institution business network • Developer tools that will make use of Hyperledger Fabric SDK, to quickly build your blockchain application • Hyperledger Fabric also provides the ledger, which is managed through a set of intuitive operational tools • Governance tools for democratic management of the business network • Flexible deployment options, including a highly secure and performant IBM Cloud environment DeveloperTools IBM Cloud OperationalTools GovernanceTools Blockchain application Hyperledger Fabric
  • 9.
    9 Hyperledger: A LinuxFoundation project • IBM Blockchain Platform is underpinned by technology from the Hyperledger project • Hyperledger is a collaborative effort created to advance cross-industry blockchain technologies for business • Founded February 2016; now more than 270 member organizations • Open source Open standards Open governance model Source: https://www.hyperledger.org/members Updated: 4 October 2018 Premier Associate Academia Associate General
  • 10.
    10 Distributed ledger • Animplementation of blockchain technology that is a foundation for developing blockchain applications • Emphasis on ledger, smart contracts, consensus, confidentiality, resiliency and scalability. • V1.2 released July 2018 – Includes significant confidentiality and service discovery improvements • IBM is one of the many contributing organizations Fabric Explored
  • 11.
  • 12.
    12 A demo ofa blockchain application • In this demo, you will see: • A sample blockchain solution based around a vehicle manufacturing business network. • This solution includes a smart contract and a set of applications for the different users and businesses in the business network. • You can try it yourself today here: https://github.com/IBM-Blockchain/vehicle-manufacture
  • 13.
  • 14.
    Tommen Insurer Vada Police Alex Agency for Vehicle Standards Mike AriumLogistics Employee Debbie VDA Regulations Administrator Paul Buyer/Owner B L O C K C H A I N
  • 15.
    Tommen Insurer Vada Police Alex Agency for Vehicle Standards Mike AriumLogistics Employee Debbie VDA Regulations Administrator Paul Buyer/Owner Mobile App B L O C K C H A I N
  • 16.
    Tommen Insurer Vada Police Alex Agency for Vehicle Standards Mike AriumLogistics Employee Debbie VDA Regulations Administrator Paul Buyer/Owner Mobile App Enterprise Integration Tools ERP IoT B L O C K C H A I N
  • 17.
    Tommen Insurer Vada Police Alex Agency for Vehicle Standards Mike AriumLogistics Employee Debbie VDA Regulations Administrator Paul Buyer/Owner Business Rules Analytics Mobile App Enterprise Integration Tools ERP IoT B L O C K C H A I N
  • 18.
    18 Choice is key •At IBM, we believe that choice is key when it comes to the experience for blockchain developers. • The freedom to utilize your existing skills and your programming language of choice: – Develop smart contracts and applications in Go, Java, and JavaScript • The freedom to use your favorite editors, IDEs, and tools to get the job done: – Develop smart contracts and applications in Visual Studio Code, Eclipse, Vim, etc
  • 19.
    19 A code walkthroughfor Java developers • In this code walkthrough, you will see: • A smart contract developed in Java, using Visual Studio Code and the IBM Blockchain Platform developer tools extension. • An application developed in Java, using Eclipse. • Everything you will see is available today, open source software, and ready for you to try yourselves.
  • 20.
    Questions? Tweet usor go to ibm.com/blockchain @IBMBlockchain IBM Blockchain IBM Blockchain Thank you Simon Stone
  • 21.
    © Copyright IBMCorporation 2018. 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.

Editor's Notes

  • #2 This is a high level introduction to blockchain concepts and business value. Presentations in the “Explained” series are: Blockchain Explained: High level introduction to blockchain for business IBM Blockchain Platform Explained: An introduction to the IBM Blockchain Platform Solutions Explained: Key IBM Blockchain solutions, and what makes a good use-case. Garages Explained: The IBM Blockchain Garages What’s New: Recent developments in blockchain and what’s coming Next Steps: How to proceed on a first project There is much hype around Blockchain. Most of this relates to the use of Blockchain to underpin the Bitcoin cryptocurrency. Whilst IBM are not interested in cryptocurrency, we are very interested in exploring the broader business application of blockchain technology. This is a transformational opportunity for many of our clients. IBM is a recognized leader in making blockchain real for business. We are helping many hundreds of clients on their blockchain journeys. This presentation is the first step! IBM has lots of educational material (signified by the breadcrumb trail at the top of this chart) and a well-defined engagement process that will help. We will take you through all of this later on in this presentation. The latest copy of this presentation can be found on the IBM intranet at https://ibm.box.com/v/BlockchainExplained. Feel free to distribute a PDF of this file to clients (https://ibm.box.com/v/BlockchainExplainedPDF) or point people at Slideshare (https://www.slideshare.net/MattLucas3/blockchain-explained-vNNN) where NNN is the version number without the ’.’.
  • #3 Business never operates in isolation. They are participants in a business network. Business Networks will connect customers, suppliers, banks and regulators and will cross geographical boundaries. WEALTH is generated as goods and services move across this network; this flow is referred to as a MARKET. Growth of wealth can be constrained if the network is heavily silo’d or inefficient.
  • #4 Ownership of assets pass across the network in return for payments, and governed by contracts. ASSETS can be tangible and intangible, We are most comfortable with tangible (Cars, Houses), INTANGIBLE assets – financial instruments most obvious, but don’t forget about intellectual assets like patents and growing digital assets (music, games, video, art).
  • #5 Ledgers are not new – they have been used for double entry book keeping since 10 November 1494 when Luca Pacioli (the Franciscan monk) published his work on double-entry book-keeping. Commercial usage of the term is for the "principal book of account" in a business house. THE system of record for recording asset transfer in and out of a business.
  • #6 This is the “BEFORE” picture representing the “status quo” for business networks. Each participant keeps their own ledger(s) which are updated to represent business transactions as they occur. This is EXPENSIVE due to duplication of effort and intermediaries adding margin for services. It is clearly INEFFICIENT, as the business conditions – the contract – is duplicated by every network participant It is also VULNERABLE because if a central system (e.g. Bank) is compromised due to an incidents this affects the whole business network. Incidents can include fraud, cyber attack or a simple mistake.
  • #7 The novel Blockchain architecture give participants the ability to share a ledger which is updated every time a transaction occurs through peer to peer replication. Cryptography is used to ensure that network participants see only the parts of the ledger that are relevant to them, and that transactions are secure, authenticated and verifiable. Blockchain also allows the contract for asset transfer to be embedded in the transaction database determining the conditions under which the transaction can occur. Network participants agree how transactions are verified through consensus or similar mechanisms. Government oversight, compliance & audit can be part of the same network. Participants SAME AS BEFORE – this is not a disintermediation play CONSENSUS– means all participants agree that a transaction is valid PROVENANCE– means participants know where the asset came from and how it’s ownership has changed over time IMMUTABILITY– means no participant can tamper with a transaction once it’s agreed. If a transaction was in error then a NEW transaction must be used to reverse the error, with both visible FINALITY– once a transaction is committed, it cannot be reversed, i.e. the data cannot be rolled back to the previous state. Businesses need near-real-time finality for transactions, not probabilistic finality as present on some blockchains like bitcoin. These characteristics together give businesses a “Single Source of Truth”, which means that there is ONE place to determine the ownership of an asset or the completion of a transaction. This is the role of the SHARED LEDGER.
  • #8 Blockchains are all about adding irrefutable PROOF to transactions. (Note that this is not the same as TRUST… people can choose to accept the proof or not; that’s a social debate beyond the scope of this discussion.) Blockchain technology enables the Bitcoin crypto currency and is best known for this usage. However, the shared ledger technology is separate & separable – applicable to a whole range of business challenges that cross all industries. The next chart goes into more detail on the requirements of blockchain for business and how these differ from public ledgers like Bitcoin.
  • #9 This is what the IBM Blockchain Platform is in a single chart. As the words at the top say, it is a fully integrated enterprise-ready blockchain platform designed to accelerate the development, governance, and operation of a multi-institution business network. This means it’s not just a hosting platform, but it aims to help with the entire lifecycle of a blockchain solution from inception through to deployment and beyond. The simplified architecture diagram on the right shows how the platform is put together. It’s built on the IBM Cloud platform, although other options are available - more on that later - and makes use of the Hyperledger Fabric run time. There are a set of tools for solution development built on Hyperledger Composer, as well as tools to allow clients to govern and operate blockchain business networks.
  • #10 t is important to correctly distinguish between the terms and projects here: Hyperledger is a trademark of the Linux Foundation and is the umbrella for a group of technologies designed to advance blockchain for business. Hyperledger Fabric is one framework that is underneath this umbrella. Contributors to Fabric include IBM, DTCC, Fujitsu and others. Other frameworks include Iroha and Sawtooth. IBM Blockchain is used to describe the breadth of technologies and services that are supplied uniquely by IBM (e.g. hosting on IBM Cloud). One of the key differentiators for Hyperledger is open governance. This means that there is no one controlling organisation that governs the direction of the project, and no lock-in to one particular vendor.
  • #11 Hyperledger Fabric is one of two Hyperledger projects that IBM is significantly investing in, although it is important to note that Fabric is NOT an IBM project. V1 was released on 11 July 2017 with developers representing 28 different organizations. V1.1 was released in March 2018; V1.2 in July 2018.
  • #12 A developer will create an application and smart contract (could be different developers) The application will invoke calls within the smart contract via an SDK Those calls are processed by the business logic within the smart contract - a ‘put’ or ‘delete’ command will go through consensus protocol selected and added to the blockchain - a ’get’ command can only read from the world state but is not recorded on the blockchain An application can access Block information via rest APIs such as get block height Note the use of ‘Delete’ here – delete can delete keys from the world state database, but not transactions from the blockchain, which we’ve established is immutable.
  • #13 Business never operates in isolation. They are participants in a business network. Business Networks will connect customers, suppliers, banks and regulators and will cross geographical boundaries. WEALTH is generated as goods and services move across this network; this flow is referred to as a MARKET. Growth of wealth can be constrained if the network is heavily silo’d or inefficient.
  • #14 So the business network in this scenario is based on an individual purchasing a car. We’re going to start you off as Paul, who’s an aspiring Arium Motors customer, on his phone. (hand over phone) Today he’s placing an order, which takes place on his phone
  • #15 So the business network in this scenario is based on an individual purchasing a car. We’re going to start you off as Paul, who’s an aspiring Arium Motors customer, on his phone. (hand over phone) Today he’s placing an order, which takes place on his phone
  • #16 So the business network in this scenario is based on an individual purchasing a car. We’re going to start you off as Paul, who’s an aspiring Arium Motors customer, on his phone. (hand over phone) Today he’s placing an order, which takes place on his phone
  • #17 So the business network in this scenario is based on an individual purchasing a car. We’re going to start you off as Paul, who’s an aspiring Arium Motors customer, on his phone. (hand over phone) Today he’s placing an order, which takes place on his phone
  • #18 So the business network in this scenario is based on an individual purchasing a car. We’re going to start you off as Paul, who’s an aspiring Arium Motors customer, on his phone. (hand over phone) Today he’s placing an order, which takes place on his phone
  • #19 Business never operates in isolation. They are participants in a business network. Business Networks will connect customers, suppliers, banks and regulators and will cross geographical boundaries. WEALTH is generated as goods and services move across this network; this flow is referred to as a MARKET. Growth of wealth can be constrained if the network is heavily silo’d or inefficient.
  • #20 Business never operates in isolation. They are participants in a business network. Business Networks will connect customers, suppliers, banks and regulators and will cross geographical boundaries. WEALTH is generated as goods and services move across this network; this flow is referred to as a MARKET. Growth of wealth can be constrained if the network is heavily silo’d or inefficient.