Slide 1

Slide 1 text

Blockchain for Developers What's behind the hype? Ingo Rammer @ingorammer

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

• Technology, not magic • Three classes of use cases

Slide 4

Slide 4 text

Blockchain-Fundamentals with Phone Number Porting

Slide 5

Slide 5 text

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, ...

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

• 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)

Slide 8

Slide 8 text

• 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

Slide 9

Slide 9 text

Blockchain Basics

Slide 10

Slide 10 text

"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?

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

Node 1 Nodes are independent, without central authority Node 2 Node 3 Node 4 Node 5 Node 6 Node 7 Node 8 Node 9

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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)

Slide 16

Slide 16 text

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, ...

Slide 17

Slide 17 text

Where are the clients?

Slide 18

Slide 18 text

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, ...)

Slide 19

Slide 19 text

Blocks and Transactions

Slide 20

Slide 20 text

• 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

Slide 21

Slide 21 text

• 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 ...

Slide 22

Slide 22 text

• 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

Slide 23

Slide 23 text

• 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

Slide 24

Slide 24 text

• 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)

Slide 25

Slide 25 text

Blockchain: replicated, immutable* sequence of transactions * Within clearly defined conditions. More about these later. Interium conclusion

Slide 26

Slide 26 text

Blockchains and Code

Slide 27

Slide 27 text

• 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)

Slide 28

Slide 28 text

• 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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Alle nodes need to same version of smart contracts to work correctly!

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

How do transactions get into the blocks?

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

• 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

Slide 38

Slide 38 text

Blockchain: replicated, immutable sequence of transactions, confirming to certain rules Conclusion

Slide 39

Slide 39 text

… but what can we do with it? So far, so good …

Slide 40

Slide 40 text

Three main classes of use cases for blockchains

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Documenting Collaborating Transforming • Create new business opportunities and markets • Reality check: Increased complexity due to the number of stakeholders

Slide 44

Slide 44 text

• 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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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)

Slide 47

Slide 47 text

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!

Slide 48

Slide 48 text

Thank you! • Slides: https://speakerdeck.com/ingorammer • Contact: [email protected] • Twitter: @ingorammer Documenting Collaborative Transforming