Dominic Wörner - Extending ETH with ICP: Leverage the decentralized cloud from Ethereum

EthereumZuri.ch 2024 · April 2024 · 58:04

Dominic Wörner of the DFINITY Foundation shows Ethereum and EVM developers how the Internet Computer can extend their applications. After an overview of canister smart contracts, the reverse gas model, timers, HTTP outcalls and threshold signatures, the workshop looks at using ICP as a coprocessor or as an orchestrator across several EVM chains, with Rust code examples that read Ethereum logs and send transactions. Resources for getting started with the developer tools close the session.

Speakers

Topics

From EthereumZuri.ch 2024, hosted by EthereumZuri.ch.

Transcript

all right um good morning everyone so maybe a quick question so who of you has worked with ethereum or another evm chain before so did some solidity coding and who of you has worked with ICP before and build a canister okay couple I know these guys already yeah okay um so today today I want to talk a bit about um how ethereum application and ethereum or evm developers can utilize some of the cool features of the internet computer to extend their decentralized applications and I will give also a bit

of an intro um about the internet computer that everyone is a bit on the same page and then show a couple of examples and do also a bit of not really coding um but yeah we we will see some code and you can try interact ly to follow some steps or you can also just watch and enjoy the show and hopefully at a later point in time at home with some more time um you install DFX the command line tool to interact interact with the internet computer and begin your real journey so but before starting um so um I was introduced as um from ICP um but I'm officially employed with the

definity foundation um we are actually here in surich um close to the close to the lake um we are a Swiss Foundation founded in 2016 and with the goal to build this internet computer this um world computer platform that can host um really powerful smart contracts um we we are around 250 people around the world most of them are actually here in syk so we have also a lot of events in our offices so you should come join and talk to us or you can also um yeah hit me up and we can have a lunch um at the headquarter um mostly we have a lot of cryptographers

and distributed system um experts and also formal verification and so on um but there is also me um so I I work as a Solutions architect and I'm working mostly with the ecosystem team so all those Builders and entrepreneurs who want to build the next cool thing and for that one to leverage um a truly decentralized platform um I'm here in Zurich but originally from from Germany and I've been in the crypto space for quite some time so I started during my PhD um here at eth syc where I came across Bitcoin and was totally fascinated um then later on with ethereum and now finally um I'm I'm trying to work with all of them um but

from the the safe corners of the internet computer yeah so let's get back in time a bit so almost like what is it 15 years ago um almost um there was this breakthrough um that we could build a digital currency and payment system um that is purely peer-to-peer without a central party without a central issuer and of course in the beginning um it took quite some time until people um figured um yeah could wrap their head around and I still I think many people still haven't um but also in the early years a lot of people thought about what can I do um else with this technology and

there were little experiments like building a DNS like system namecoin um or there were experiments like building um a decentralized file storage system so C coin for example and like all these experiments where you um had to build a whole trust Network um from scratch and it turns out this is really hard um so um then viik and others came around what um could we do to make basically a decentralized platform where you can then just build decentralized applications on top just as as apps you don't need to have buil your own chain and Trust um model you can just build smart contracts and so the idea um of

ethereum was born and the goal was um yeah to build a world computer but as we known now um I'm not really sure if this goal has been achieved um so when you look at ethereum smart contracts they like ethereum is the most important smart contract platform but it's still um it's about yeah um building new types of digital currencies new types of digital assets and how to manage them and move them around now there is another use case on storing blocks and verifying um Z knowledge proofs from higher layer structures but still you're fundamentally very limited um what you can do so when you've worked with

solidity and on the evm you notice it's not like building a traditional um program on a computer you you have like severe um limited memory you have severe limited computational capacity um you have often High fees and they are um unpredictable in a way um you have a pretty high latency um so block um until it's finalized um on on ethereum are like 15 seconds um um yeah and you're also Limited in the sense that um you really have only access to what's currently in the state you don't have any information about the history um on chain and you don't have a

good access to the state of all those hyper structures layer tws that are built on top of it we have the Oracle problem so we can't just like um yeah call out and um get I don't know weather information or Price information um and with all those layer twos we also um face um fractured liquidity and lastly it's also hard to to host your user interface on it so you always have this um centralization point and we will see later that this is really a problem especially in in the defi world so Dominic Williams the other Dom um

that like in the early days were in the ethereum community and was part of this effort to build like um ethereum version two so to say the the the original sharded idea of ethereum um but like the vision diverged a bit and so he started off and um assembled an awesome team to build the the internet computer which is um essentially the the idea to build um a crypto Cloud so this means you have all those features that a blockchain or a crypto smart contract platform has like the the resiliency sensorship resistance um temper proofness and the

ability to tokenize things but on the other hand you have the cloudlike scalability model um so you can with more demand you can increase the capacity of the system and now we'll look a bit uh let's maybe first start with that so um the the basic fundamental unit um that runs on the internet computer are called canisters and we often call them canister smart contracts because similar to ethereum they run on this temper proof blockchain infrastructure so they have um similar trust guarantees um but they are much more powerful and I want to give a couple of examples

um so the internet computer is not an ethereum virtual machine we will see you can build actually an ethereum virtual machine inside such a canister but at its core it's web assembly code um and memory so web assembly um is a w3c standard and it's a bite code standard and it's very fast so close to real barebone metal um so not that convoluted than the evm and you can um program in the languages that you know already for example Moto no probably you don't know Moko but so motoko was actually the the first language to Target the internet computer

and is the most elegant uh way to build on the internet computer and it was designed by Andreas rosberg um who is also um one of the main architects of web assembly itself and he was part of definity for a couple of years um but you can also use JavaScript rust Python and C um uh C++ to build applications and later we will we will do bit of programming in Rust um the whole canister model is inspired by the actor model um so those canisters interact with each other by sending message between each other um we also have what it's called the reverse

gas model and what this means is when you have interacted with ethereum or other chains um you always as the end user you need to use a wallet and you need to have um the gas token basically to pay for every interaction um with that chain on the internet computer we turn that around so that um you can put Cycles in this canister SO gas in our language is called cycles and we um put them in in in this smart contract and then users don't need any wallet um any specific gas token to um to interact with the smart contract so it's a bit like one part of

the um account abstraction um um discussion is is already um solved here at the core on the internet computer then the other part is you can directly um interact from the browser with it or with other like traditional applications because canister smart contracts can process HTTP requests um directly and they can also perform outgoing HTTP requests so you can call um web apis and and get data we will come to that um later on because it's also very useful to talk to other chains um then it also the the system provides access to timers so it can be

really an autonomous um smart contract so you don't need to Peak it from the outside um it can run crun chops basically and it has access to unbi biab Randomness um directly from our threshold cryptography um consensus protocol um coming to that it has also access to a lot of cool threshold cryptography features that are always extended over time so currently um you have mainly access to threshold EAS DSA so e DSA is a particular digital signature signing algorithm that is widely used in the web fre ecosystem so Bitcoin used it because there were patterns on a much better um digital

sign digital signature algorithm and so ethereum and a lot of other chains um copied this so ecdsa is what is used to authenticate transactions in a lot of um blockchains and canisters can basically um sign messages so the internet computer um has the um ability and um uh to to facilitate um signing on behalf um of the canisters and another cool feature of this whole uh threshold cryptography is that the state and all the messages from the internet computer are also certified

by a BLS um multi sign or threshold signature and what this allows is that um um yeah a user outside of the internet computer basically just needs one uh 48 48 byte um public key to verify all the state and all the messages from the internet computer so you don't need to calculate the whole blockchain history um you can just verify a signature and the canisters allow for a very flexible control model so not only immutability um as in ethereum but um by default the developer is the controller and then the the um you can build things like either um

building um canisters that are owned by the end user eventually so user owned applications um or you can give control um over to a Dao we call that SNS or like the main framework used on the internet computer is called service network system um SNS but you can also remove all controllers and then it's essentially immutable um so with that so how is this possible um let's talk a bit about the architecture of the internet computer so as always um you start off with some notes and on the internet computer it's it's not like Anonymous um people running um nodes on Virtual machines

owned by AWS or Google Cloud um but it's really independent um node providers that are doxed so they have public um public identities they need to buy um quite expensive um Hardware um to contribute to the internet computer so it's a um yeah there is a specific specification um that you need to have and you need to be um in a in a proper professional data center with proper internet connectivity so it's really not the run your note at home type of network but targeted for really high performance um applications so it's also not allowed to

run your note on a on a virtual machine or on a public cloud and then the internet computer protocol um assigns these noes um in a manner that we call deterministic decentralization um into subnets each subnet is essentially um its own blockchain um so we don't have like an ethereum um one chain and um a huge replication Factor not 10,000 nodes running the same computation and storing the same data um but we have smaller um um blockchains where where we only have like 13 to like

40 or 50 nodes so we have much higher efficiency um because of that um and the deterministic decentralization decentralization factor means that um the internet computer protocol and we see later a bit how that really works um like tries to make those notes as independent from a um jurisdictional and um T location um point of view and yeah this is the cloud-like feature so we can add ever more of these subnets and increase capacity and all these subnets together form one uniform Computing environment to run these

canister smart contracts and there there's from a programming point of view no difference um if two canisters when they send messages between each other um if they're on the same subnet or if they are on different subnets and in many real world use cases um you actually interact with a lot of canisters on a lot of different subnets and you even know about that um there is of course when when messages are sent between those subnets you have much higher latency than when it can run on a single machine basically um but from a programming point of view um it you you don't know notice it so as I said this is the idea of ICP

um as the crypto cloud and this um whole network is governed by a DA the the network nervous system um so in in this St to participate when you have ICP tokens you can stake them in what is called a neuron and depending on how much you stake in that and for how long you stake it and for long for how long you have staked it you have a certain voting power and when you vote um so you help govern the network and you get a reward for that and when these proposal are accepted then it gets automatically um executed in the network and this is like

at the moment how this deterministic decentralization works um so people are like um making that basically by hand and proposing it to the DA in the future we hope that many more of these um yeah things can really execute it autonomously so everything is calculated basically on the internet computer itself and you don't need so many um yeah human interaction that is then approved by a da um the cool thing about that is since the whole network is really governed by a DA this allows to um to have a real adaptive evolution of the network so essentially we have like a new

release of the internet computer software like every week um and um people outside also definity are are verifying um these updates and and proposals and when it gets accepted then it gets really automatically um enrolled um on all the all the subnets of the internet computer okay now a very quick comparison I hope it's big enough but it's also doesn't matter that much so quick uh comparison with e ethereum so there are a couple of um yeah stats basically but what it basically tells you is ethereum is very very limited and um the internet computer it's like from a cloud

perspective it's still a bit limited but in comparison to what you know from um from blockchains it's like a huge difference um so for example when you look at um how much data you can store in a canister or how much memory you have um it's a few kilobyte um on in ethereum smart contract and it's currently 404 gigabyte um in a in a canister and I I want to to move that a bit in in the perspective like on on the right side side here um you see on the left is like a single server and then ethereum uh then the internet computer and um ethereum and we have these two

AES or the these AES um about um scalability and decentralization so of course when you have a single single server um it's very um scalable basically or I mean you can still add additional uh additional servers there but controlled by by a single entity um you you have a high capacity and scalability but you have very low decentralization and ethereum is on the complete other end of that Spectrum who really um wants that everyone on Earth can run um its own note and can be part of the network um and the internet computer makes a trade-off between the two it it it aims for like sufficient um

decentralization um but uh to provide also like really uh a good Computing environment where you can actually build stuff all right so what can we do with that um so I said um we can process HTTP requests with canisters so this was um a tweet by uh run um this week so run is the founder of maker um this over collateralized um stable coin um that is very popular die um on ethereum and there's new regulation upcoming in in Europe um that essentially um every everyone that hosts

um a defi front end for a defi application um needs a uh Mika license so it's like a big deal um so how can we use the internet computer to do something about it so we can host your defi front end on the internet computer and if you want um you can join me to yeah to essentially as a demo um yeah deploy the Unis swap front end as it is live right now um on the internet computer but you can also um just follow me doing it um let's see oops oops oops oops so okay here I have like yesterday

forked um a version of the Unis swap front so they under GitHub uniswap SL interface um there is the Unis swap interface and it turns out it's broken um so I had to to Fork it and and fix a couple of things to to make it actually work and I also um added like a if you know git pod it's like a visual studio code kind of thing um in the cloud um so you can just it doesn't work for me on Chrome that's why I have to um use it on Safari so it basically loads up um an editor and a virtual machine where all

the dependency that we need are already um installed and it will probably take some time so again the goal is to take um an existing front end um of some ethereum defi protocol and um we want to deploy it on a decentralized cloud the the internet computer right still loading so when you look at this um

repository I added also the the things you still need to do um to make it work um so you need to have this DFX installed which is in this environment um then already installed or it should be installed this this happened hopefully somewhere here um and now we are still like normal deployment steps of this Unis swap application so yarn installs all the JavaScript dependencies and then we build um a production um asset and what you need to do is let's open here a new terminal can you see that actually is this fine all right um okay open new ternal and we need a

configuration file for the internet computer and this is called DFX dojon so we create a new file DFX do Json this is now here and then we just copy paste this here and I will oops explain it in a second all right so this basically is a configuration files of the the canisters that we want to deploy on the internet computer and we have one canister that we call interface it will be a frontend type or asset type canister and what we will need to give him here is basically where here in this directory he can find

um those yeah the build artifacts so the final minified um HTML GSS CSS and so on um and it needs also the entry point so what HTML um should the actual domain um paint point to so this is still taking some time this build process um maybe we can use this time is there any question so far um on the internet computer on what I'm showing here all good is any yeah please

um no no no uh so not really um yeah someone needs to to pay for it but like everyone can top up a canister so it's a completely permissionless process you basically um yeah that there are Services where you basically send ICP and it will convert it to this Cycles this gas form and then put it into a canister and this is like totally in the crypto world so you don't need any like identity um around around that the the bigger problem um we are having here still is like the the the domain um so if you want to yeah a human friendly

domain um yeah you you still have yeah need someone having that domain we are also working on that it it's been a bit paused we are working on something called a chain name system um which is a a decentralized um naming system on the internet computer that will be DNS compatible um but it's currently um on on hold because of other priorities but this is something we we're looking into and and want to solve as well um yeah that's okay is someone trying that as well um at right now yeah okay maybe I should have not

done it in gitpod because when you do it locally it will be faster but we're getting close here one one cool thing that we introduced recently so we don't have a test net on the internet computer a lot of um web 3 developers always want to deploy on the test net and and we don't have it because the internet computer is also because it it is like these many chains it's hard to to provide like um yeah a proper copy basically of it so what we have is you can run a local version of a single um internet computer instance basically um on your local machine and we also have um a playground

um these are basically some pre-provisioned canisters on the internet computer that you can basically rent for 20 minutes and this is what we will do here so we deploy this application on one of these uh pre-provisioned canisters so it it's really there on the internet computer and everyone in the world can interact with it but in 20 minutes it will be gone again so let's see if this works yeah okay we have DFX so when this is then finally ready it's still optimizing what time is it I don't think so um I think that there

is real value in this like massive replication um for for certain um very important um yeah assets and and smart contracts so this is also why I um want to frame this as how um how the internet computer extends ethereum and like this is one example um of that and we will see when when we have the time um to see a couple more but I don't think like I think there's real value in in in a system where like if there's a takeown like now a lot of notes are of course on AWS and so on but um the I think it's um it's a bit selfhealing so to have the this um property um that when there is a

takedown on AWS you can just run your note um at home um I think this is very valuable to have this but this limits what what you can do with it so there is place for both of these types of systems all right um it is ready so hopefully so what I'm doing now is with this DFX command line tool there is the deploy command and this will read this DFX do Json um and do what's in there and we will use this playground flag as I explained to um deploy it in this playground canisters and also typically you need to

set up like an identity that this does that in in the in the background so basically it creates a new private public key pair um of course to authenticate against the internet computer and when you really want to deploy on the internet computer itself you also need to have some Cycles in your account to pay for creating a canister and uploading stuff to it um and you can learn that um on yeah the developer portal on internet computer.org how that works um but you can also get started like that without anything um um using this playground flag so what it's currently doing um the asset canister um that hosts these static assets is like a rust built um canister

with some features um and we now like Chunk Up um these these quite big assets of Unis swap I don't know it's I think it's a couple of hundred megabyte for this simple application um and chunks it up in small pieces and then uploads um these pieces um to this canister on the internet computer so this also um takes a bit of time but shouldn't take too long and this asset canister also directly supports what we call um certification

so this all these assets will be stored in a hash tree um in in this canister and so the root of this hash tree will be part of the um system hash tree of the internet computer which every second basically of this subnet gets signed by a BLS threshold signature um so when you have a a client that supports this verification it can really check that these assets are authentic from the internet computer by again um um calculating the hash tree route and verifying this one signature from the internet computer and this is really taking so

long because it's really um couple hundred megabyte yeah yeah mhm okay yeah the the SSL CER ific Ates this is something something else so um like the verification that's happening

here is on on application layer basically um the SSL certification this is actually what's it's terminated at the the internet computer currently has boundary nodes um and they like the these are mainly or at the moment that they are still run by um um by definity we're in the process of decentralizing them as well so adding them to the um to the protocol um and they terminate the the SSL connection but the the actual assets um can be verified on application layer so you don't need to trust the D SLS SSL connection and the boundary noes um and and if you run a local proxy if

like there's always this issue on Trust on first use here we are basically downloading also um the thing that actually verifies those signatures but when you run it locally and we have the tooling then you can be really sure okay so now we have um we have uploaded the uni Unis swap interface to the internet computer and there it is so for the next 20 minutes you can enjoy Unis swap from a really decentralized architecture all right what else can we do um canisters are

really powerful so you can also build what you typically in application use then a nodejs back end or something like this for for it you can also build that on the internet computer and yeah it expands really what's possible um on chain um so like I think last week or for two weeks ago there was a video demo video of Dominic Williams or founder um which got got really viral um um where he showed that you can run AI inference um on the internet computer so image recognition it's not a super um like huge AI model but we are also at the beginning here but it really shows

how far you can um go with building things on the internet computer and on at our booth outside you can also um see that demo and what's cool is um because we have um the reverse gas model and we have a community project um that implemented sign in with ethereum like a cool library and the canister um that you can just use in your application you can basically um create an experience for ethereum used people I would say that they don't even know that they are interacting with the internet computer because they don't need um yeah ICP um or Cycles or anything and they can just

use metamask um or their other wallet as of their choice to interact with this application and so I think I'm here now with a it once mained so this is like the demo application a react um application No it should actually work I think and takes a bit long it also shows you that you can use for um ethereum application you can also use the internet computer like as a decentralized database so this is here

is only a simple example of a um key value store in the end but there are people who have all supported um um sqlite um on the internet computer for example I don't know why um why it takes now so long to load but yeah we can maybe revisit later it's also um no so the the blockchains the many blockchains of the internet computer are not public because you don't need to to verify the history um

to um yeah to trust the internet computer um you verify those signatures um so actually only what you expose in as an API in the canister um is public uh if you have no authentication um then you can basically choose what to public one thing at the moment of course node providers can in principle similarly then RVs AWS Engineers or operators can look into what's running on AWS node providers can in principle access um the data um but we are working on like putting basically the whole internet computer software stack into trusted execution environment so there is thing

called amdv SNP um which allows really to host a whole virtual machine inside the trusted execution environment and the goal is to really have the internet computer replica um running in this trusted execution environment that even the node providers can't Peak into to the state and what I quickly want to mention here um so with that um from an ethereum point of view where we have built a lot of dows um but mostly treasury management um is on chain and the back ends that are needed um and the front ends that are needed are still um centralized and you need some guy with a

credit card to keep it running um the the internet computer now allows really to expand the reach of dows and build um full stack Dows so really internet services that aren't controlled by a single entity and can't shut off by a single entity and you can make them immutable or you can what's in practically you need to change those things um you need to evolve with a changing environment so um um the model that is used on the internet computer um is to to have Dow control um like the internet computer itself um to evolve those applications and hinder

this um behind this QR code um you see um like a lot of these Dows that have launched on the internet computer with this framework called service network system so now I want to mention a couple of those real superpowers of the internet computer um so I I mentioned it before um we we have something called threshold cryptography which enables chain signatures so um the the chain can do signatures on behalf um of canister smart contracts so we have certain subnets on the internet computer where there are where key material is sharded like one um a master key one or more

master keys are sharded between those notes um with complex cryptographic protocols but allows them to do a multi-party computation to create signatures and not just for this one master key but you can derive um so every canister can derive basically an unlimited number um of public keys on that and ask for signatures on that and this means that you can like interact directly with other chains you can directly call ethereum Smart contracts you can hold Bitcoin um you can talk to Cosmos Che chains and currently we only have threshold EC ecdsa but we are

currently working on implementing threshold schnore um which then also allows to do Bitcoin Tapo transactions which is important for ordinal inscriptions and runes um but also interaction with Solana cardano and the pka do ecosystem also um the threshold schnore is also important to maybe Implement something like a decentralized certificate Authority in the classical sense because um there also these EDSA um signatures are used and you can really like yeah build trusted systems uh for the traditional world and you have a very simple API um inside the internet computer to interact

with that system from any canister so you can get P you can get your public key and you can um sign messages so we can sign but how can we get data from other chains how can we get State and I mentioned already that canisters can use HTTP out calls so you can call various web services and one thing that you can do is call public RPC endpoints of other chains so from infura anchor um and the like and you can um yeah call multiple of those to increase security so you can

can call three or five or whatever your trust model requires so you can be really sure um that you get um yeah authentic um information on them there's also um like experiments or that there is a proof of concept of building a light client and etherum light client on the internet computer and other people are working on other light light clients on the internet computer but this gives you a very fast um access to to start experimentation maybe not the highest security but you can make it very high with increasing the number um of of services you call and one convenience canister um that we have on the internet computer um that we've built is the evm RPC canister um so it's um a canister

that yeah that that manages API Keys um for multiple of this for really long list of these cloud service providers and it basically allows the canister on internet computer to call an ethereum or not only ethereum but all the l2s and other EVMS um as if they were um a smart contract on the internet computer itself and there's a site yeah yeah yeah so so this is what I mentioned here this evm RPC can

has those um API Keys um in the stored in the canister they they aren't public they can be accessed by the node providers in principle so you should when you do something like that you should like have an eye on the usage of those that you can revoke um API Keys um if it gets misused so this is like yeah an an issue like a tradeoff you have right now when we had um service providers that would basically allow for example that we do an um authentication based on ecdsa signatures then we could really make it super nice this is like a practical trade-off we need right now and this practical trade-off gets much better

when we have this trusted execution environments all right I need to speed up a bit uh so one quick side note um I want to mention because in a couple of weeks there is the great Bitcoin havening event um so with Bitcoin we went one step further and there is the subnet on the internet computer where um on the side of the internet computer replicas we run part of the Bitcoin protocol stack and we have um a Bitcoin canister on the internet computer that is kind of a light client um for Bitcoin and um it exposes the whole Bitcoin utxo set plus some utility functions to um to see how are the fees currently on

bitcoin so you can really build uh easily build smart contracts or canisters that that interact um with the Bitcoin Network natively and the main example I wanted to show you today um is using a canister on the internet computer as a co-processor for evbm smart contracts and this idea of co-processors is an old one so you have this um General like the ethereum general purpose um smart contract but for many things you see that you are very much limited because of the things I mentioned on the very first um slide um so you want to um put some of that work you have to do um to a yeah to

another Computing environment with minimal trust requirements and as it turns out it's relatively easy so I've built that in a day um to build um such a system um that basically allows you to to access all the things the internet computer can do like access huge amounts of memory um it can run long running computation so we have something that is called deterministic time slicing which allows a computation um be running over multiple blocks so you're not um um restricted by the by the block gas limit um so to speak you can call um all the external apis also other chains

um you can access historical data and and so on and so forth and the idea is pretty simple um so we have a a simple smart contract um on ethereum um that um you can send a job towards it and it basically emits an event and on the internet computer we have we use the timer to periodically um fetch the event lock um from from ethereum um look for those events um do the computation or do the stuff um that the ethereum smart contract wants to do maybe it wants to run some AI inference who knows um and then use threshold

ecdsa to create a transaction and send it back um to the ethereum smart contract and yeah when you look at this behind this QR code or and this URL there is like a first simple version of that it has some issues um um but I think it's a it's a pretty cool start and when you look in this um repository so it's now a rust based so maybe first so in this repository you find the solidity smart contract which is very very simple um as I said and you have then

the internet computer projects we also have this DFX do Json and we see we have one canister this co-processor canister we also make use of this evm RPC canister to to get the the locks and so on um and that's it on the internet computer side then when we look at the configuration um of the of the r project for this canister um you will see besides like the classical stuff that you need to to work with ethereum um like ethers we have this IC cdk this is the rust based um SDK or canister development kit like

a library to interact um yeah with the system API of the internet computer and um implement the interface um of the canisters and we also have um two other like convenience libraries one is this uh library to create these timers and then one is not so important at the moment but like data structures to keep um yeah to keep data available when you upgrade um a canister and then when we look at the the main code it's um pretty simple so we have these um macros um from the cdk

so this is getting called um when the canister um gets deployed and in there we will spawn this interval um so here every 60 if uh every 60 seconds every minute we do something and what we do we We sync locks um so this is where we use the evm RPC canister um to basically um fetch the the ethereum loock and pars the event and when there's a new event we call processed job and here we do here we can do all kinds of things but I've

did something very simple so I use the uh Randomness system API to to fetch some randomness of the internet computer and then um submit the result back to to ethereum so I prepare a transaction then there is a bit of the issue to do proper gas calculation which which is also on the sepolia test net um a bit of a um yeah nerve-wracking process at some at some time to to get that right for all cases and then we use the evm RPC canister to send the transaction and yeah um I wanted to show

the demo as well but we don't have that much time unfortunate one thing I I want to mention is um based on a similar kind of architecture we have built um a nice and useful product um called um CK eth and CK C20 so these are um um basically representations of eth um and ec20 tokens on the on the internet computer and they are fully smart contract controlled so no no a non codal Bridge um um you you can say um and then when you move your e or your erc20 tokens to

um to the internet computer um you can really um yeah utilize the low fee um environment of the internet computer and the low latency so 1 second um finality in contrast to um 14 or 15 seconds um and you can plug into smaller defi ecosystem on the internet computer if you want um cool so if you're now ICP pilled and want to get started and extend your ethereum applications with the superpowers of the internet computer I invite you to to use some of those links um so the first one is the developer

portal um yeah which gives you all the documentation then we we recently did the zero to depth series with encode where um a lot of the engineers at definity um gave lectures which um gives you an overview of all the Core Concepts um of the internet computer um you should join the Forum on the def Discord so there um I'm also very active so I'm D there so hope to um to see you around there and yeah thanks a lot you can also get this presentation um behind this QR code [Applause] well we have a couple more minutes do

you want to take any questions sure anyone are there any questions there's one uh yeah I mean like did these things I mean this is like a a very non straightfor forward process how this this all evolves um so I I think like at the moment the incentives are very much like that that it's um yeah there's a lot of incentive behind creating your new chain your new system um so for the next couple of

years I think we will have like a lot of new chains layer ones layer twos this is already happening right and the the internet computer fits in this world um by providing the connectivity clue glue behind that with HTTP out calls and threshold cryptography you can orchestrate all the systems um um from uh from the internet computer um I think eventually we will also see some kind of um consolidation um but I think this ideas of building basically um some applications as verifiable chains I think that this will be a pervasive

concept already over is and there will be the possibility to to build your own chains on top of ethereum to inherit some security and there will be also the way to uh much easier build chains on top of the internet computer and hopefully all of those will um will connect very well but I think the I think smart contracts and this idea of um public verifiable secure computation and DOW controlled or user controlled systems I think this Genie is out of the bottle and we and yeah a lot more um software of the world um will be created um in that way thank

you anyone else one more minute MH so like everything what happens on on ethereum of course doesn't include any Cycles right but for fetching the locks you need to to pay Cycles what's pretty cool um when you look at this um this project in a bit more detail one thing um it is included is when someone sends a chop request like a processing chop request on the evm site to this contract

um it requests some e as payment and it will directly move those e to the account controlled by the canister um so the canister can then easily pay for the ethereum transaction but you could easily also put some um part of it um basically in CK e and from CK um convert it into Cycles on the internet computer and fuel your canister with it so you can built like an autonomous system that can be paid by the actual users without human inter evolvement

Related talks