AI That Is a Smart Contract, Why and How? Dominic Williams, DFINITY Foundation
Crypto Valley Conference 2024 · June 2024 · 21:22
Dominic Williams, founder, president, and chief scientist at DFINITY, argues at Crypto Valley Conference 2024 that fully decentralized AI can only be achieved by running AI systems as smart contracts on public blockchain infrastructure. The talk covers why current AI deployment models, centralized on a handful of cloud providers, work against the kind of decentralization AI ultimately needs to remain trustworthy and censorship-resistant.
Speakers
Topics
From Crypto Valley Conference 2024, hosted by Crypto Valley Association.
Transcript
it's off it is my absolute pleasure to announce our next keynote speaker the very inspiring and amazing Dominic Williams founder president and chief scientist of defin Foundation uh hello everyone um so uh today we're just going to talk about um AI running on the blockchain so there's been a lot of talk about AI in the uh blockchain space recently and people mean different things um when they talk about Ai and and in blockchain um generally speaking um outside of the internet computer ecosystem it means that you know the AI is centralized it's
chat gbt or something like that and they've created some kind of smart contract connector or something like that um that's not decentralized AI there's only one uh form of decentralized AI and that's AI that runs on the blockchain itself unless you're running AI on the blockch CH it's it's it's clearly not essentialized it's something else so uh I want to talk to you today about AI running on the internet computer blockchain as smart contracts uh so if you've not heard of uh definity before I work at definity I'm I'm I'm the founder I'm Chief scientist uh with blockchain's largest R&D operation uh projects been going since 2015 so we're coming up for um 10
10 years uh we have a a-story building in central Zurich not far from here uh where we have just over half of our worldwide team um kind of unusual we for for many years I think the largest team of cryptographers on the planet uh so it's it's a pretty impressive team um today this far like the internet computer um has has really been cre with as the product of more than a thousand years a thousand person years of R&D effort which gives you an idea of how much has gone into making what I'm going to show you um possible so the purpose of the internet computer is rather different um to the purpose of traditional blockchains we're
we're focused on um bringing compute onto blockchain so we think that you know eventually uh most systems and services will run entirely from the blockchain blockchains really are future computer stack brings all these amazing advantages you know you build with code on a blockchain it's tamper proof doesn't need protection from cyber security like firewalls and anti- malware uh it's Unstoppable um at least within fault bounds um you can make it autonomous on a public network um smart contract code and re in reimagined form you know serous uh code is is composable and and and and so on so you know today blockchain primarily if you look at the
ecosystem is kind of about nfts and mem coins and Defi and you know when people say web 3 is built on a blockchain what they mean is it's built on Amazon web services and um you know then you kind of get bumped out to buy an nft with metamask or something at some point internet computer is a different approach everything's on chain uh and it's you know blockchain like Cloud it's it's the world's only Third Generation blockchain in existence today and it's blockchain playing the role of cloud it's uh infinitely horizontally scalable um smart contracts serve web you know they process http so you can actually have a session a secure session with a smart contract you don't even need crypto wallets anymore smart
contracts can pay for their own gas it's called a reverse gas model this actually is the dashboard currently and um interestingly enough I I just say look you know today the internet computers processing uh the computer equivalent of 350,000 ethereum equivalent transactions a second so if you look at the virtual machine instructions that the blockchain is processing um and compare that you get this stunning figure but but this is growing all the time I mean we actually think this is small which is ironic right we think 350,000 e theum equivalent transactions a second is is low since the network uh enter production in in 21 May 21 just over three years ago um the amount of compute
the amount of smart contract compute running on the blockchain has tripled every year but we think it's going to increase much faster and actually ironically just as I left the office today in in Zurich I I saw that the it was it was processing more than 365,000 um transactions a second but I actually updated this deck two days ago to say 350,000 right so the growth is the growth in in smart contract computer on the internet computer is pretty pretty substantial and and this deck can't even keep up with it I I think that eventually we're going to get to a place where you're looking at like 10x growth a year in terms of computer on the network and um there are lots of reasons for that but key one is is is is going
to be ai ai uh you know AI smart contracts um ex you know involve a lot of instructions um being processed so again you know if you're new to the internet computer like it's a very different kind of thing to a normal blockchain it's the only Third Generation blockchain in existence uh you know you can build anything um on on the blockchain using canister smart contracts and what we say is full stack decentralization so there are kind of social networks running on the internet computer today something called open chat I think that screenshot is from you know every chat message is a transaction all people's chat history is on on the blockchain uh you can send people video chats image chats um it also works as a layer to for other blockchains so uh for
example you can send people your chat account on that service is also a kind of crypto wallet but it's a crypto wallet that you don't need a crypto wallet for you just authenticate yourself to the smart contracts that are creating the user experience for you you're now basically interacting directly with a blockchain and in a secure session and that's why you can just send somebody Bitcoin in a chat message right you can send somebody Bitcoin um and it'll be transferred in just over a second and uh and many other things too it's now getting composed with defi um you can do different things so defi is pretty new on the internet computer we are compute focused but it's now evolving it's taking different forms um this is an AUD book the middle thing is
an AUD book Dex um and uh you know traditionally we're looking at like liquidity pool dexes right like Unis swap it's not possible on a traditional blockchain to credit a book tax on the internet computer people have created aut book taxes and they you know that's like coinbase right Kraken but made with smart contracts and you can put these kinds of things under the control of a dow and make it autonomous and transparent uh the internet computer's never gone down there's never been a hack like so if you think about like open chat The Social Network there's all that crypto side of it right because users use their open chat accounts as crypto wallets and they send crypto each other to each other with chat messages there's no cyber security protecting
that service open chat runs without a firewall without a security Team without without anti-malware miraculous right well that's what happens when you're building 100% on the blockchain and that's why you want to do it and that's why uh this basic technology you're going to see it um becoming very important in the sort of Enterprise and government spaces because uh you know again this is third generation pushes this into new territory where blockchain becomes an alternative it stack and you can build fully on chain um and you can you know resolve these really big problems like cyber security uh cyber Crim is going to cost the world10 trillion do next year imagine that1 trillion um and it's going to be accelerated by by AI um so uh
these are really big things the internet computer solves the latest thing is AI um you've always been able to run AI on the internet computer um because of its capabilities but what's changing is that we've been optimizing the execution environment so we can run AI faster and faster um and uh you know I mean trying to get your head around it uh there's a lot of differences with internet computer smart contracts uh currently um a single smart contract on the internet computer can store up to 400 gabt of data uh the web assembly bu code runs in um 4 G gabt of main memory and that's about to change to we're going to get a 64-bit wasm and those
limits will disappear they can process HTTP and run in parallel all this kind of stuff but um there's a bunch of things that together enable them to run Ai and AI to run fast uh needs things like support for simed instructions so those those are added a few weeks ago and um uh I I guess a couple of months ago now I did this um demo of a a neural network doing image classification a neural network running as a smart contract doing image classification and uh the first you know when when you and we're actually running running the image classification through consensus um on the internet computer transactions can run over multiple
blocks and each classification involved about 20 billion WM instructions being executed to give you an idea of how much computers involved with AI um but since since that uh we've got about a 10 10x speed up I did another demo 6 weeks later showing a 3 or 4X speed up Sim is just being added there another three 3x speed up um and there's a whole lot of other stuff coming uh as we're going to go to 64bit WM uh going to be able to hold much larger parameter sets in smart contract memory and and it'll be become feasible eventually to run you know large language models and you'll be able to have a chat with the blockchain so um you know we believe that AI will be the the Beating Heart of web 3 and uh
there are many reasons for this you know uh for example if you build like a on the internet computer there's something called yurl y r and it's kind of like a Tik Tok a fully decentralized Tik Tok running on the internet computer and one of the things those guys need is is is content recommendation that that actually requires in your own network if you want to like do content recommendation if you want to do web 3 you know effective web 3 that actually goes Mass Market because people want to use it you have to do things like you know AI based content recommendation you can also have things like AI Brokers and things like that so AI is going to be very very important to web 3 so what I wanted to do is just like show you three
examples of ways that uh AI can be used on the internet computer where we think it has application and then I'll just throw it open to questions if we've got time okay number one ethereum safety so um I'm sure you've all been to Ether scan and had a poke around and looked at the solidity smart contracts on ethereum and you know ether scan like looks at the code hash of the the ethereum smart contract and matches it to the source code repo on GitHub so you can see the source code inside these SM smart contracts the problem is most people can't read solidity code and even if they can read solidity code they probably don't have the expertise to
really audit it um is is that ethereum smart contract vulnerable to re-entrancy most you know the greatest disasters on ethereum involves re-entrancy flaws like the starting with famously the da in 2016 right does that thean smart contract have back doors you know is a developer rug pole possible uh is maybe there's some malware in that smart contract that will cause it to attack other smart contracts well um you know so the the question is like how do I know if I should trust this smart contract on ethereum so an AI solution is that you use something like a large language model that can interpret code and um you know it can look through
these smart contracts on ethereum and audit them you can check there's no re-entrancy vulnerabilities no back doors detected no malware inside and credit certification you know a blockchain certifications I called chank chanky cryptography on the internet computer so the blockchain itself can actually like um sign sign things um you can basically sign smart contracts on ethereum and then you know ether scan can show for smart contracts that past you know tick certified by AI audit um autonomous kyc example number two so this actually feeds into what I hope is going to be my next AI demo which is small contract that does facial
recognition so um you might wonder why want to do facial recognition on the blockchain so you know we're there's a challenge that's almost here like that dexes are going to uh um are going to list you know security tokens so uh you know we all know about rwa but actually in in in in Switzerland now you can tokenize the stock of your company um and you know web3 companies are going to want to um have the their stock their tokenized stock traded by dexes you know why can't I have my tokenized stock traded by you know available on Unis swap now um so you know a DJ and wants into secure this kind of thing like that's where we're going the the challenge of course is
that Securities like you know they have this the regulatory Frameworks um surrounding them and it's very unlikely that people are going to be able to buy Securities unless you've done they've done kyc or can show they're a qualified investor in America or that kind of thing so um what you can do with AI is you you can have like an AI smart contract that can match a face in real time you know the the smart contract can make sure it's not fake look left look right put up four fingers that kind of thing and match that person that it's looking at against a document like a a passport or a um driving license which has been separately validated with a government Source VI an API and you can then automate um kyc which makes absolute sense right because
a DEX is a dentalized exchange it should run autonomously like Unis swap 1 two 3 and four you can't even up dat those that code right it's created by a dow and once it's created it can't be updated it's fully autonomous and those kind of Frameworks really you know need to make be surrounded by as much autonomous infrastructure as possible and kyc of course is the kind of infrastructure and let's make that autonomous too let's have ai smart contracts running on the blockchain uh doing doing kyc so that's the kind of thing we believe in and if you follow my Twitter hopefully within a few weeks you'll see um uh if I can get we can get there like a demo of an AI smart contract uh doing facial recognition all right um last one
uh organizational intelligence so you're going to see obvious there are going to be these huge centralized AI models like chat gbt um and Claude and Gro right and these massive large language models are going to be backed by you know infrastructure of a colossal scale that cost billions of dollars and for that reason it will remain centralized um you know just the economies of scale that you get like Elon Musk just diverted a $500 million shipment of Nvidia cards um from Tesla to Twitter stroke X whatever it's called now so um that's going to stay centralized because
of the economies of scale involved but actually um there's going to be a that's not the long tale there are going to be millions of AI models right that do different things um most of your phones will already have ai models inside them that are used for photo retouching and things like that uh to give you an idea of the proliferation of AI um we're going to have ai models in our house that you know optimize when the thermostats turned on and off and things like that to reduce our energy consumption obviously Teslas are going to have AIS that do self-driving um AIS are going to be absolutely everywhere they're going to be millions and millions and millions of these AI models and with respect to optimizing organizations um you know imagine taking something like llama 3 which is whose
weights who's which has been trained um at vast expense you know probably a billion dollars expenditure has occurred training llama 3 but you can take llama 3 and you can run it as a smart contract so um you could use it to organize your your startup or Corporation or government department and uh the way that works is the um the large language model that's running as a smart contract um will download crucial data that your company uses so I'm obviously I'm Tech focused so I'm saying slack calendar email GitHub and jera right and it's the AI is taking that
information and it's putting it inside something called a context database um and when when you when you give it a prompt it's like you know it's got its existing weights from its training at mattera which enables it to understand language and reason and things like that and then it's using that in conjunction with the the context database which um is is the data specific to in this case your organization so um it's got all this information and uh you know you can maybe I can I can maybe say to uh you know definity it's difficult to keep track of an organization right with when you get to the hundreds of people it's difficult so I could say to let's call it delphy I could say to delphy hey dely who's running this team right um are they blocked by anything or has anyone
got any I need to make a tweet has anyone got any ideas for PR or a new tweet right um I can say Hey dely you know Yan or CTO over there I need a is is Yan free this afternoon can you make a meeting for me um Etc right it's going to be incredibly powerful um but there's a catch here right and this is where you see the role of blockchain the catch is what if this gets hacked like hackers know very well that AI has access to all of your most sensitive and confidential important data right uh and it's a Nexus for all your data like if you hack the
infrastructure that's running your an AI you can just get all the data in one place it's the ultimate Honeypot like security is incredibly important for for AI secondly what if it stops and I think what we're going to see is uh people and organizations becoming increasingly dependent on AI so if you go back uh 25 years to London when you wanted to navigate from one side of London to another you used this book called The London a toz and the London ATZ was a a map and you went from page to page and you planned your route you took it with you you put it in the the pocket of your do car door um but it was you know you you developed this skill where you could sort of look
at it once plan your route and pretty much get from one side of London to another without looking at the map now today most people can't do that anymore why because of satnav and we've learned to depend on satav and that part of our brain is kind of like withered right we use our brain for probably like driving around texting people probably shouldn't but you know that kind of thing we're thinking about things we're not thinking about how to plan the route and in the future the same kind of dependence you much much greater dependence on AI um to become valuable it becomes invaluable essentially so what if what if uh it stops of course the answer is you just run this kind of smart this AI as as a smart contract and then it can't be
hacked and it can't it's Unstoppable so this is why I think you know most of the a in the end will will run on they may be trained like some of the larg language models for for cost reasons will be trained in a centralized way like you know to to to understand language and so on but they'll actually and end up running on you know the different instances will end up running on the blockchain so uh you know AI smart contracts tamper proof Unstoppable autonomous is important too if you want you can put a smart contract um under the control of a dow so Comm a community control the the smart contract um we're working on things like we've got on the internet computer we're trying to create a new node standard you know Sovereign Hardware trying to create a new node standard for with gpus so that it's
becomes economically feasible to train these uh you know AI models on the internet computer um that's work in progress it'll take a while but you know we're going to get there um so if you're interested in this you know join us uh we've got hubs all around the world which are helping connect people interested in Internet computer technology of course if you're in Switzerland you can connect to us we we got a lot of people here um that's it thank you very much [Applause]