Introduction to Blockchain Technology Current Trends in Artificial Intelligence Volker Strobel PhD student @ IRIDIA 23 February 2017
Part I: Bitcoin: Idea, Basics, Technology Part II: Altcoins, Use cases, Blockchain applications 2
Part I: Bitcoin: Idea, Basics, Technology Part II: Altcoins, Blockchain applications, Use cases 3
Bitcoin is a digital currency without the need of banks and governments Government Bank Alice transaction 4 Bob Peer 1 Peer 2
Why would you want to remove the bank? save costs transaction speed don t trust the bank be anonymous be able to pay ideological reasons censorship non-reversible transactions micropayments payments triggered by events flexibility 5
Developing a peer-to-peer financial system poses many challenges: How to validate transactions? How to create new money? How to trust the system? How to prevent double-spending? How to reach consensus on who owns what?? 6
7
Understand the Blockchain in Two Minutes by the Institute for the Future (IFTF) (https://www.youtube.com/watch?v=r43lhsuugtq&t=70s&pbjreload=10) 8
Every participant keeps his/her own copy of the ledger https://bitnodes.earn.com/ Peer-to-peer network 9
To transfer Bitcoin tokens, participants publicly announce transactions Transaction: Send 3 Bitcoins from Alice to Bob Is this transaction really from Alice? 10
Digital Signatures Public-key cryptography document private/secret key (sk) signature public key (pk) sign( document, sk) = signature verify( document, pk, signature) = bool 11
A quick example of digital signatures Distribute public key: gpg --armor --output volker.gpg export Import public key (on another machine): gpg --import volker.gpg Create message: echo "hello blockchain" > msg.txt Sign message: gpg --clearsign -o sig.gpg msg.txt Send sig.gpg via email Verify message (on another machine): gpg --verify sig.gpg 12
How to ensure that everyone has the same version of? Peer-to-peer network Majority consensus? => Sybil attacks 13
You trust the ledger with the highest amount of computational work (often called the longest chain but it s rather the strongest chain) work: 2 79 work: 2 80 work: 2 79 work: 2 76 work: 2 75 14
The computational work is calculated based on the expected amount of calculated hashes Hash function: any function that can be used to map data (x) of arbitrary size to data of fixed size (y): hash(x) = y x y Cryptographic hash function: non-reversible hash function (and ideally some other features): Given y, very hard to find x x y 15
https://anders.com/blockchain/hash.html
Mining (Proof of Work): Find solution to a mathematical puzzle that can only be solved by brute force (trial & error) 1. Immutability: Set order of transactions (changing anything requires to re-mine ) 2. Consensus based on amount of mining work 17
https://anders.com/blockchain/block.html
Mining is a race: As a miner you want to be the first to find the solution to get a reward (tx fees and block reward) <Data> PoW mining <coinbase tx> <Data> 19
The blockchain is build of blocks: chunks of data Block k - 1 Block k Block k + 1 Header hash(<data>) prev Hash hash(<data>) prev Hash hash(<data>) prev Hash Body <Data> <Data> <Data> 20
Changing data in a previous block would require an attacker to redo the Proof-of-Work of all later blocks https://anders.com/blockchain/blockchain.html 21
In Bitcoin the average block number is 10 minutes The target value is dynamically adjusted (every 2016 blocks) 22
The data in the blocks is created by transactions and sent to peers Transaction: Send 3 Bitcoin from Alice to Bob 23
Every node in the network checks if a transaction is valid transaction receiver address hash of prev. tx sender public key sender signature Valid signature No overspending No double-spending cryptocurrency 24
How do you own a Bitcoin? coinbase transaction miner address transaction receiver address UTXO transaction receiver address hash of prev. tx hash of prev. tx cryptocurrency sender public key sender public key sender signature sender signature cryptocurrency cryptocurrency A Bitcoin is a chain of signed transactions (i.e. every coin has a history). The owner of a Bitcoin owns the private key corresponding to an unspent transaction output (UTXO). 25
How to cheat/attack? Pool of unconfirmed transactions transaction A pays B transaction A pays A Send conflicting transaction Which own will end up in the blockchain? 26
Wait for confirmations Block k Block k + 1 transaction transaction <Data> 0 confirmations 1 confirmation 2 confirmations 27
Short summary: The main building blocks of Bitcoin are: - Peer-to-peer network - Public ledger - Digital Signatures - Proof-of-Work (Mining) - Blockchain 28
How to participate in the Bitcoin network? Download a wallet https://bitcoin.org/en/choose-yourwallet Get Bitcoins (e.g. from a friend or from an exchange such as kraken.com) 29
Part I: Bitcoin: Idea, Basics, Technology Part II: Altcoins, Use cases, Blockchain applications 30
Quite early, people realized that Bitcoin is just one application build on blockchain technology Appearance of Altcoins Image source: https://steemit.com/altcoins/@frieswiththat/top-10-sleeper-altcoins See also https://coinmarketcap.com/ 31
Use cases of Altcoins financial records domain name registration voting medical records artificial intelligence? 32
Peer-to-peer network 33
Peer-to-peer network <Data> <Data> <Data> <Data> <Data> <Data> <Data> <Data> 34
Image source: https://steemit.com/news/@jesusvmorales/ethereum-eth-the-best-currency-to-buy-and-mine
Financial transactions Arbitrary decentralized applications Bitcoin Blockchain 1.0 Ethereum Blockchain 2.0 Image source: https://bitcoin.org/de/
Use case of Ethereum: Blockchain-based smart contracts: programming code executed via blockchain technology tamper-proof code without any possibility of downtime, censorship, fraud or third-party interference (ethereum.org) main programming language: Solidity (online IDE at http://remix.ethereum.org) 37
Traditional crowdfunding centralized crowdfunding platform (e.g. kickstarter.com) needs trust all-or-nothing Project (e.g. smartwatch) needs trust backers Image source:https://www.visa.ca/en_ca/pay-with-visa/cards/credit-cards.html - money really send to the project? - transparency - potentially high fees 38
Ethereum-based crowdfunding (see https://ethereum.org/crowdsale for an implementation in Solidity) transaction Block k - 1 Block k Block k + 1 <Data> <Data> <Data> transaction transaction decentralized crowdfunding platform based on Ethereum trustless: all-or-nothing Project (e.g. smartwatch) needs trust - decentralized (no single point of failure) - guaranteed execution of the transfer - transparency - immutable - potentially lower fees backers 39
Blockchain Technology and AI? 40
(Very simplified) comparison between AI and Blockchain Technology Artificial Intelligence Blockchain Technology probabilistic deterministic black box transparent computationally complex algorithms lightweight programs (smart contracts) See also YouTube talk Blockchain + AI = Decentralized Artificial Intelligence by Siraj Raval (https://www.youtube.com/watch?v=ogk4dnqxvua) 41
How AI might improve blockchain technology AI Blockchain Scalability More useful mining algorithm Intelligent interfaces https://medium.com/@francesco_ai/the-convergence-of-ai-and-blockchain-whats-the-deal-60c618e3accc 42
How blockchain technology might improve AI Blockchain AI Huge amount of data / easy collection of data Transparency (public history of actions audit trail) Increase trust Marketplace for data/models https://medium.com/@francesco_ai/the-convergence-of-ai-and-blockchain-whats-the-deal-60c618e3accc 43
Example Blockchain AI projects (most of these projects are at an early stage of development) Decentralized privacy-preserving machine learning: (openmined.org) Identity validation of AI Agents (https://botchain.talla.com/) AI as a service (monetarize AI) (https://singularitynet.io/) 44
My PhD thesis Blockchain-based smart contracts for the secure coordination of robot swarms 45
A blockchain is a decentralized database where everyone can participate Peer-to-peer network 46
A blockchain is a decentralized database where everyone can participate Robot peer-to-peer network 47
Byzantine robots show arbitrary faulty or malicious behavior Motor broken! Infrared module broken! GPS connection lost! Programming code not updated! Tamper with messages! laboratory experiments real-world applications 48
Goal: Develop a framework for programming secure robot swarms For more details, see: V.Strobel, E. Castello Ferrer, M. Dorigo. 2018. Managing Byzantine Robots via Blockchain Technology in a Swarm Robotics Collective Decision Making Scenario. To appear in Proceedings of the 17th Conference on Autonomous Agents and MultiAgent Systems. International Foundation for Autonomous Agents and Multiagent Systems (AAMAS 2018). 49
Research ideas / open Research questions Can the Proof-of-Work be replaced by something more useful (e.g. training of a neural network)? What are use cases for blockchain technology? Possibilities and limitations of combining AI technologies and blockchain technology? 50
What could you do? Build a decentralized (AI?) application with Ethereum 51
Further material Mastering Bitcoin by Andreas M. Antonopoulos (https://github.com/bitcoinbook/bitcoinbook) Coursera online course (https://www.coursera.org/learn/cryptocurrency) Cryptocurrency news (https://www.coindesk.com) 52
Thank you! Volker Strobel vstrobel@ulb.ac.be