2. About
Dr Ketan Parmar
Twitter : @kpbird
LinkedIn: https://www.linkedin.com/in/kpbird/
Certification: SCJP, IBM Blockchain Essentials, IBM Blockchain Foundation Developer
6. Introduction
In December 2015, the Linux Foundation announced the creation of the Hyperledger Project
In February 2016, The founding members of the project were announced
In early 2016, the project began accepting proposals for incubation of codebases and other
technologies as core elements.
On 12 July 2017, the project announced its production-ready Hyperledger Fabric 1.0 and it
started to gain popularity
In July 2017, London Stock Exchange Group in a partnership with IBM announced that it will
create a Blockchain platform designed for digitally issuing shares of Italian companies.
Hyperledger Fabric will form the basis of the platform
In September 2017 The Royal Bank of Canada (RBC) have started using Hyperledger for its US -
Canada interbank settlements.
10. Hyperledger Blockchain Frameworks
Hyperledger Fabric: Intended as a foundation for developing applications or solutions with a
modular architecture, Hyperledger Fabric allows components, such as consensus and
membership services, to be plug-and-play.
Hyperledger Iroha: A business blockchain framework designed to be simple and easy to
incorporate into infrastructural projects requiring distributed ledger technology.
Hyperledger Sawtooth: A modular platform for building, deploying, and running distributed
ledgers. Hyperledger Sawtooth includes a novel consensus algorithm, Proof of Elapsed Time
(PoET), which targets large distributed validator populations with minimal resource
consumption.
11. Hyperledger Blockchain Frameworks
Hyperledger Burrow: A permissionable smart contract machine. The first of its kind when
released in December, 2014, Burrow provides a modular blockchain client with a permissioned
smart contract interpreter built in part to the specification of the Ethereum Virtual Machine
(EVM).
Hyperledger Indy: Tools, libraries, and reusable components for providing digital identities
rooted on blockchains or other distributed ledgers so that they are interoperable across
administrative domains, applications, and any other silo.
12. Hyperledger Blockchain Tools
Hyperledger Cello: Blockchain deployment tooling contributed by IBM. Baohua Yang and
Haitao Yue from IBM Research are committed part-time to developing and maintaining the
project.
Hyperledger Composer: Blockchain package management tooling contributed by IBM.
Composer is a user-facing rapid prototyping tooling, running on top of Hyperledger Fabric,
which allows the easy management of Assets (data stored on the blockchain), Participants
(identity management, or member services) and Transactions (Chaincode, or Smart Contracts
which operate on Assets on the behalf of a Participant). The resulting application can be
exported as a package (a BNA file) which may be executed on a Hyperledger Fabric instance,
with the support of a Node.js application (based on the Loopback application framework) and
provide a REST interface to external applications.
Hyperledger Explore: Blockchain analytics tooling contributed by IBM, Intel, and DTCC.
16. Hyperledger Fabric
● An implementation of blockchain technology that is intended as a foundation for
developing blockchain applications
● Key technical features:
○ A shared ledger and smart contracts implemented as “chaincode”
○ Privacy and permissioning through membership services
○ Modular architecture and flexible hosting options
17. Hyperledger Fabric Architecture
IDENTITY: Pluggable,
Membership, Privacy and
Auditability of transactions.
LEDGER | TRANSACTIONS:
Distributed transactional ledger
whose state is updated by
consensus of stakeholders
SMART-CONTRACT:
“Programmable Ledger”, provide
ability to run business logic
against the blockchain (aka
smart contract)
APIs, Events, SDKs:
Multi-language native SDKs
allow developers to write DLT
apps
18. Hyperledger Fabric
● Membership Service Provider (MSP)
● Shared Ledger
● Smart Contracts
● Privacy
● Consensus
● There are four main methods of finding consensus in a blockchain:
○ the practical byzantine fault tolerance algorithm (PBFT),
○ the proof-of-work algorithm(PoW)
○ the proof-of-stake algorithm (PoS)
○ the delegated proof-of-stake algorithm (DPoS).
21. Blockchain for business
Blockchain builds on basic business concepts
● Business Networks connect businesses
● Assets flow over business networks
● Transactions describe asset exchange
● Participants submit transactions
● Contracts define the rules for transactions
● The ledger is a log of transactions
22. Hyperledger Composer
Hyperledger Composer is a framework to accelerate the development of applications built on
top of Blockchain platforms:
1. Start from the business level; model network assets, participants, and transactions
2. Applications use business centric APIs to invoke transactions that create, delete, and
3. update assets and transfer them between participants
4. Assets, participants, and transactions are recorded in the world state in registries
5. Easily integrate Blockchain with existing business processes and systems of record
6. Emphasis on quick solution creation and business-centric vocabulary
23. Key development concepts
Model files describe the assets, participants, transactions, and events that exist in a business network
● Expressive modelling language includes relationships, arrays, and validation rules
● Data serialized as JSON, and is fully validated by the Hyperledger Composer runtime
Access control lists define rules for sharing and privacy
● Rules are automatically enforced by the Hyperledger Composer runtime
Transaction processor functions implement additional business requirements
● Standard JavaScript code executed on the Blockchain by the Hyperledger Composer runtime
A business network definition is the set of the above for a given business network.
26. Model File (.cto)
A Hyperledger Composer CTO file is composed of the following elements:
● A single namespace. All resource declarations within the file are implicitly in this
namespace.
● A set of resource definitions, encompassing assets, transactions, participants, and
events.
● Optional import declarations that import resources from other namespaces.
CTO Language:
https://hyperledger.github.io/composer/reference/cto_language.html
27. Transaction Processing File (.js)
Transaction processor functions are automatically invoked by the runtime when
transactions are submitted using the BusinessNetworkConnection API.
/**
* A transaction processor function description
* @param {org.example.sampleTransaction} parameter-name A human
description of the parameter
* @transaction
*/
Document:
https://hyperledger.github.io/composer/reference/js_scripts.html
28. Access Control Language (acl)
Hyperledger Composer differentiates between access control for resources within a
business network (business access control) and access control for network administrative
changes (network access control). Business access control and network access control are
both defined in the access control file (.acl) for a business network.
Network access control uses the system namespace, which is implicitly extended by all
resources in a business network; and grants or denies access to specific actions as defined
below, and is intended to allow for more nuanced access to certain network-level
operations.
Document:
https://hyperledger.github.io/composer/reference/acl_language.html
30. model.cto
/**
* Commodity trading network
*/
namespace org.acme.trading
asset Commodity identified by tradingSymbol {
o String tradingSymbol
o String description
o String mainExchange
o Double quantity
--> Trader owner
}
participant Trader identified by tradeId {
o String tradeId
o String firstName
o String lastName
}
transaction Trade {
--> Commodity commodity
--> Trader newOwner
}
event TradeNotification {
--> Commodity commodity
}
transaction RemoveHighQuantityCommodities {
}
event RemoveNotification {
--> Commodity commodity
}
31. logic.js
/**
* Track the trade of a commodity from one trader to another
* @param {org.acme.trading.Trade} trade - the trade to be processed
* @transaction
*/
function tradeCommodity(trade) {
// set the new owner of the commodity
trade.commodity.owner = trade.newOwner;
return getAssetRegistry('org.acme.trading.Commodity')
.then(function (assetRegistry) {
// emit a notification that a trade has occurred
var tradeNotification = getFactory().newEvent('org.acme.trading',
'TradeNotification');
tradeNotification.commodity = trade.commodity;
emit(tradeNotification);
// persist the state of the commodity
return assetRegistry.update(trade.commodity);
});
}
32. queries.qry
query selectCommodities {
description: "Select all commodities"
statement:
SELECT org.acme.trading.Commodity
}
query selectCommoditiesByExchange {
description: "Select all commodities based on their main exchange"
statement:
SELECT org.acme.trading.Commodity
WHERE (mainExchange==_$exchange)
}
query selectCommoditiesByOwner {
description: "Select all commodities based on their owner"
statement:
SELECT org.acme.trading.Commodity
WHERE (owner == _$owner)
}
33. permissions.acl
rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}
rule NetworkAdminSystem {
description: "Grant business network administrators full access to system resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}