Blockchain Basics with focus on Energy Energy Blockchain Webinar Series: Webinar #2 July 13, 2018 July 13 th 2018 Tony Giroti, tony@energy-blockchain.org CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org Content Copyright 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 1
Your Presenter Tony Giroti 25+ years in IT Bachelor and Masters in Electrical & Computer Engineering Developed Distributed Computing Platforms Developed High Availability Transaction Processing Applications Designed Fault-Tolerant, Massively-Scalable Supercomputers Entrepreneur, Founded a few Startups Spent last 12 yrs in Energy, Smartgrid and now Energy Blockchain Emeritus Council, Board member in US DOE GWAC, NIST SGIP 5 USPTO Patents Chairman, Energy Blockchain Consortium July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 2
Disclaimer Any product, individual or company mentioned in this webinar should not be construed as an endorsement by the Energy Blockchain Consortium. We have avoided the use of names so any mention is purely coincidental or for illustrative purposes only. All participants are expected to conduct in the webinar per the professional, business like and common sense norms. July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 3
Energy Blockchain Webinar Series Energy Blockchain Webinar Series created by Energy Blockchain Consortium Today s Webinar is the 2 nd Webinar FREE to anyone registering (energy-blockchain.org/webinars) 12 Webinars: 1 st Friday of month (except holiday weeks) @12 to 1pm EST 2018: Jun 1, Jul 13, Aug 3, Sep 7, Oct 5, Nov 2, Dec 7 2019: Jan 4, Feb 1, Mar 1, Apr 5, May 3 Webinars are also available for offline viewing About Energy Blockchain Consortium: A non-profit consortium of Companies interested in using Blockchain technology to solve the most compelling problems in the Energy industry. Join as members. energy-blockchain.org or send me an email tony@energy-blockchain.org July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 4
Topics A Recap on Blockchain from last webinar What is Blockchain & How does it work with an example? What is under the Blockchain hood? What is Distributed Ledger? What is Smart Contract? What is Consensus? How does Blockchain make stuff more secure? What are Cryptocurrencies and Wallets? P2P Transaction (example) The Energy Blockchain Use Case July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 5
What is Blockchain and how does it work? July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 6
What is Blockchain? The World Today A Company Bank, Utility, Insurance, ISO, Retailer Application The World with Blockchain (Next Gen. of Distributed Computing Platform) Company A Company B Company C Company D Blockchain Node A Blockchain Node B Blockchain Node C Blockchain Node D Business Logic Database Ledger A Ledger B Ledger C Ledger D Centralized Control (w or w/o distribution) Data: Company has 1 or more databases Business Logic: Company runs biz process Control: Company controls Data & App Trust: The Company is the Trusted Party Decisions: Made by The company History: The Company knows it Changes: Made by The Company Transactions: In Company s Database De-Centralized Control (Nodes are connected via P2P Network) Data in multiple databases i.e. in distributed Ledgers so multiple nodes have Same Data Business Logic: Same SmartContract runs in multiple companies Control: 1 Company DOES NOT Control Data & App. Who does? Individuals (Us), Node operators, others Trust: Blockchain technology is the Trusted Party & NOT company (So no people trust required Trustless Decisions: All Participants must agree on the Validity (CONSENSUS) History: All Participants know where the data came from (PROVENANCE) Changes: Data and SmartContract Logic CANNOT be changed (IMMUTABILITY) Transactions: Any Shared ledgers has ownership of assets or completion of transaction (FINALITY) July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 7
How Blockchain works? 1 3 widgets Example: Andy sold 3 widgets to Bob. Rate is $1 per unit. Andy Company A $3 2 Blockchain Node A SmartContract: Amt = Units x 1 Ledger A Tx Bob $3 4 Tx Company B Blockchain Node B SmartContract: Amt = Units x 1 Ledger B 6 Provisional Unconfirmed Transactions Memory Pool Tx 7 Tx Company C Blockchain Node SmartContract: Amt = Units x 1 Ledger C Provisional Unconfirmed Transactions Memory Pool Tx Ty 9 3 Node A Creates a digitally signed TRANSACTION (a) 3 Widgets from Andy to Bob Tx (b) $3 from Bob to Andy 5 Node B: VERIFICATION of Transaction (a) Does it comply with Blockchain rule (b) Is its Digital Signature ok (c) Are there any conflicts with prev transactions 8 Node C: VERIFICATION of Transaction (a) Does it comply with Blockchain rule (b) Is its Digital Signature ok (c) Are there any conflicts Like Transactions, BLOCKS also Propagated from Node to Node and linked as a Chain. Hence BLOCKCHAIN 11 Periodically VALIDATORS create Blocks (a) If Node C was a VALIDATOR it creates a BLOCK in Ledger C (b) VALIDATOR is rewarded (from transaction charge) Hash: 32 bytes unique ID of BLOCK July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 8 10 Link to Prev Hash Time Stamp A set of Transactions Tx Ty
A Blockchain Application A Blockchain App An app that allows me to sell widgets at $1 per unit and discount of 10% over 10 units The World with Blockchain (Nodes are connected via P2P network) Company A Company B Company C Company D Blockchain Node A Blockchain Node B Blockchain Node C Blockchain Node D Smart ContractX: Rate $1 per unit with 10% disc. for over 10 units Transactions Tx, Ty, Ta, Tb, Tc.. : Ledger A Ledger B Ledger C Ledger D - Andy sold 3 widgets to Bob: Bob Andy $3 - Cathy sold 10 widget to Dan: Dan Cathy $9 - Emily sold 1 widgets to Frank: Emily Frank $1 Block 123 BLOCK hash Block 124 BLOCK Hash Block 125 BLOCK Hash Block 126 BLOCK Hash - Gina sold Previous Block Hash Previous Block Hash Previous Block Hash Previous Block Hash Time Stamp Time Stamp Time Stamp Time Stamp Blocks - 123, 124, 125, 126 Transactions Tx Ty Transactions Ta Transactions Tc Tc Tc Transactions Td Te Jun 1, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 9
What is under the Blockchain hood? July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 10
Basic Blockchain Technology Applications Middleware Functions Features Languages Apps Blockchain Under the Hood (Architecture) PoW, PoA, PoS Smart Contract X Smart Contract Y Crypto Currency Fiat Exchange Others Solidity Go Java Kotlin Legal Prose Others Immutability Trustless Provenance Finality Democratization Disintermediation Distributed Ledger Smart Contract Decentralized Consensus Public Private Key Security Crypto Currency & Wallets Hashing, BFT, other Algorithms Fault Tolerance Transaction Process, Secure messaging Transaction Scripts Virtual Machine Verification, Block Creation Transaction Linkage Time stamping scheme Accounts & Addresses Transaction Distribution Operating System Networking File System Database Operation & Management Hardware July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 11
Blockchain deployed The World with Blockchain (Next Gen. of Distributed Computing Platform) Company A Company B Company C Company D Blockchain Node A Blockchain Node B Blockchain Node C Blockchain Node D Ledger A Ledger B Ledger C Ledger D For PoW Consensus (optional) Data Mining Company X Data Mining Company Y Data Mining Person Z July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 12
What are the core functions of Blockchain? 1 Distributed Ledger 4 Public Private Key Security 2 Smart Contract 5 Crypto Currency & Wallets 3 Decentralized Consensus July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 13
Blockchain core functions 1 Distributed Ledger July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 14
Distributed Ledger Key Question: We ve had Distributed DBs for years; why Distributed Ledger is such a big deal? The World Today A Company Bank, Utility, Insurance, ISO, Retailer Application The World with Blockchain (Next Gen. of Distributed Computing Platform) Company A Company B Company C Company D Blockchain Node A Blockchain Node B Blockchain Node C Blockchain Node D Business Logic Data base Data base Data base Ledger A Ledger B Ledger C Ledger D This 1 company controls the data Synchronized (Replication) Optional validation 2 No single Company controls the data. 1 Synchronize with Validation Synchronize with Validation Synchronize with Validation 3. Who controls the addition of data in DL? It s the SmartContract! Not a company. 4. So who actually controls data in DL? Could be end user as the ultimate controller. 5. Unlike traditional Database, Data in DL cannot be deleted (Immutability). July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 15
Blockchain core functions 2 Smart Contract July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 16
Traditional vs. SmartContract Key Differences Traditional Contracts Blockchain SmartContract or ChainCode Benefits of SmartContract 1 Overview Paper or Electronic Electronic; Coined Nick Szabo; ChainCode in Hyperledger Accuracy: More accurate, less errors 2 What is it? Describes Terms Describes Terms AND Controls how to process a transaction Built in Governance 2 Who creates it? An Intermediary: Agent of Buyer or Seller Or company 3 Who keeps it? Kept with Buyer & Seller and Intermediary Business who wants to offer something at no or low overhead Kept In Distributed Ledger 4 Who can see it? Only Buyer and Seller Everyone if that makes sense or only Buyer and Seller Transparent 5 Can it be changed? Usually Not but addendums can add or remove clauses. No due to Immutability (except under extreme circumstances) Autonomy: No reliance on intermediary so Faster Reduce Risk of manipulation Immutability 6 Tampering possibility? Yes No.. due to Immutability. Log is maintained. Trust. Each node is a backup 7 Who executes a Transaction? The Agent or Intermediary takes a % of transaction fee The Business that created it offers the leader a financial incentive to Execute the contract by creating blocks. 8 Who is intermediary? The Agent or Intermediary No intermediary ( SmartContract is the intermediary ) Independence Achieve Intermediary service from the Smartcontract itself for Savings 9 Risk of Litigation? Yes always No as SmartContracts guarantee a very specific outcome Eliminate or Reduce Litigation 10 Security Low Very High Highly Secure 11. Legal Jurisdiction? Very Clear Not very clear (but can be managed) Define once, use always July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 17
What does a Smartcontract do? 2 Replicates Assets (Distributed Ledger) 1 Biz Logic (Turing completeness) 3 Security with Cryptographic Hash Chain Smart Contract 6 Transaction Management 5 Byzantine Fault Tolerance (BFT Replication) 4 Contract Execution (Governance & Control) July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 18
Blockchain core functions 3 Decentralized Consensus July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 19
Consensus, Trust How do validators validate a transaction and block? What is the agreement? Who s in control? Distributed trustless Consensus is the Primary Innovation of Blockchain PoW PoS PoA 1 Proof of Work Anyone with compute power can do All actors solve math problem The winner is the leader with brute power The Miner Leader creates a block. Others verify Leader is financially rewarded Cheating is difficult. 32TwH per year Flaw: Miner > 51% resource can hijack 2 Proof of Stake Created to solve energy issue Brings mining back into the chain Actors w/ stake replace energy use Leader who creates block is chosen deterministically by their stake Min % stake may be required to participate 3 Proof of Authority Only pre-approved accounts are Validators Authority Nodes Earn the right, uphold high standard, reputation July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 20
Blockchain core functions 4 Security of Data & Transactions July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 21
Cryptography: Public Private Key Andy 1. Andy wants to send Barbara something say a secret number, say its 10 2. He takes Barbara s public key (i.e. multiply by 2, add E) and encrypts it to 20E 3. He sends Barbara 20E as encrypted message 4. Barbara uses her Private Key secretly (i.e. divides by 2 and removes E) and decrypts to 10 10 Encrypt 20E 20E Decrypt 10 Barbara Public Key = Add 1 (everyone knows) ABCDEF Private Key = Subtract 1 (his secret) 121212 Note: -- private key unique 10 ** 77 -- a simple example in reality it is complex -- It s NOT possible to deduce the private key from public key -- Two keys are linked with a Signature Algorithm for creating identities, signing messages & validating signatures Thief Steals the data 20E Thief does not know Barbara s Private key Thief cannot Decrypt20E to 10 Public Key = Mult by 2 add E (Everyone knows) BX87 Private Key = Div by 2 then remove E (her secret) HKX6 July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 22
Security of Blockchain Data The World Today A Company Bank, Utility, Insurance, ISO, Retailer Application The World with Blockchain (Next Gen. of Distributed Computing Platform) Company A Company B Company C Company D Blockchain Node A Blockchain Node B Blockchain Node C Blockchain Node D Business Logic Data base Data base Data base Ledger A Ledger B Ledger C Ledger D 1 Data may not be encrypted & public key cryptography not needed 2 Single point of failure 1 Data is always encrypted & public key cryptography 2 No single point of failure 3 Data can be changed as its on one database 4 No detection controls exists that detect invalidation of record 3 Tamper resistant as same block is spread on N nodes (cannot change all blocks) 4 A transaction is saved in the ledger with cryptography + private key of the creator. If this record is hacked and altered, the record cannot be read back and is invalidated and peer networks know this is compromised July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 23
Security of Blockchain transaction A Computer Node or Andy 1. Andy or a SmartContract on Node wants to send Barbara 10 Bitcoins 2. He takes Barbara s public key (i.e. multiply by 2, add E) and encrypts it to 20E Bitcoins 3. He sends Barbara 20E as encrypted message 4. Barbara uses her Private Key secretly (i.e. divides by 2 and removes E) and decrypts to 10 Barbara 10 Encrypt 20E 20E Decrypt 10 Public Key = Add 1 (everyone knows) ABCDEF Private Key = Subtract 1 (his secret) 121212 Thief Steals data 20E & does not know Barbara s Private key & cannot change to 1,000 Bitcoins as private key of sender will invalidate tampering Signed by 121212 Signed by 121212 Public Key = Mult by 2 add E (Everyone knows) BX87 Private Key = Div by 2 then remove E (her secret) HKX6 Key Question? How do we prevent Barbara from altering the data e.g. Bitcoins she received are 10 but she can change 10 to 50 To claim that she deserves 50 bitcoins? Easy Answer: Andy or Node D, signs the transaction With its own Private Key 121212 before it sends it to Barbara, so she cannot change it July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 24
Blockchain core functions 5 Crypto Currency & Wallets July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 25
Cryptocurrency Wallet Andy Today s world ($,,..) Cathy Bank Account 123 Bank Account 567 Paypal acct 0101 Paypal acct 0203 CC (1 acct with CC) The whole world Any currency, Any person Anywhere $ : Fiat currency Cryptocurrency Wallet (Bitcoin, Ether, others) Blockchain world (Crypto Currencies) Many Companies offer wallets Private Key (secret) & Public Key (Wallet address) Money sent to public key can be spent by person who knows private key BitCoin Blockchain Ethereum Blockchain Other Blockchains Cryptocurrency Exchange X Blockchain World (Bitcoin, Ether, Litecoin. Others) Cryptocurrency Exchange Y July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 26
P2P Blockchain transaction A Computer Node or Andy 1. Andy or a SmartContract on Node wants to send Barbara 10 Bitcoins 2. He takes Barbara s public key (i.e. multiply by 2, add E) and encrypts it to 20E Bitcoins 3. He sends Barbara 20E as encrypted message to her Wallet Public address 4. Barbara uses her Private Key secretly (i.e. divides by 2 and removes E) and decrypts to 10 5. She can use her Bitcoin money now to buy goods through P2P with others Barbara 10 Encrypt 20E 20E Decrypt 10 Public Key = Add 1 (everyone knows) ABCDEF Private Key = Subtract 1 (his secret) 121212 Cryptocurrency Wallet Public Key = Mult by 2 add E (Everyone knows) BX87 Private Key = Div by 2 then remove E (her secret) HKX6 Cathy Cryptocurrency Wallet (Bitcoin, Ether, others) Many Companies offer wallets Private Key (secret) & Public Key (Wallet address) Money sent to public key can be spent by person who knows private key BitCoin Blockchain Ethereum Blockchain Other Blockchains Cryptocurrency Wallet (Bitcoin, Ether, others) July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 27
What is an ICO? Initial Coin Offering Crowdfunding Startup create a crypto currency token: MySuperDuperCoin (MSDC) Offers x% of MSDC to investors at say 100MDX = 1 Bitcoin About 80% of ICOs are on Ethereum platform Token are based on Ethereum ERC20 July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 28
Energy Blockchain Use of Blockchain in Energy July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 29
P2P Trading - Transactive Energy Transaction P C O 1. Price Signals (optional) 2 3 5 2. Produces Electricity I P C U O ISO / RTO Producer Consumer Utility Operations Micro Grid IT Grid / Blockchain 8 B 6 4 7 U 1 Electricity Grid Energy Market Note: P & C may be connected to a feeder line originating from the same substation or the two maybe on different feeder lines on two substations I 3. Places Order with pre-negotiated price with P or (b) Buys via Exchange, Consumes Electricity 4. Removes KWH from Producer into Grid 5. Balancing Function, Manage Load, Frequency, Power Factor 6. SmartContract, Billing and Settlement 7. Proof of Authority (Confirmation), Customer Service 8. Proof of Stake (Other) B Blockchain July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 30
Energy Blockchain Use cases Peer to Peer Energy Trading Wholesale Market Settlement Energy Data Management Energy Forecasting Energy M&V Net Energy Metering DER Service Coordination Grid Security Customer Data & Service Retail Billing EV Charging Energy Storage Microgrid Network operator REC & Carbon Trading Price Responsive Demand Response July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 31
Blockchain Drawbacks & Issues Lack of Education or knowledge General Risk perception: Fear and Hacking Change Risk: We may get disintermediated Large Size Cannot get smaller Incompatibility with Enterprise Systems Lack of Standards Lack of Integration July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 32
Upcoming Conference July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 33
Thank You Q&A Time Register for next webinar Join Energy Blockchain Consortium Get involved in real Blockchain projects Contact Information Tony Giroti tony@energy-blockchain.org 617.480.6550 July 13, 2018 CONTENT COPYRIGHT 2018, ENERGY BLOCKCHAIN CONSORTIUM, Tony Giroti, tony@energy-blockchain.org 34