Current Trends in Artificial Intelligence · data (x) of arbitrary size to data of fixed size...
Transcript of Current Trends in Artificial Intelligence · data (x) of arbitrary size to data of fixed size...
Introduction to Blockchain TechnologyCurrent 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
4
Alice Bob
Bank
Peer 1 Peer 2
Government
transaction
Why would you want to remove the bank?
5
save costs
be anonymous
transaction speed
censorship
don’t trust the bank
non-reversible transactions
be able to pay
micropayments
ideological reasons
payments triggered by
eventsflexibility …
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
8
Understand the Blockchain in Two Minutes by the Institute for the Future (IFTF) (https://www.youtube.com/watch?v=r43LhSUUGTQ&t=70s&pbjreload=10)
Every participant keeps his/her own copy of the ledger
9
Peer-to-peer network<Financial
Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
https://bitnodes.earn.com/
To transfer Bitcoin tokens,participants publicly announce transactions
10
Transaction: Send 3 Bitcoins from
Alice to Bob
Is this transaction really from Alice?
Digital SignaturesPublic-key cryptography
private/secret key (sk)
public key (pk)
11
document
signature
sign( , sk) = signature
verify( , pk, signature) = bool
document
document
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 emailVerify message (on another machine):gpg --verify sig.gpg
12
How to ensure that everyone has the same version of <Financial Transactions>?
13
Peer-to-peer network<Financial
Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
Majority consensus?=> Sybil attacks
You trust the ledger with the highest amount of computational work(often called the longest chain but it’s rather the strongest chain)
14
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
work: 279work: 280
work: 279
work: 275work: 276
x y
The computational work is calculated based on the expected amount of calculated hashes
15
Hash function: any function that can be used to map data (x) of arbitrary size to data of fixed size (y): hash(x) = y
Cryptographic hash function: “non-reversible” hash function (and ideally some other features): “Given y, very hard to find x”
x y
https://anders.com/blockchain/hash.html
Find solution to a mathematical puzzle that can only be solved by brute force (trial & error)
17
Mining(Proof of Work):
1. Immutability: Set order of transactions (changing anything requires to “re-mine”)
2. Consensus based on amount of mining work
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)
19
<Data><coinbase tx> <Data>PoW
“mining”
The blockchain is build of blocks:chunks of data
20
<Data> <Data> <Data>
Block k - 1 Block k Block k + 1Header
Body
prev Hashhash(<Data>)
prev Hashhash(<Data>)
prev Hashhash(<Data>)
21
https://anders.com/blockchain/blockchain.html
Changing data in a previous block would require an attacker to redo the Proof-of-Work of all later blocks
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
23
Transaction: Send 3 Bitcoin from
Alice to Bob
Every node in the network checks if a transaction is valid
24
• Valid signature • No overspending • No double-spending
transaction
sender public key
sender signature
cryptocurrency
receiver address
hash of prev. tx
How do you ‘own’ a Bitcoin?
25
coinbase
transaction miner address
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).
UTX
O
transaction
sender public key
sender signature
cryptocurrency
receiver address
hash of prev. tx
transaction
sender public key
sender signature
cryptocurrency
receiver address
hash of prev. tx
How to cheat/attack?
26
Pool of unconfirmed transactions
transaction
A pays B
transaction
A pays A
Send conflicting transaction
Which own will end up in the blockchain?
Wait for confirmations
27
<Data>
Block k Block k + 1
transaction
1 confirmation 2 confirmations
transaction
0 confirmations
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 wallethttps://bitcoin.org/en/choose-your-wallet
• 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
31
Appearance of “Altcoins”
See also https://coinmarketcap.com/
Image source: https://steemit.com/altcoins/@frieswiththat/top-10-sleeper-altcoins
Use cases of Altcoins
• financial records
• domain name registration
• voting
• medical records
• artificial intelligence?
• …
32
Peer-to-peer network
33
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
<Financial Transactions>
34
<Data>
<Data>
<Data>
<Data>
<Data>
<Data>
<Data>
<Data>
Peer-to-peer network
Image source: https://steemit.com/news/@jesusvmorales/ethereum-eth-the-best-currency-to-buy-and-mine
Ethereum Blockchain 2.0
Bitcoin Blockchain 1.0
Image source: https://bitcoin.org/de/
Arbitrary decentralized applications
Financial transactions
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
38
centralized crowdfunding platform (e.g. kickstarter.com)
Project (e.g. smartwatch)
all-or-nothing
“Traditional” crowdfunding
needs trust
- money really send to the project? - transparency - potentially high fees
needs trust
backersImage source:https://www.visa.ca/en_CA/pay-with-visa/cards/credit-cards.html
Ethereum-based crowdfunding(see https://ethereum.org/crowdsale for an implementation in Solidity)
39
decentralized crowdfunding platform
based on Ethereum
backers
Project (e.g. smartwatch)
all-or-nothing
transaction
<Data> <Data> <Data>
Block k - 1 Block k Block k + 1
transaction
transaction
trustless:
- decentralized (no single point of failure) - guaranteed execution of the transfer - transparency - immutable - potentially lower fees
needs trust
Blockchain Technology and AI?
40
(Very simplified) comparison betweenAI and Blockchain Technology
41
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)
How AI might improve blockchain technologyAI Blockchain
• Scalability
• More useful mining algorithm
• Intelligent interfaces
42
https://medium.com/@Francesco_AI/the-convergence-of-ai-and-blockchain-whats-the-deal-60c618e3accc
How blockchain technology might improve AIBlockchain AI
• Huge amount of data / easy collection of data
• Transparency(public history of actions — audit trail)
• Increase trust
• Marketplace for data/models
43
https://medium.com/@Francesco_AI/the-convergence-of-ai-and-blockchain-whats-the-deal-60c618e3accc
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
46
Peer-to-peer network
A blockchain is a decentralized database where everyone can participate
47
Robot peer-to-peer network
Byzantine robots show arbitrary faulty or malicious behavior
48
laboratory experiments real-world applications
Motor broken!
Infrared module broken!
Programming code not updated!
GPS connection lost!
Tamper with messages!
49
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).
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