blockchain
play

BLOCKCHAIN Technology & Applications #apiconf2018 BLOCKCHAIN - PowerPoint PPT Presentation

edoardo conte BLOCKCHAIN Technology & Applications #apiconf2018 BLOCKCHAIN Technology & Applications edoardo conte BLOCKCHAIN Technology & Applications #apiconf2018 BLOCKCHAIN Technology & Applications edoardo conte The


  1. edoardo conte BLOCKCHAIN Technology & Applications #apiconf2018

  2. BLOCKCHAIN Technology & Applications edoardo conte BLOCKCHAIN Technology & Applications #apiconf2018

  3. BLOCKCHAIN Technology & Applications edoardo conte The Blockchain

  4. BLOCKCHAIN Technology & Applications edoardo conte Distributed System Normally, also Decentralized Distributed and decentralized

  5. BLOCKCHAIN Technology & Applications edoardo conte Possibility to Decentralized Everyone can join design and deploy and distributed and maintain the Smart Contracts systems blockchain Public Blockchains

  6. BLOCKCHAIN Technology & Applications edoardo conte Determine the current builder Necessary to maintain a unique sequence of blocks! Proof of Work Proof of Stake Consensus Algorithm

  7. BLOCKCHAIN Technology & Applications edoardo conte Proof of Work Proof of Stake Non-scalable algorithm Possibility to scale Great computational cost Costless algorithm Very complex to implement Complexity really low Consensus Algorithm

  8. BLOCKCHAIN Technology & Applications edoardo conte Read access link Write access link for the service for the service Secure data Blockchain Bridge Distributed Server with Client network through important data Blockchains accessing the accessing the service service

  9. BLOCKCHAIN Technology & Applications edoardo conte Not completely Different Standardized decentralized authorized entities encryption and work together to replication maintain a protocols common service Permissioned Blockchains

  10. BLOCKCHAIN Technology & Applications edoardo conte Full replication Chaincode a b of data (Smart Contracts) d State database in Customizable c consensus algorithm CouchDB or LevelDB • Crash Fault Tolerant • Byzantine Fault Tolerant Hyperledger Fabric

  11. BLOCKCHAIN Technology & Applications edoardo conte Peer Endorsing Endorsing Peer Peer Peer • Ordering service • Consensus algorithm Org1 Org2 CA 2 • Different organizations Peer • Scalability CA 1 Peer • Certificate authorities • Endorsing peers Orderer • Execution of chaincode Structure

  12. BLOCKCHAIN Technology & Applications edoardo conte Execute 1. Client sends a Client transaction request 2. Execution of Chaincode 3. Sending the results back Endorsing Peer Endorsing Peer Transaction Flow

  13. BLOCKCHAIN Technology & Applications edoardo conte Order 1. Results sent Client to the orderer 2. Ordering of transactions Endorsing Peer Orderer Endorsing Peer Transaction Flow

  14. BLOCKCHAIN Technology & Applications edoardo conte Peer Validate Peer 1. Validation of each block Client Peer 2. If positive, it goes in the ledger Endorsing Peer Orderer Endorsing Peer Transaction Flow

  15. BLOCKCHAIN Technology & Applications edoardo conte Peer Validate Peer 1. Validation of each block Client Peer 2. If positive, it goes in the ledger Endorsing Peer Orderer Endorsing Peer Transaction Flow

  16. BLOCKCHAIN Technology & Applications edoardo conte Framework over Fabric Modeling language Logic Access Control 1 2 3 • Definition of the • Permissions • Participant • Asset transaction logic on resources • Complex • Javascript code • Transaction conditioned rules • Event Hyperledger Composer

  17. BLOCKCHAIN Technology & Applications edoardo conte Model.cto /** * Definition of participants */ participant Person identified by username { o String username o String fullName o String email optional o String number optional } participant Manufacturer identified by makerId { o String makerId o String name }

  18. BLOCKCHAIN Technology & Applications edoardo conte Model.cto /** * Definition of assets */ asset Vehicle identified by vin { o String vin o VehicleDetails vehicleDetails --> Person owner }

  19. BLOCKCHAIN Technology & Applications edoardo conte Model.cto /** * Definition of transactions */ transaction ChangeOwner { --> Vehicle vehicle --> Person newOwner } transaction SellVehicle { o VehicleDetails vehicleDetails o String vin --> Person owner }

  20. BLOCKCHAIN Technology & Applications edoardo conte Logic.js /** * Sell vehicle transaction * @param {org.acme.vehicle.SellVehicle} arg * @transaction */ function onSellVehicle ( arg ) { }

  21. BLOCKCHAIN Technology & Applications edoardo conte Logic.js const namespace = 'org.acme.vehicle'; // Extracting argument values let vehicleDetails = arg.vehicleDetails; const vin = arg.vin; const owner = arg.owner; const manufacturer = getCurrentParticipant(); vehicleDetails.manufacturer = manufacturer;

  22. BLOCKCHAIN Technology & Applications edoardo conte Logic.js const factory = getFactory(); // Creating the vehicle let vehicle = factory.newResource(namespace, 'Vehicle', vin); vehicle.vehicleDetails = vehicleDetails; vehicle.owner = owner;

  23. BLOCKCHAIN Technology & Applications edoardo conte Logic.js // Updating the registry return getAssetRegistry(namespace + '.Vehicle ’ ) .then ( assetRegistry => { return assetRegistry.add(vehicle); }) Update

  24. BLOCKCHAIN Technology & Applications edoardo conte Logic.js // Updating the registry return getAssetRegistry(namespace + '.Vehicle ’ ) .then ( assetRegistry => { return assetRegistry.add(vehicle); }) Update

  25. BLOCKCHAIN Technology & Applications edoardo conte Permissions.acl rule ManufReadsVehicle { description : "Manuf may read a car only if he made it" participant (manuf): "org.acme.vehicle.Manufacturer" operation : READ resource (vehicle): "org.acme.vehicle.Vehicle" condition : ( manuf.getIdentifier() == vehicle.vehicleDetails.manufacturer.getIdentifier() ) action : ALLOW }

  26. BLOCKCHAIN Technology & Applications edoardo conte ORG1 ORG2 ORDERER 2 Peers 1 Peer Solo CA CA CouchDB CouchDB Network Set Up

  27. BLOCKCHAIN Technology & Applications edoardo conte Node 1 Node 2 Node 3 Node 4 Org 1 Org 2 Org 1 Peer Endorsing Peer Endorsing Peer CouchDB CouchDB CouchDB • API exposed by NodeJs Orderer • Composer SDK in NodeJs Org1 CA Org 2 CA SQL DB SQL DB NodeJs App NodeJs App Client • Each element is a Docker container • Docker Swarm to communicate

  28. BLOCKCHAIN Technology & Applications edoardo conte Opening connection const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection; module . exports = class Network { constructor ( cardName ) { this.cardName = cardName; this.connection = new BusinessNetworkConnection(); this.definition; this.namespace = 'org.acme.vehicle'; } async connect() { return this.definition = await this.connection.connect(this.cardName); } connection Blockchain

  29. BLOCKCHAIN Technology & Applications edoardo conte Submit Transaction const factory = this.definition.getFactory(); // Submit transaction const tx = factory.newTransaction(this.namespace, 'SellVehicle ’ ); tx.vehicleDetails = vehicleDetalils; tx.vin = vin; tx.owner = factory.newRelationship(this.namespace, 'Person', ownerId); return await this.connection.submitTransaction(tx); Blockchain

  30. BLOCKCHAIN Technology & Applications edoardo conte Submit Transaction const factory = this.definition.getFactory(); // Submit transaction const tx = factory.newTransaction(this.namespace, 'SellVehicle ’ ); tx.vehicleDetails = vehicleDetalils; tx.vin = vin; tx.owner = factory.newRelationship(this.namespace, 'Person', ownerId); return await this.connection.submitTransaction(tx); Blockchain

  31. BLOCKCHAIN Technology & Applications edoardo conte Repositories https://bitbucket.org/hugrave/composer-vehicle-network/ https://bitbucket.org/hugrave/blockchain_server/

  32. BLOCKCHAIN Technology & Applications edoardo conte Benchmark done with 1000 assets GET — > ~ 10 seconds PUT, DELETE — > ~ 100 SECONDS Improvement through Cloud deployment Not real-time applications Performance evaluation

  33. BLOCKCHAIN Technology & Applications edoardo conte Permissions in Hyperledger Composer Rich conditioned language BUT… The ledger remains in plain-text! /var/hyperledger/production/ledgersData/chains/chains/{channel_name}/ PRIVACY

  34. BLOCKCHAIN Technology & Applications edoardo conte DO NOT DESPAIR!

  35. BLOCKCHAIN Technology & Applications edoardo conte Peer 1 Peer 2 Peer 3 Channel 1 Channel 2 Channel 3 Fabric Channels

  36. BLOCKCHAIN Technology & Applications edoardo conte Peer 1 Peer 2 Peer 3 Channel 1 Channel 2 Channel 3 Channel 2 Channel 3 Peer3 joined channel 2 Peer 1 joined channel 3 Fabric Channels

  37. BLOCKCHAIN Technology & Applications edoardo conte Off-chain encryption decryption

  38. BLOCKCHAIN Technology & Applications edoardo conte D B Off-chain NodeJs Org1 encryption decryption Data inserted in the blockchain is encrypted Decryption is possible only with the keys Client1

  39. BLOCKCHAIN Technology & Applications edoardo conte D B Off-chain NodeJs Org1 encryption decryption Data inserted in the blockchain is encrypted Decryption is possible only with the keys Client1

  40. BLOCKCHAIN Technology & Applications edoardo conte D D B B Authorization is a secure keys exchange Off-chain NodeJs Org1 NodeJs Org2 encryption decryption Client1 Client2

Recommend


More recommend