Slide 1

Slide 1 text

Aaron Li Founder & CEO [email protected] Opportunities at the intersection of Machine Learning & Blockchain …and how we can make them better we are hiring engineers! angel.co/qokka/jobs

Slide 2

Slide 2 text

Copyright 2018 Aaron Li ([email protected]) About this presentation Briefly… Talk about some ML & Blockchain projects With some details… Go through 1-3 really cool projects Explore areas of opportunities Quickly go through some code, references, tutorials, and links Introduce CryptoQokka (private beta)

Slide 3

Slide 3 text

Copyright 2018 Aaron Li ([email protected]) Machine Learning Blockchain 2009 2011 Bitcoin: first crypto & blockchain use case GPU mining & first alt coin (Namecoin) Ethereum: First general-purpose blockchain platform & ICO with big success 2015 1000+ new coins, tokens, protocols 2017 Deep learning on GPU (“first” cat classifier) General purpose ML / DL platforms General adoption: real-life application, multi- industry, large-scale, incl. large companies 1000+ AI / ML startups Basic ML adoptions & open source tools

Slide 4

Slide 4 text

Copyright 2018 Aaron Li ([email protected]) AI / Machine Learning Blockchain Stage Early Adoption Experimental Adoption Government & Industry Mostly developers, enthusiasts, and traders Entry Barrier High Open Beneficiaries Mostly Institutions Mostly People Copyright 2018 Aaron Li ([email protected])

Slide 5

Slide 5 text

Copyright 2018 Aaron Li ([email protected]) At the intersection… How does machine learning help blockchain / cryptos? How will blockchain / cryptos transform machine learning? How can we make machine learning practical on blockchain?

Slide 6

Slide 6 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? labels & data crowdsourcing data sharing & exchange model sharing & evaluation goal: trading data on blockchain (both B2B and C2B) goal: creating massive labelled data, i.e. “human computation” on blockchain goal: share and iterate models on blockchain machine learning on blockchain challenges: privacy, speed, scale, generality solutions: trusted hardware (TEE / enclave), generic blockchain application interface possible solutions: “proof-of-brain” in Steem “prediction market” as in Augur projects: Engima, Datum, BOTTOS projects: OpenMinded, and a few more in progress benefits: transparency, trust, collaboration

Slide 7

Slide 7 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? machine learning on blockchain transparency - training and inference algorithms can be made transparent so the public can verify its legitimacy trust - ensure no human tampering in machine learning computations; eliminating fraud and plagiarism collaboration - models and results can be shared, persisted, and verified by many parties benefits

Slide 8

Slide 8 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? machine learning on blockchain privacy - keep sensitive information accessible to the right people (inference query, training data, model state, …) speed - run and verify complex computations fast (must be many orders of magnitudes faster than Ethereum) scale - quickly replicate and persist states to whole network generality - non-monolithic design: separate consensus and state replication from computation / ML applications challenges

Slide 9

Slide 9 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? machine learning on blockchain privacy - utilize differential privacy and trusted hardware to hide model state and encrypt results speed - separate computations to “compute nodes” backed by Trusted Execution Environments (TEE) and execute only once (or a few times) scale - nodes operate on Proof of Stake (PoS) consensus protocols generality - Application BlockChain Interface (ABCI) that enables applications to be written in any language, and communicate over gRPC solutions e.g. Ekiden (will elaborate later)

Slide 10

Slide 10 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? model sharing & evaluation projects: OpenMinded, and a few more in progress goal: share and iterate models on blockchain overall idea: engineers designed models, but don’t have data or computing power to work with engineers submits encrypted, untrained models to blockchain network people on the network train the encrypted model, if they have the data people who train the models get rewarded by performance via automated evaluations

Slide 11

Slide 11 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? data sharing & exchange goal: trading data on blockchain (both B2B and C2B) projects: Engima (testnet/SDKS ready), independent blockchain Datum (apps/SDK ready), built on Ethereum BOTTOS (mainet & clients ready), independent blockchain use cases: Engima: algorithmic crypto trading, i.e. Catalyst Python library Datum: let users sell personal data collected from mobile phone, and keep control BOTTOS: exchange datasets for machine learning training

Slide 12

Slide 12 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? data sharing & exchange Enigma mechanism providers and consumers register/ subscribe datasets on-chain transmit / consume actual data off- chain; use Enigma to encrypt SDK / Tutorial: Gtihub / Documentation (Screenshots taken Engima documentation)

Slide 13

Slide 13 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? data sharing & exchange apps provide users with fine-grained control of what and who to sell e.g. email addresses, Facebook usage, Nest smart home data, etc. Datum mechanism developers use SDK to access / store data

Slide 14

Slide 14 text

Copyright 2018 Aaron Li ([email protected]) How will blockchain / cryptos transform machine learning? labels & data crowdsourcing goal: creating massive labelled data, i.e. “human computation” on blockchain related projects: “proof-of-brain” in Steem (See my previous talk on Youtube) “prediction market” as in Augur mechanisms: Steem - a machine learning variation - Participants are incentivized to create and curate high quality data - Participants get paid by social assessment on quality of data - May work very well because Steem is (1) fast (2) provides general interface Augur - use case for machine learning - Participants are strongly incentivized to provide good predictions for complex function

Slide 15

Slide 15 text

Copyright 2018 Aaron Li ([email protected]) spamming & fraud detection parameter & config optimization information & sentiment summarization trend prediction & data visualization goal: improve protocol & incentive design goal: detect scam ICO, spam messages, suspicious transactions goal: predict and visualize usage spikes & trends possible solutions: ML classifiers on blockchain related data (decision tree, SVM, neural network…) problem: information overloading How does machine learning help blockchain / cryptos? solution: NLU at Internet scale Qokka.ai is currently working on this possible solutions: LSTM / RNN / GP / … various time series ML models possible solution: Reinforcement Learning (See Google Brain NIPS 2017 presentation for success on non-blockchain use cases) (to be elaborated in future talks…)

Slide 16

Slide 16 text

Copyright 2018 Aaron Li ([email protected]) scale up language understanding Decrypt crypto emotions and trends understand the world’s attitudes, opinions and emotions at massive scale (private beta) CryptoQokka.com

Slide 17

Slide 17 text

Copyright 2018 Aaron Li ([email protected]) Ethereum Mining asic bitmain … “In fact my Antminers mining Litecoin currently make me about twice the profit of my GPU mining rig that's mining Ethereum and the ASICs use about half the electricity as well” “Except ASIC miners in the future won't matter once the switch to PoS is done.” ☹ People money community … “I am a long-term holder in crypto, but all these recent changes aren't good for the space at all.” Expand summary Expand summary network social media public network own server contract bad behaviour good bot smart phone fork hard fork hard cap third party News Whitepaper Discussions … … April 10 ($417) (Screenshots taken from CryptoQokka private beta)

Slide 18

Slide 18 text

Copyright 2018 Aaron Li ([email protected]) t.me/qokka_ai medium.com/qokka linkedin.com/in/aaronqli polymorpher fb.com/ai.qokka scale up language understanding understand the world’s attitudes, opinions and emotions at massive scale we are hiring engineers! angel.co/qokka/jobs Decrypt crypto emotions and trends (private beta) CryptoQokka.com

Slide 19

Slide 19 text

Copyright 2018 Aaron Li ([email protected]) machine learning on blockchain Back to We will dive in some topics further…. - Ekiden (600x throughput, 400x latency, 1000x less cost v.s. Ethereum) - Experiment results, high-level ideas, architecture, Github - Machine Learning use cases and code examples
 - Tendermint (“barebone” blockchain with general interface, used by Ekiden) - Code examples & related projects 
 - Intel SGX (trusted hardware, commoditized after around 2017) - List of supported laptops / CPUs / motherboards - Cloud providers & status (GCP, AWS, Azure, IBM) - Open source projects & code examples & tutorials Challenges: privacy, speed, scale, generality

Slide 20

Slide 20 text

Copyright 2018 Aaron Li ([email protected]) machine learning on blockchain Ekiden Overview Features (Ekiden-BT, an implementation of Ekiden) Fast execution - Separate smart contract computations to a subset of trusted, verifiable (off-chain) compute nodes Fast consensus - Proof-of-Stake consensus on signed smart contract execution results; No heavy on-chain computations Confidentiality - Smart contract execution results are confidential to the client who started the execution Generality - ported EVM in Rust, supports general smart contract; also possible to integrate with other blockchain for consensus (Paper on Arxiv)

Slide 21

Slide 21 text

Copyright 2018 Aaron Li ([email protected]) machine learning on blockchain Ekiden Architecture Clients: lightweight end-users who create smart contracts, and provide secret input Compute Nodes: nodes capable of spawning TEEs and run contract computations Consensus Nodes: maintain the shared state on blockchain, append TEE results and verify (Screenshot from: Ekiden paper on arxiv.org) (TEE = Trusted Execution Environment, more details available later)

Slide 22

Slide 22 text

Copyright 2018 Aaron Li ([email protected]) machine learning on blockchain Ekiden Ethereum v.s. Ekiden-BT

Slide 23

Slide 23 text

Copyright 2018 Aaron Li ([email protected]) machine learning on blockchain Ekiden Example machine learning use cases & code Credit Score: (credit:train, credit:infer) Smart contract provides a shared logistic regression model Clients sends feature vectors and targets (confidentially) to the smart contract for training Other clients may query the contract, and confidentially infer credit score for new data Allow everyone to…
 train and improve the model with their own data
 share a better, common, trustworthy credit score model
 preserve the confidentiality of all their data and inquiries Code: https://github.com/ekiden/contract-dpcs (* has a private submodule, waiting for them to release)

Slide 24

Slide 24 text

Copyright 2018 Aaron Li ([email protected]) machine learning on blockchain Ekiden More examples & use cases & code Temperature prediction: thermal:train, thermal: infer
 Building system samples temperature from IoT sensors every 20 seconds
 Data is used collectively to update a (non-linear) least square model for temperature prediction
 Both model and data can be kept secret, even though the system is on blockchain EVM (can run Crypto Kitties) ERC20 Tokens Poker Examples in addition to machine learning (* has a shared, private submodules, waiting for them to fully release) Code: https://github.com/ekiden/contract-iot-learner Code: https://github.com/ekiden/contract-evm Code: https://github.com/ekiden/contract-token Code: https://github.com/ekiden/contract-poker

Slide 25

Slide 25 text

Copyright 2018 Aaron Li ([email protected]) Ekiden Imported Ingredients Tendermint ~10k tx/s (for ~250 bytes transactions), 1 second latency
 Byzantine Fault Tolerance + Proof-of-Stake system
 “Barebone” blockchain with general interface (ABCI)
 Open source, written in Go, ported to Rust in Ekiden Trusted Execution Environment (TEE) Supported by some latest intel CPUs (SGX) & motherboards
 Large cloud providers are beginning to support it
 Available on IBM Cloud (May 2018) via Baremetal Servers
 Google launched open source framework Asylo
 Azure launched trial in Sep 2017 (currently no longer available)

Slide 26

Slide 26 text

Copyright 2018 Aaron Li ([email protected]) Tendermint What is Tendermint? See detailed documentations

Slide 27

Slide 27 text

Copyright 2018 Aaron Li ([email protected]) Tendermint Tendermint Core Maintain consensus (e.g. what transactions occurred, in what order)
 Communicate blocks (e.g. broadcast block of new transactions to every node)
 Sharing states (e.g. account balances, smart contract results, etc.) Application BlockChain Interface (ABCI) Supports Go interfaces, sockets, and gRPC
 Defines application-specific operations on blockchain, e.g.
 update & transfer balances, account queries
 validating transactions / accounts,
 …. many more

Slide 28

Slide 28 text

Copyright 2018 Aaron Li ([email protected]) Tendermint Application BlockChain Interface (ABCI) gRPC interface https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto

Slide 29

Slide 29 text

Copyright 2018 Aaron Li ([email protected]) Tendermint Ecosystems Other blockchain projects built on Tendermint Ethermint - A fast Ethereum based on PoS consensus, based on Tendermint, supports hard spoon (Ethereum mainnet account balances are replicated) Cosmos - A network connecting many (PoS) blockchains (based on Tendermint) and facilitate Inter-Blockchain Communication, asset transfer, and more …and many more…

Slide 30

Slide 30 text

Copyright 2018 Aaron Li ([email protected]) Trusted Execution Environment Example: fully isolated environment - enclave TEE Guarantees code and data loaded in an enclave are… Confidential Untampered By anything outside (applications, even the host) Implementation: Intel Software Guarded Extensions (SGX), built inside CPU Allow a program on SGX-enabled machine to create an enclave

Slide 31

Slide 31 text

Copyright 2018 Aaron Li ([email protected]) Supported Hardware TEE Does your computer support Intel SGX? Tool & List: https://github.com/ayeks/SGX-hardware

Slide 32

Slide 32 text

Copyright 2018 Aaron Li ([email protected]) Cloud Vendors TEE Where can you get SGX enabled servers? (See list & reports) (August, 2018) Check this IBM blog

Slide 33

Slide 33 text

Copyright 2018 Aaron Li ([email protected]) Open source framework TEE (August, 2018) Google Asylo (v0.2): https://asylo.dev/docs/guides/quickstart.html Quick start tutorial + code https://github.com/google/asylo/tree/master/asylo/examples/quickstart Hello world code https://github.com/google/asylo/tree/master/asylo/examples/hello_world supports simulations, docker image, protobuf, full life-cycle

Slide 34

Slide 34 text

Copyright 2018 Aaron Li ([email protected]) t.me/qokka_ai medium.com/qokka linkedin.com/in/aaronqli polymorpher fb.com/ai.qokka scale up language understanding understand the world’s attitudes, opinions and emotions at massive scale we are hiring engineers! angel.co/qokka/jobs Decrypt crypto emotions and trends (private beta) CryptoQokka.com