Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Blockchain for Developers - What's behind the hype

Blockchain for Developers - What's behind the hype

International JavaScript/PHP Conference - Munich

Ingo Rammer

October 17, 2018
Tweet

More Decks by Ingo Rammer

Other Decks in Programming

Transcript

  1. Co-Founder and CEO of Thinktecture AG, a 20 people, very

    technical consulting company helping developers, architects and technical decision makers use ever-changing cutting edge dev technologies. My focus: DLT/blockchain technologies for B2B use cases; from deep down in code up to ISO TC 307 Member of Hyperledger Foundation & Enterprise Ethereum Alliance @ingorammer | [email protected] | https://thinktecture.com Ingo Rammer
  2. Telco A Telco B 0151-123 123 123 John Doe 1/1/1960

    0151-123 123 123 John Doe 1/1/1960 Fax, email, letter, ... SMS, email, letter, ...
  3. Telco A Telco B 0151-123 123 123 John Doe 1/1/1960

    0151-123 123 123 John Doe 1/1/1960 Fax, email, letter, ... SMS, email, letter, ... Well, for us everything seems ok. Please ask the others. ? Well, for us everything seems ok. Please ask the others.
  4. • 3,437 registered telecom companies • 31% of all requests

    at regulator (19,000 cases, 3,000 escalations) • 300,000 EUR fines in 2016 Source: Yearly report 2016 of German network regulator, page 62 ff. (https://goo.gl/cPQcXV) Size of the problem (in Germany)
  5. • Independent actors • Varying levels of trust between actors

    • Need for transparency (for example by trusted replica sets of data) • Without introducing central authorities Our Scenario
  6. "A blockchain [...] is a continuously growing list of records,

    called blocks, which are linked and secured using cryptography. Each block typically contains a cryptographic hash of the previous block, a timestamp and transaction data" Wikipedia, March 26, 2018 Blockchain – What is this?
  7. Blockchain Genesis Block Block 1 Random Content Genesis Hash Content

    Genesis Hash Block 1 Hash Block 2 Content Block 1 Hash Block 2 Hash Block 3 Content Block 2 Hash Block 3 Hash Config
  8. Node 1 Peer-to-Peer Replication Genesis Block Block 1 Block 2

    Block 3 Node 2 Genesis Block Block 1 Block 2 Block 3 Node n Genesis Block Block 1 Block 2 Block 3 Block 4 Block 4 Block 4 Block 5 Block 5 Block 5
  9. Node 1 Nodes are independent, without central authority Node 2

    Node 3 Node 4 Node 5 Node 6 Node 7 Node 8 Node 9
  10. Two main models of operation Public blockchains Ethereum, Bitcoin, ...

    Private blockchains Telco E Telco C Telco A Telco F Telco G Telco B Telco D BNA Telco X Consortiums, governments, ... ? ! Telco X
  11. Public Blockchains • Identities of participants are unknown • Therefore:

    mining to secure the network's integrity (proof-of-work, Nakamoto consensus) • Typically, all data is public • Low transaction counts: <= 20 per seconds globally (Bitcoin, Ethereum)
  12. Private Blockchains • Participants are known, access protected • Therefore:

    No mining necessary (proof-of-authority instead of proof-of-Work) E C A F G B D BNA X G #1 #2 #3 G #1 #2 #3 G #1 #2 #3 #4 • Transactions can be public or private (direct point-to-point exchange between two participants) • Massively higher transaction counts (hundreds, thousands or tens of thousand per second) • Technologies f.e. Hyperledger Fabric (also IBM, SAP, Oracle), Quorum, ...
  13. AWS for Telco B Infura DC Telco Z Azure Azure

    (VM Telco C) DC Telco A Client (Telco A) Client (Telco X) Client (Telco Y) Client (Telco Z) Node 1 Node 2 Node 3 (Telco A) Node 4 (Infura) Node 5 Node 6 (Telco B) Node 7 (Telco C) Client (Telco B) DC Telco C Client (Telco C) Client – has private key Node is part of BC Connection to trusted node (HTTPs, Web Sockets, IPC, ...)
  14. • Signed statements, which are immutable and can't be deleted

    ("transactions") What's in a Block? In practice: machine readable, for example as transaction records Our verified customer John Doe, born on 1/1/1911 wants to transfer his phone number 0151-123 123 123 from Telco A to us Signed: Telco B We're ok with this transfer Signed: Telco A
  15. • Transactions are recorded in definitive sequence Properties of Transactions

    Block 1 Tx #1 Tx #2 Tx #3 Block 2 Tx #4 Tx #5 Block 3 Tx #6 Tx #7 Tx #8 Block 4 Tx #9 Block 5 Tx #10 ...
  16. • Parts of transactions can be encrypted Properties of Transactions

    {"tx":"requestTransfer", "phone":"0151-123123123", owner: "TelcoA", encryptedCustomerData: "0xe2cbcf5f890afabc4dbd236d19f949db 05fcec2155..."} Signed: Telco B Encrypted with public key of Telco A
  17. • Content can be hashes of external data Properties of

    Transactions {"tx":"requestTransfer", "phone":"0151-123123123", owner: "TelcoA", signedScannedContractHash: "0x80ebe76679b4812cde61d555c9026...", encryptedCustomerData: "..."} Signed: Telco B "I've got a PDF here (which I won't share) which has this hash" • To later prove the existance (at the time of block creation) and integrity of external data
  18. • Data which has been transferred point-to-point can be referenced

    Properties of Transactions {"tx":"requestTransfer", "phone":"0151-123123123", owner: "TelcoA", externalDataHash: "0x5489b348f7a433...", } Signed: Telco B Hash-reference to a piece of data which has been sent directly • To ensure transaction privacy, only parties of the transactions will get access to its data (f.e. Hyperledger Fabric oder Quorum)
  19. Blockchain: replicated, immutable* sequence of transactions * Within clearly defined

    conditions. More about these later. Interium conclusion
  20. • How does the system check, whether or not a

    transation is valid? Validity of Transactions? We're ok with the transfer of phone number 0151-123 123 123 Signed: Telco B Telco C 0151-123 123 123 is not with Telco B, but belongs to us! • Solved by laws, contracts & penalties (post-fact) • Or by technology (pre-fact)
  21. • Rules that define if a transaction is valid •

    Read and write "World State": the actual information in the blockchain Smart Contracts Number Owner 0151123123123 Telco C 01511111111111 Telco A 01511111111112 Telco Z
  22. Node 1 Key Value 0151123123123 Telco C 01511111111111 Telco A

    01511111111112 Telco Z We are ok with the transfer of 0151-123 123 123 to Telco A. Signed: Telco B function confirmTransfer(number, transferTarget) { if (owner[number] == msg.sender) { owner[number] = transferTarget; } else throw; } owner[number] == msg.sender Cryptographic verification throw Transaction flagged as invalid Failed
  23. Node 1 Key Value 0151123123123 Telco C 01511111111111 Telco A

    01511111111112 Telco Z We are ok with the transfer of 0151-123 123 123 to Telco A. Signed: Telco C function confirmTransfer(number, transferTarget) { if (owner[number] == msg.sender) { owner[number] = transferTarget; } else throw; } owner[number] == msg.sender Cryptographic verification owner[number] = transferTarget; Changes World State Key Value 0151123123123 Telco A 01511111111111 Telco A 01511111111112 Telco Z OK
  24. Docker-Container (managed) How are the Smart Contracts executed? Ethereum Node

    Inside a node Configured Process Smart Contract Execution Environment Tendermint Node Server-Code (Interface- convention: ABCI) Contract Creation Transaction Process start & config GRPC/Socket Managed Container Hyperledger Fabric Node Chaincode (Go, JS via Go-Bridge) Socket peer chaincode install
  25. Node 1 – Max Block: 20 Node 1 – Max

    Block: 21 Node 2 – Max Block: 20 Key Value 0151123123123 Telco C 01511111111111 Telco A 01511111111112 Telco Z Node 3 – Max Block: 20 Key Value 0151123123123 Telco C 01511111111111 Telco A 01511111111112 Telco Z Block 21 (in progress) Tx #78 Tx #79 Key Value 0151123123123 Telco C 01511111111111 Telco A 01511111111112 Telco Z Pending Transactions (Mempool, p2p Sync) Tx X Tx Y Tx Y Tx Z Tx Z Tx X Tx X Tx Z Tx Y Smart contract execution for #78 Failed! Smart contract execution for #79 Block hash Key Value 0151123123123 Telco A 01511111111111 Telco A 01511111111112 Telco Z Block closed
  26. Node 1 – Max Block: 20 Node 1 – Max

    Block: 21 Node 2 – Max Block: 20 Key Value 0151123123123 Telco C 01511111111111 Telco A 01511111111112 Telco Z Node 3 – Max Block: 20 Key Value 0151123123123 Telco C 01511111111111 Telco A 01511111111112 Telco Z Key Value 0151123123123 Telco A 01511111111111 Telco A 01511111111112 Telco Z Pending Transactions (Mempool, p2p Sync) Tx Z Block 21 Block 21 Block 21 Block 21 Tx #78 Tx #79 Failed! Block hash Block 21 Block 21 Block 21 Block 21 Tx #78 Tx #79 Failed! Block hash Block 21 Block 21 Block 21 Block 21 Tx #78 Tx #79 Failed! Block hash
  27. Node 1 – Max Block: 20 Node 1 – Max

    Block: 21 Node 2 – Max Block: 21 Key Value 0151123123123 Telco A 01511111111111 Telco A 01511111111112 Telco Z Node 3 – Max Block: 21 Key Value 0151123123123 Telco A 01511111111111 Telco A 01511111111112 Telco Z Key Value 0151123123123 Telco A 01511111111111 Telco A 01511111111112 Telco Z Pending Transactions (Mempool, p2p Sync) Tx Z Block 21 Block 21 Block 21 Block 21 Tx #78 Tx #79 Failed! Block hash Block 21 Block 21 Block 21 Block 21 Tx #78 Tx #79 Failed! Block hash Block 21 Block 21 Block 21 Block 21 Tx #78 Tx #79 Failed! Block hash
  28. • Smart Contracts have to be deterministic for all nodes

    • Communication with off-chain services: asynchronous (events) with signed answer- transaction to original requester • This concept is called "oracle" Smart Contracts & external data
  29. Documenting Collaborating Transforming • „Timestamping“ • Put a hash of

    your private documents or data on a blockchain • Technical proof of integrity and existence of documents and data at a certain point in time • Relatively easy to implement, quick ROI • No – or only small – focus on smart contracts
  30. Documenting Collaborating Transforming • Data exchange and process transparency •

    States of processes managed via blockchain • Digitization of paper processes between companies • Phone number porting • „Loi Hamon“ in France
  31. Documenting Collaborating Transforming • Create new business opportunities and markets

    • Reality check: Increased complexity due to the number of stakeholders
  32. • Problem with car insurance • Risk assessment (and policy

    pricing) based on number of years of accident-free car ownership • But what about car sharing users? (2M+ users in Germany) • Challenges • GDPR-conforming data processing • Scaling to lots of parties on all sides (no point-to-point interfaces) • Data should survive bankruptcy of a party (no on-demand generation) Case: Accident-free carsharing kms per year
  33. Customer generates digital ID (in browser or on a membership

    card, …) Carsharing provider • Connect digital ID with provider's customer ID • Opt-in on web site Insurer Blockchain May 2018 Cust 1122 – 97 km May 2018 Cust 5745 – 34 km June 2018 Cust 1122 – 535 km June 2018 Cust 5745 – 16 km Customer Periodic publication of data
  34. Carsharing provider Insurer Blockchain 239587030 4957443873 459089845 3458999… 947989834 5345534524

    958458205 755345… 9447757234 2349348572 345580923 84949283… 209389084 923840982 342394820 9348934… Customer Publication of signed data, encrypted with the public key of each customer Customer can decrypt her data at any time. Nobody else can. May 2018 Cust 1122 – 97 km - Provider1 June 2018 Cust 1122 – 535 km - Provider1 Customer can pass data to third parties after decryption. Even if the creator of the data does not exist anymore. (Ultimate data sovereignty)
  35. Carsharing provider #1 Insurer 1 Blockchain Customer Carsharing provider #2

    Rental car provider Insurer 2 Insurer 3 0304... 4586... 6436... 9384... 5463... 5854... … Feb 2018, 50 km, Stadt- mobil Feb 2018, 25 km, DB March 2018, 1534 km, Sixt Transfer by customer!