Workshop Room 3 - ETHGlobal Brussels 2024
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Transcript
e e okay hi everybody sorry for the technical issues but here we are uh thank you for coming um today I'm going to show a technical overview of morph L2 um I was supposed to show how to deploy your first smart contract but I'm going to skip that because I can't use my computer so let's get started so this is the agenda um we're going to see what is morph the technical side our sequencer Network our batching and submission contract our responsive validity proof how we combine the hybrid method between optimistic and CK and um the road map how we are approaching to mayet by uh the few the next few months so yeah let's get started um this is me I'm a real Dev Vel a relations at morph uh previously I was working as a solidity engineer in defi uh mostly and now I'm working as a depril and I would say it's more fun so who uh in this room know about morph no one okay this is good so we have a lot to talk about just you okay so first of all um we are uh ethereum L2 uh that basically we combine optimistic ckvm and a lot of people ask how that can happen and why we are approaching in that way we're also um a consumer Centric blockchain so we we know that there's a lot of uh infra projects but not really consumer applications so we really want to focus on bringing more consumers consumer apps to uh onchain so that's why we are focusing on consumer uh applications we actually have a track uh in this hackathon for Consumer Centric applications and we are also um very collaborate we have a very uh collaborative ecosystem we are giving a lot of different initiatives for our long-term Builders especially in this stage because we are in testet hsky B2 we launch in January and so yeah let's get started to review the technical overview so we basically have the centralized sequencer Network we have a hybrid rollup op needs CK we are approaching to have a fully CK rollup after mayet and we have a modular design let's talk about our decentralized sequencer Network so sequencers are responsible for producing new blocks in L2 right so imagine that a sequencer is a set is a group of participants who have a special job a special job which is basically produce and confirm new blogs to send um to send all of the transactions to the main L1 which in this case is ethereum um think of a blog like a page in a ledger uh book for digital transactions right to join this group participants need to basically put down some eth as a kind of of promise and this is this is a chaos so this is the whole diagram so the participants need to basically put down some eth uh and this is done through our staking contract then they go through an election to become a sequencer which we will open our right now we are running seven sequencers on testnet but we will open uh for partners after mayet uh and they will need to go through this an election process it's basically this is a way to make sure that only serious and committed participants um get to do basically this job once they're part of the sequencer set their main task is to take all of the transactions that haven't been confirmed and put them into blocks then they work together to check and agree that everything in those blocks is correct basically they use a method called tenderman uh you will see consensus tender and it's basically uh a way to agree it's like a straightforward way for all the sequencers to make sure that they're all seeing the same transactions in the same order um I would say this helps the network be more secure and run more smoothly and fast and also after they agree on the transactions these are official ually recorded onto the main L1 this process helps the network basically handle all of the transactions in a fastest way and this is the layer two blocks generation so following the bft consensus protocol the selected sequencer stricks all of the transactions from the M Pool and constructs the blocks and synchronize all of these blocks with other sequencers to go through the verification and voting the end result is basically the generation of the new L2 blocks basically this is the sequencer Set uh and this is basically blockchain networks to manage the transactions and to help process all of the transactions this involes basic basically a um technique called batching using something known as a badge submitter so normally each block of transactions will be sent to the L1 and this can be I would say pretty slow and expensive as we know ethereum is pretty expensive um so basically to solve this sequencers those special participants that we talk about use a basically a strategy they group several blocks of transactions together into what we call a batch and so at certain points in time these checkpoints the sequencers take all of the blogs that they've gathered and sync them off together using a digital signatures which is the BS signature this is a way to ensure that all of the transactions in the batch are valid and agreed upon and so they use a specific this signature can be also somehow expensive um but once the batches sign is not sent to just any part of the blockchain it goes to a special part of the main blockchain through something known as a rollup smart contract and so this is like a gatekeeper that checks um I would say checks and processing dispatches and the job of the selected sequencer is to send three things to the layer one contract the combine signature for the whole batch like you can see here and they pack all blocks with between these two blocks with a signature into one batch and then submit it to the layer one when the layer one received this checks all of the submit signature to make sure that it matches with the transactions and by sing off on a bat of transactions and sending all of the transactions to the rollup smart contract this basically this process ensures that the network is more efficient scalable and also it it accommodates all of the transactions in a secure way because they're validating all of them into the layer one now we will talk about okay how we actually are an optimistic NC rollup because everyone asked that okay why we aren't a fully CK rollup yet so the process is basically based on the validators will need to constantly verify all of the transactions to basically new state sequencers submitted that have already submitted to the layer one then if they find the transactions and the states are not correct they will initiate a challenge then the sequencers need to answer the challenge by providing a CK proof and pass the verification process basically and if the sequencer can't really finish the verification process during a certain period of time the fra behavior is settled so that's how we integrate the fra proof the validators of course will need to stake in order to initiate a challenge in this case and this is I would say our main because right now can be integrate a fully CK rollup can be pretty expensive that's why we are integrating like Hy hybrid method and so we are expecting by mayet after mayet to integrate a fully CK rollup we will have Mor staking we will launch in mayet our token we have uh also some updates by the end of the year layer three support and Al kind of struction and so right now what we're looking for is to bring more apps more consumer apps on chain in a way in a way that I would say my main goal is to board more developers to build actual use cases right we are seeing a lot of investors putting a lot of money into infra but not really into Apps that in a way will bring the one billion users to crypto right and that's just a something that we want to achieve and we are just getting started and um yes just go through our booth we are giving 7K USD in prices for the consumer truck and Innovation track we are giving 3K you can build whatever is innovative and it can surprise us can be AI onchain apps developer tooling something that can help the network also be more scalable we're looking to support all of our long-term Builders we are also giving grants for if you're building on testnet or even if you want to build on mayet so yeah just come by and I hope um everything uh was clear here and yeah if you have any questions please let us know he here's our engineer that will also help with the questions and yeah someone has any questions no one has questions uhuh so we are going to no no problem we're going to mainnet in mid August uh we're auditing smart contracts right now so it can take a little bit of time um but yeah we're going in mid August September no more questions no okay what's your that's a good question so we actually on board a really cool consumer app called lemon uh they win our incubator program they are building like an education on chain like you can get rewards uh to learn different programming languages uh it's like a dualingo on chain but for learning different programming languages and I think that's really really cool and that's the type of consumer app that we want to see on board honestly um but also something some use case that I really am really bullish on because I've been experiencing it is basically onchain payments so if you're want to build something around payments stable coins on morph come hack with us so yeah okay thank you so much e e right thank you sorry for the wait guys right should I yeah cool uh all right thanks for coming and joining us sorry for the delay uh always some technical issues but um in the next session we'll be talking about building evm DBS on bitcoin with root stock uh my name is Olia uh I lead develop experience at Ro stto clubs you can find me uh fairly easily on most socials at all toova with an exception for Discord which is bidd FTW so feel free to reach out to me if you have any questions um or need any support technical or otherwise with whatever you're building um I've done a couple of uh well I've uh come as a hack to a couple of in global events and this is the first time we're building uh bring rootstock uh to this event so I'm super excited um all right so in this 20 minute session we'll cover a few things mainly um I'll give a short introduction to rootstock architecture we'll have a look at the ecosystem smart contracts and DEP development uh and developing tooling and resources that will help you building on roock and then I'll share a little bit about a recent project that we've been working internally um on with our develop experience Team all right so let's start um what is rootstock uh rootstock is a uh Bitcoin side chain uh it's the first and longest running so OG Bitcoin side chain we've been in main uh net since 2018 so for about six years now uh with 100% up time which we are very proud of uh what makes root stock special is that it's fully evm compatible so uh Builders can uh ride smart contracts in solidity and all the developer tooling will work as it would have worked on any other evm compatible chain so I'll dive into it a little bit later and finally uh uh rootstock is secured um by merge mining so it's merge M with Bitcoin and I'll explain how that works in the next couple of slides um a little dive into the architecture so rkj um it stands for rootstock Java uh is the node is the main component of the chain um it was originally forked from ethereum J uh you can find the implementation on GitHub um it's open source uh under license we do welcome Community contributions uh via uh requests on GitHub so if you're interested you can check that out also the rsk WB paper is available on the website which is rootstock doio um RS IPS so root stock Improvement proposals very similar to eips um so um open again open source uh on GitHub you can it's basically a bunch of markdown files um that everybody can go and check out under the CCO license um and there's also a forum uh for these discussions it's kind of like just a bit more user friendly it's categorized if anybody's interested right uh let's have a look at how Ro stock uh is connected to bitcoin I mentioned merge mining uh at the start of my talk merge mining was not uh invented uh by the team root CLS or anything it exists as a method um there are a bunch of other um networks that use it but um as I mentioned earlier uh rootstock is the uh most successful project being merg M with Bitcoin um that's ever been out there so the way it works um is that uh Bitcoin miners they include the uh change of state of the rootstock network um uh in the Bitcoin block header and the uh the difficulty of the cryptographic puzzle uh that is needed uh for the bit for the root stock chain um is lower than uh is needed for the Bitcoin uh chain hence uh some of the headers that do not solve the puzzle for Bitcoin are are still uh valuable Solutions valid solutions for the root stock Network um you can check out more about how mer mining uh works it's quite interesting on the site and read about more uh the architecture but that's pretty much I think all you need to know um at this point um the other way uh we can describe root stock connection to bitcoin network is also through cryptocurrency so um root stock is not subsidized we do not have a a separate token so the gas fees um all stop networks are paid in rbtc which stands for smart BTC basically you can take about it as a WRA version of BTC uh the bridge used for that is H is called Power Peg so a proof of work uh Peg um and basically it's a uh Federation Bridge secured by uh proof of work uh and hsms um so the way it works it's basically uh the it provise B directional um conversions between BTC and rbtc at the one to one exchange again there's more kind of information about it um in the docs if you're interested uh in that kind of stuff um now let's have a look at the uh root stock connection with ethereum um that's why we're here um so um the rvm which stands for rootstock virtual machine um Bally U uses the same op codes as EDM uh which makes uh it fully IMM compatible so all the solidity code uh all the smart contracts um can be uh executed by rvf so not just uh you can write your code in solidity your smart contract you can also use all the tooling that you already used to so um if you've been developing in the space so um their Frameworks like H hat Foundry wag me you name it everything will work um and then from the uh user kind of perspective also the rootstock node exposes the uh the same Json RPC interface as the ethereum node word so you can also easily uh Port DS from ethereum compatible chains which is like a slight change in configuration um cool uh riff so riff stands for rootstock um infrastructure framework um it is a bunch of apps and services you can find in our docs um think you um that basically uh will make it easier for you to um to build on top of root stock they include uh things like um wallet the RNs uh I encourage you to check that out there also in RPC API you can find it at RPC um .io and the Explorer to kind of monitor um on on testet while U you develop ad app so that's all in the Dos there's a few facts on here um I'm not going to dive into them because I don't think have much time uh but I mention most of the things to you already uh something I didn't say about merge mining is that it's almost 60% it's roughly of uh Bitcoin hash rate is used to secure rootstock network also so a lot um Co this is the system slide again not going to dive in I don't have much time uh feels like a a needed slide in any crypto presentation um right so these are the tools I mentioned earlier so you can see on uh different levels so smart contract uh def tools and client s libraries also uh due to evm uh upcode level compatibility ajing RPC compatibility um I've put a few Logans for you here you probably recognize um there is a the the few Integrations that we have that will again help you build uh we've got third web gelat for contract automation ether spot for C abstraction crypto do um is the no code low code solution C and tender uh blocks SC Etc um I had a little demo here on how to um Build It Up on roock and three the steps it's very bad B on super basic but just wanted to show you quickly how easy it is it's also very ugly and I apologize for the slides they also ug um I hope our designer never sees them but um basically um we need no JS metamask configured for root stock and test rbtc which you get from the faet if you have any problems please find our team uh and we'll give you um tbtc and then H hat solity react ands I'm sure you guys are familiar with all of this I'm not going to dive into it um so creating a smart contract uh we have uh we initialize hatut projects andex hatut uh install dependencies and then we cre n file where we store the private key say all pretty basic um then uh smart contract ins solidity this is very basic it basically just takes a uh vote for your favorite uh smart contract programming language um and then uh we update the uh hat config file with a root stock um URL uh create deployment script and that's pretty much it we uh compile and deploy and it should work this is the hardest bit is the front end um this is in real react I'm a rubbish uh react developer but um it still works I'll run you through it so uh we create the app uh install ssjs for interaction with the chain um create the voting component this is the longest file in the whole uh repo um I'm not going to dive into it uh it's fairly basic also so then we update the app component update index file this step is important add your our contract AI um from the hat hat project and then we start the application mpm start so um that's what we should have I'll try to show you quickly if that will work I'm not sure um uhh here we go so we vote let's say solidity confirm it's bending it will take 28 seconds maybe we can come back to it we can have a look at this at the end I guess um if I have time um all right what else we have um something I wanted to mention we do have a separate Bounty for uh runes on root stop um our D team have recently built a kind of a proof of concept um for for the bridge or store Bridge um so it kind of has the basic functionality of uh mint BRS on bitcoin bridging to root stock minting on root stock reverse bridging um there is a QR code if you're interested uh for the GitHub repo to explore this um and I've provided a couple of um uh ideas of what can be built so basically integrating uh runes into Dex uh building a Marketplace airdrops or again Dex borrowing lending uh with runes uh we've got grants program uh just opened the new wave so your building does not have to finish here at the hackathon uh it's a it's a pretty great program on top of the financial fing we do have actually three million uh USD to give out but we offer also technical support um go to market and just uh generally uh we do care about work system so um yeah if you uh like to learn more about it maybe find us at the booth and we'll give you more details um I'd also like to invite you to join our ambassador program and be part of our community all the info is on the site um the three tracks we have here so anyi um on R stock uh bu runs uh as I mentioned earlier uh and the best use of restock blockchain can be anything uh you like from AI to real world asset organization dep whatever takes of fancy we also have um a bounty for that this is the hacking guide that might be handy uh so that will have all the documentation all the resources you might need um but you can also find us at the both uh we will be there to help you uh that's pretty much it I come do say hello we do have a bir uh thank you so much for attending and uh hopefully see you around contract here we go two minutes ago contract call thanks guys [Music] you e e cool yeah I'm good whenever awesome um hey everybody my name is Trevor I work at hyperlane uh I'm the backend team lead there so kind of all this rust infrastructure that powers a lot of the delivery of messages uh that's what my team does uh today I'm going to be talking a little bit about just what hyperlane is I'll give like a brief overview of like the architecture what we do what problems we solve and then uh chat a little bit about some recent work U that I think is pretty exciting around using igen layer um for economic security for messages between two different chains um so just to give some background on the motivation for hyperlane uh we are a modular and permissionless interoperability protocol and what this allows you to do is just essentially send messages between two different chains um you can build applications on top of this messaging that like natively span uh multiple chains whether it's ebm Cosmos salana pick your chain um yeah the motivation for this uh I guess taking a step back and looking at some of the history um at the very very beginning we had a pretty homogeneous view or or architecture of blockchains uh it started with Bitcoin then we had ethereum there was kind of this new wave of smart contract style l1s u there was no solid story for scaling that we have today but uh a bunch of you know alt l1s were created that were evm compatible and this was still like a pretty homogeneous environment but slowly getting more specialized um and then there's the app chain movement uh where you have these chains that maybe don't even have a VM um they're tapping into like consensus layer changes protocol level changes to try to uh extract these new like novel protocol level features um you're seeing that with rollups today um and you're seeing all these different types of chains that each have their own little flavor of what they're trying to do best um and this posit a problem where uh if I'm just a normal user now I kind of need to know what all of these different quirks are for all of these different chains I need to have different tooling different wallets if I'm a developer it's even worse um you know there's a reason why most people are just evm developers it's because it's easy to do and you can kind of Bring It most places uh but if you do anything like outside of that or want to go to other chains that's where things get a little bit tricky um even just managing token balances across all these different rollups I have Ethan like 20 different places total pain um and yeah interoperability is an interesting one because a lot of the uh the solutions for this rely really heavily on like consensus layer or protocol level details of these chains so you can have amazing security between two chains by tapping into the specific features of the consensus algorithms of these chains uh and you can spend a lot of time and money to build something like this but it's not very transferable so there's this kind of trade-off of spending time solving security problems when it comes to interoperability that tap into the specifics of chains um and that provides ATT tension with wanting to be in as many places as possible uh so what we do is we noticed hey security between chains when it comes to interoperability um is almost an unsolved problem uh and today developers want this today users need this um and our solution was to decouple the transport layer and the application layer uh so what this means is there is a single onchain interface for sending messages from one chain to any other chain whether it's from evm to salana whatever you want um and the security for these messages is not baked into the interface that you use so if I'm an application I can continue sending messages through this single contract we call it a mailbox um to whatever chain I want and as new Security Options come out I can update that U so applications can opt into what security they want without the protocol dictating what they need U so this provides yeah consistent application interface for messages if you want to develop an application today that's only on the evm but you have plan to go to other chains you can do that really easily with hyperlane uh if you're excited about a ZK proof that's coming out um you know for ethereum consensus but it's not available today you can build today add it later um you can also do cool things like having the security scale with what the message content is so let's say you're building a bridge um you might want cheaper security for a message that is only transferring $5 but more expensive security from one that's transferring a million dollars um so you can kind of dictate dictate the level of security you want depending on what exactly you're doing um and this kind of just leans into the general ethos of being maximally composable um developer first and modular in that like we have this this single protocol that doesn't enshrine what applications want to do um yeah this is kind of more on that like you can configure what security preferences you want uh we have kind of these like little Legos of security modules which is what what we call them um where as an application developer all you really need to do is just configure some onchain things onchain contracts that you can provide or we provide um and you get kind of different flavors of security uh so we have um like a single interchange security module which is a contract that defines this function that can verify proofs whatever you want for the validity of messages uh and we provide like some little Legos of of how to create those which is nice um and modular interop is the one interface to message and secure them all um so meaning we've kind of made these like really specific design decisions so that way we have this like single immutable protocol you can build all these cool things around it as crypto evolves uh so more specifically this is what the architecture kind of looks like um so On the Origin chain we have as sending contract uh you would encode whatever message you want um so at its core it's really just like bites over the wire between these two different chains you can build these like abstractions applications bridges on top of it whatever you want U this message gets put into a Merkel Tree on chain similar to how the eth uh like original uh e 2.0 like deposit contract Works um and again we don't really like uh uh require a specific model of security but we have this commitment which is the Merkel route includ all of these messages um that you could have ZK proof of you could have people signing this whatever you want um but the gist is on the origin chain messages go into this thing a commitment that attests to all these messages is uh provided you need some kind of proof um to the validity of this commitment and then this is provided onto the destination chain uh and then ultimately this is sent to the recipient so we run this like offchain infrastructure that will deliver these messages to the recipient so from your perspective Ive as an app developer or a user you're just interacting with the origin chain we handle the rest when it comes to delivering this message to the destination chain um okay so getting a little bit more into the weeds of of the first thing I alluded to of some exciting things we've been working on um you know we we're not prescriptive about the security model that people use uh but it is still important to provide really solid security um as the default mechanism so today the default security we have is closer to like a proof of authority set and again applications they can opt into whatever they want but we make it easy for people to uh run these validators that sign these messages and if these validators all agree on the validity of a message then a message is is considered fine um but what gets even better or or the next iteration of this is you want those that proof of authority set to have something at stake so if they commit fraud if they say that a message occurred that didn't actually occur um something bad should happen to them uh without this they can kind of commit fraud and they get a slap on the wrist or like you know social slashing it's what people often say like you know my reputation is on the line as running one of these things but putting real money on the line is uh is kind of more in the crypto OS um and this is what the proof of stake bit here it looks like so these validators they're signing these message commitments their signatures are used for the verification on the destination chain and they have Stak that's up uh stake um okay so what does this actually look like like how do we slash these validators um so one interesting thing is we have a really nice slashing condition on the origin chain so I mentioned earlier when you dispatch a message it's put into this Merkel tree and uh you can trustless verify if a validator has signed a message that does not include it was not incl included in this Merkel tree so we have a a deterministic 100% slashing condition on the origin chain like the root of the whole problem is how do you kind of prove this on other chains and that's what interoperability is uh but we have this very nice slashing condition and we can have an observer be responsible for looking at the signatures of validators and provide to this proof of State contract hey Alice just committed fraud let's slash her her State um some cool things happen when you compose this with IG layer uh so if you're not familiar with IG layer it allows um the eth that's being used already for validating ethereum to also be used uh by other applications for security um and there's like a huge ecosystem around this uh there are these things called abss which I think stands for like actively validated sters yes um and we recently released this uh uh there's a whole RT ecosystem of these like different versions of eth um that uh have these ion layer operators um but the general idea is on ethereum you have this uh eth that's put up as stake um and again in in the model I just described you would only be able to have like a deterministic slashing condition on ethereum that means that only outbound messages from ethereum will have really good security but the other ones things get a little bit iffy you don't have like 100% slashing condition but an interesting observation is you have also ethereum rollups um which have their native Bridges rollups themselves are defined by their Bridge um so if you have a rollup that is settling to ethereum they have this trustless bridge and this means that you can have the uh uh the proof of somebody committing fraud let's say you're sending a message from rollup a to rollup B um you'd be able to still have the stake live in ethereum by letting me prove to on roll up a the slashing contract hey Alice committed fraud let's send this trustly down to ethereum that Alice committed fraud for her origin message from rollup a and then slash Alice so we kind of get the same level of um of like a 100% deterministic really good slashing conditions now from origin chains that are not just L1 ethereum but L2 ethereum um so that's kind of it on the The Economic Security part um we have some yeah recent work that we've done there that I think is super exciting I think there's like opportunity for you guys to kind of hack around this uh which could be cool now I'll just talk briefly about some other kind of um abstractions and things that we have like out of the box uh that could be cool to to use as well um so warp routes are our play on token bridging um and again we're not uh prescriptive about the security model for for token bridging um or any kind of usage of hyperlane and warp routs also leaning into this so we offer uh the ability for you to just deploy out of the box tokens that are bridged um whether it's nfts erc20 is um xc20 as well uh and you can spe specify what security you want for these chains um or or or these messages uh one bridging um so we have a UI that you can use we have a bunch of tooling to let you deploy these yourselves um so if you're looking to maybe support another chain that's here um maybe build out some kind of like proof of concept of bridging for them like this is a whole self-service thing that you guys can play around with um you can also we have this like uh yield bearing version of this so you can have maybe like when I I'm bridging my eth it gets locked into a contract that contract is generating yields and then that yield gets um shared amongst all of the people who have bridged which is pretty exciting as well uh we also have interchain accounts and interchain queries so these are two abstractions that are kind of borrowed from the cosmos ecosystem um also known as icas and I guess icq um and what these do is uh in the first case interchain accounts let's say I live on ethereum I have a balance on ethereum uh but I I want to own assets on other chains maybe I have a nosis safe on ethereum I don't want like you know signers to have to have balances and all these other chains submit transaction themselves um you can have uh your origin chain sender control a what it's essentially a smart contract account on the destination chain um and you can even have this cross between like evm and CM wasm which is pretty cool uh interchain queries this is let's say I'm on ethereum there's some kind of like important state that lives on Avalanche I can use an interchange query to receive that information back on ethereum um so this would be useful for like oriz data maybe like an identity provider that lives on a certain chain you want to bring it onto another chain um another thing worth mentioning for all of these things like a big differentiator for us is anybody can deploy hyperlane onto whatever chain they want um anybody can deploy these kind of contracts on whatever Sho you want so if you're even spinning up like a devet running Anvil locally you can do this really easily we' recently made some steps uh to make this even easier with like a more friendly kind of CLI uh so yeah this kind of leaning into like one of our big things that we say so uh our design is modular and it works really well with the modular stack this is kind of the typical like you know Celestia perspective on on what comprises of a blockchain um and we pait that adding interoperability to the top of this um is our biggest contribution so come build the modular expansion with us um we have an office in New York London we're hiring uh we have a bunch of bounties um come by the booth if you haven't already we have swag QR codes list of what the bounties are um I'm an engineer and with other Engineers here we're willing to help um and I think I have like maybe a minute or two for some questions so you guys might have them any questions I'll go with no well cool come by the booth um and yeah happy to chat a demo for it yes we have a bunch of documentation about it um I'd say like no guides but uh well we have a guide if you were an operator uh but this is targeted for like I don't know the The validator Operators of the world who want to actually like run one of our validators and and earn rewards uh but yeah come by the booth and we can chat more cool thank you very much guys e video yeah can you hear me one two yeah hello welcome so I'm from gadal I'm a developer and the founder in the company uh we're building the L1 for AI and our reasoning is that we started uh building chains and then run into problems that we couldn't solve and decided to build our own their one for this one uh that's optimized for AI use cases yeah okay is it better not that much ah yes um yeah I'm going to briefly go over like uh what we're doing and I would like to focus mainly on how to build it I will show some code examples and uh do some uh live live demo um yeah so what you can build on us is the um some of the examples it's also linked on our uh our docs uh so some of the AI gamings uh economics agents forms and uh trust and transparency for AI so you can actually see on the Chain what's going on uh how is this logic working um we have shipped some of the um examples as well fully open source what we have built so first one is the obvious one which is a like getting started one on chain chat gbt you can chat with it you can see the front end uh code what's needed uh the solidity contracts and the script how to call it call it out we created an AI game as well uh based on vitalic um which is a fully Dynamic game so each game is fully unique it's generated by llm so like what's the what's the environment in the game what's the actions can happen it's like a battle game you have to fight and um Al also fully open source so if you're building you can see how it's built um generative AI nfds the same thing uh it's fully open source you can check it out and also AI agents uh which is essentially one llm is one smart contract and it can interact with other smart contracts um yeah and this is um explanation in here how it works in the first phase of our Network we call it uh thrusted execution Enclave so this is um um completely separate part of the CPU essentially on the computer that's isolated from the rest of the machine so and you can cryptographically attest this that whatever is running inside you can completely verify that it's running exactly as it should be and here's the demo uh you can try it out immediately you need to have the metam mask so every everything you do in here is a specific transaction on the blockchain um and there's a small image as well how it works so you have your smart contract it's like any solidity smart contract your all your existing tools work on evm uh and you're calling our uh Oracle contract which uh then afterwards uh after it's done Computing it answers back to your contract and uh the Oracle itself is uh in the execution Enclave as I mentioned and you can see also this attestations um and how to how to verify this is also open source on GitHub so if you have more questions like how to verify this it's up there um well maybe jump into the quick start um maybe the wide screen is better uh before you can get started um so this is our quick start as well I'm not doing anything secret it's all up here as well uh you need to get um new wallet preferably new wallet you can use their existing wallet as well if you um want want uh but you need to first get the Dem tokens so you have to log into our Discord and get it from there uh you also have to set up a new RPC if you're using metamask but it's also like uh linked on the website and after we have this ready uh we have the repository in GitHub so you can uh see what's inside there I have it already already cloned in here uh well maybe first look look into the quick start contract uh just to give you an understand brief understanding what it is so it's uh Sol the contract quick start uh it's a Constructor as you saw from the previous image you need to interact with our Oracle contract so you need to have the address of this Oracle contract uh you can set it up however you want but you know this is just one way to do it uh you also want to make sure that uh only Oracle can call back your uh your smart contract because otherwise like anyone can call it and you know in uh rubish inside um and how it starts initializes uh initialize the uh interaction uh you call this function whatever is your input so this is like a just a text um and this one calls our Oracle so it works through the interface um and the message goes in here so this is just one of the function calls we support a couple of other ones as well you can uh check it out from the docs and and uh if you call this out then the your transaction is done um it's an asynchronous operation so the Oracle in the back end does its job generates it and then calls back your contract it calls back this function and then the response uh is saved uh to the contract of course you can do anything that you want in here uh you can have your eels sentences ah so the question is how to make sure I got the latest call um this is up to you to design to be honest so in here in here as you can see it's just you know last response you probably maybe want to have like an array yeah yeah yeah so the question is like how to understand which which callback uh was made uh this is for for the purpose of the demo just you know essentially have this one bullion you know it's set or not but in in reality you probably want to maybe uh introduce um you know your own data structure an array you can set it as an uh with an ID uh as you can see the first parameter is the Run ID so you can use this one to track like uh which is the call and which is the response and you can of course have like uh more complicated data structures maybe like nested classes and uh and whatnot yeah perfect um I'll maybe quickly show how to how to run it as well um in this one as well we have the Dot N uh in the Dot N I will show you what I have inside um so uh my private key you can copy paste this um uh which you need to add in there and the wait it's wrong T sorry yeah this is the one so the orle address you need to understand what's Oracle U and your private key we have two different ones in here one of them is for actual own uh blockchain but if you want to run your local blockchain you know want to use the different keys in there it's just for this reason but you can most likely just use the same ones um have the M setup um you need to of course install your dependencies and uh deploy quick start it's just um uh simple script um essentially we're using the e. JS we're getting the so the smart contract code uh putting into orle address and then just deploying it pretty straightforward if you have done uh this sorry I already uh showed the yeah I mean this is was my example I just showed yeah all good it's compiling the contract and uh doing the deployment um and yeah it's working yeah so I get your contract address uh and I'm setting it in the terminal uh variable and then you can call this out so what we this quick start is image generation model so using dolly in the background and now I can call this contract out um it's asking for the input um so this uh is sent to this quick start contract as I showed uh and this is calling out the Oracle contract and now the Oracle in The Enclave is seeing that someone is requesting a job to do uh does this compute in there generates image and at the moment it's uh uploading this not to the IPS but to our our Cloud um but it conceptually doesn't really matter it's just more convenient to get it uh get it up and running for the demo purposes and now you can see that um yeah it generated the image hopefully there's Apes as well yeah a lot of Apes um this time yeah uh I have eight minutes um so this is the first uh like simple example um we also have the Explorer as well maybe I'll show it uh it logged out that there was the um transaction and now you can see the transaction in here as well and I mean I think everyone has used some Explorer uh you can put in your transaction or your wallet address or you know whatnot and go there the contracts as well and then you can see what's happening in here one minute to go called dysfunction yeah I think we have seen these ones before um but for our purposes we want to make make it possible to build a more complicated agents uh we'll maybe show the um Vector store support uh so rag is very common technique in the field which is um having a knowledge base for your AI so if you have used chat gbt you're asking some details of you know outside world it usually doesn't know it only knows what's inside the model so how you can improve this is to have uh a database essentially with with different facts for example or you know you put a a book the whole book PDF inside of it but this whole book you cannot send to the AI immediately or like the llm immediately you probably need to find the correct place in the book to to send to the to the llm and so this is what the retrieval augmented generation is so it's a a similarity based search database it's a bunch of vectors bunch of numbers um but we have made it hopefully a bit more uh accessible so on the python side you can put in your data so I've created this is also in the repository as as well so we have this rack tools create the simple uh data uh when I'm presenting and I took the next one as well so cell is presenting uh we need to make this into uploaded this to ipfs so that the the Oracle can access this um I have a simple script in here it's unmodified it's just the latest version of in our repository and you can uh update update this to the upload this to the ipfs and then you get the um ipfs uh CID back and then you can put this while it's uploading I will show you this is the jat gbt example in here so it's a contract uh and how this works is you know um the knowledge based CID goes inside as well so it can forward this to the Oracle to be used um similar stuff so if you start the chat so first it checks like if it has a knowledge base and if it has it's uh Mak to knowledge based query it's again asyn asyn operation and after this finishes it calls back the uh callback function that you got the uh knowledge base query back so hopefully it found this first line of this uh text uh returns this to you and then after you got this back you can make the actual uh call to the llm and once this is complete you get the call back to this uh this function uh um this is one off example but now imagine you can have in here as well uh another maybe knowledge based query or another llm query essentially like a for Loop right or you can call another smart contract out that does you know maybe another piece of operations couple of calls uh question is about can we do multi chain uh not not yet at the moment uh currently supported chains so this is only this chain it's at the moment isolated we we don't do the gross chain integration at the moment um just only DVM but this is definitely on the road map it's asked like okay for D5 applications mainly like how can I get some more liquidity from other chains to llm stuff put this back to the other chain to the trades um yeah so uh at the knowledge base I got back the C I think I need to just quickly modify the previous example to deploy now deploying the this contract I just showed uh the chbt one with the knowledge base and after this one is um deployed I can actually ask when is my presentation time and uh show up yeah it's deployed now so now what what happens is what I described it first uh gets the data from the knowledge Bas uh and puts this into the llm call and then hopefully uh it answers the right time yeah 15 20 I'm not sure why it's double it should be just once yeah uh that's what I wanted to show uh do you have any uh questions I guess not so that's it we at the boot yeah so the question is what do we expect and what are the prices yeah we expect to see AI agents this is what we're interested in the prices uh I'm actually not sure I think you should visit our boot uh our product people are going going to be there as well and we can uh syn ideas and share like what we're interested I think they listed a couple of ideas out as well like uh what would be one of the examples if you just want to build on us but don't have any idea then uh we can suggest something as well yeah thank you very much e for okay so hi um welcome to the Flare's Workshop so what is flare flare is a blockchain for data what does that means well it means that you got your ordinary blockchain that can do all these important necessary security related stuff but what you also get is an additional data sources directly on chain so it's not your everyday multi seek pushing data on chain it's a properly secured data when you know that the whole validator set is making sure that the data you get on chain is secure and exactly what you need so what you can do with Flare well you built on an evm chain so evm chain that has all the nice things you're used to building with all the toolings and you can do it with data so we offer two different prices the first one is 7K price for the best utilization of friend flares ens shrined pricing oracles together with layer zero V2 or with any other cross chain connectivity that we also offer so use the price use a price you can get every second on every block and do something with it not just on one chain but do it cross chain use liquidity somewhere else use the tokens deployed somewhere else buy something somewhere else use information for Bitcoin and do this and secondly we also have a second track which is the most Innovative application using flar dat protocols so apart from just pricing oracles we also offer additional data connectivity oracles when you can observe what's happening on other chains without any additional interaction from other chains so you can observe non-smart chains you can observe Bitcoin payment you can observe xrp Ledger payments you can observe what's happening on Dogecoin and in that case you can also apply for that track okay so what's specific with Flare we offer native data acquisition protocols so those are enshrined directly into the chain what does that mean well we have three different things you can work on this time so the first one is the fso this is flare times hisorical so for probabilistic data we offer price updates every block so that means that we have 19 different price fits currently only crypto when you can get a price update every block and those price updates are directly published on chain you don't have to query them you don't have to request them you don't have to pay anything for them you just read them from a contract and we'll see how easy it is to do that in the following few minutes in the workshop and all this is operated by a stake network of validators so you know that the prices are always correct and can be manipulated by people that want to gamble your system when you have a Perpetual Dex or when you have some future set up and secondly we have a flat State connector and data connector which allows you to connect to addition data sources what does that mean well that means that you can have a deterministic offchain attestations you can attest the data being presented on another blockchain you can attest that Bitcoin transaction has happened more specifically you can attest that in a specific time range Bitcoin transaction hasn't happened so you can know that the payment that was supposed to be made for something wasn't made you can know that if somebody's building a swap when you have one swap on bitcoin side and one swap on sepolia or etherum side you know that one person did not complete their leg of transaction and again this is enshrined directly into the protocol level so you don't have to trust a multi built on top of this you know that this is secured by the same validators that are building the blocks and thirdly uh We've recently integrated with layer zero so what that means that means that you get the whole mesh of all other evm compatible networks directly on flare chain and combining the first two oracles so giving you immediate pricing data and giving you data about the state of other chains about what's happening in the rest of the ecosystem you can easily build a bunch of deps that are integrating cross chain moving data around getting to the best liquidity positions getting to the best information sources executing this on a smart chain and then going whenever you want all this properly secured directly on a validator level okay so just a few things important for the hackaton so flare is an evm layer one Oracle Network what the zvm layer one means well you get all the nice things you're used to when building on ethereum or on polygon or any other chains so we proof of stake you get the security block time is very quick so you know that you get a block in the next second or so so you don't have to wait for a while you don't have to wait for the transaction to happen you can do things immediately and combining this with fast pricing updates you know that you can execute quick trades and you can be there on time so you're not waiting neither for an old price neither for stale um State the transaction fees are low due to the efficiency on the network level and you can use pretty much any tooling you want so we offered pre-prepare hard head and Foundry tool sets so you can start with a starter pack that has all all the rpcs already configured all the forets that you would need all the necessary block Scout tools so you can easily interact with the whole ecosystem without having to change anything if you know solidity and if you know some typescript or some Rust it's easy to start you don't have to change anything and as an evm chain you get pretty much all the goodies that can exist on such chains so erc20 tokens natively supported web three authentication directly available so we have also from the defi perspective multiple nft marketplaces tooling periphery support all the sdks you would need and stuff like this so it's easy to start and again a large defi account abstraction support stable coins you know it this is FL so you have oracles you have data directly on chain it's quick and you don't have to change your toing and now let's take a look how exactly these things work okay so if you want to build on this the first bet would be you come to our boot or you scan this QR code we have a starter pack which we're going to start building on from now and we have a whole set of developer documentation specifically tailored to start building so um okay let's wait so that people think okay so we'll be starting from this starter pack why starter pack useful it will be starting from the starter pack why is it useful well it's a simple hardhead project with all the necessary stuff already configured so if you if you've seen the hardhead system at some point we have all the necessary contract set up all the private Keys you can just import from the uh um environment file and all the at scans are already so we don't have to configure anything um if you start running into any problems hitting the RPC a bit too hard just visit us at the boot we'll give you API key so you can just knock yourself out and do whatever you want with the rpcs okay so we start with the starter pack that importantly already has the flares periphery contracts directly so all the interfaces you're going to see everything you need it's already in it's type safe it's made in solidity so you can easily call them you don't have to hard code anything so you can just easily start okay and let's take a look at the at the first one so it's thef flare. Network so this is the entry point for documentation and the first one would be the FTS V2 so that's the that's the most important thing the pricing Oracle getting prices quickly and efficiently on chain and let just and what you want to see is the systems Explorer so for each ft o so we currently offer 19 different prices and for each the fdso it's easy to see for each data source it's easy to see what the prices are so the prices are updated on a block level we offer a bunch of nice visualizations when you can check how this is getting updated so okay here the um the shape is a bit jacked because of the of the issues with the with the amount of pixels but in this way you have a fast update every block and you know that this is getting correctly processed by the data okay so these are fast updates and each of these feeds is associated with a specific feed ID although this thing here might look a bit scary it's basically just a hex and coded btcusd so that means that we can easily extend feeds to pretty much any feed you want so you can combine feeds you can add new feeds you can add new feeds that that are not necessarily dollar denominated but can be stable kind denominated and we've seen in the past that stable coins might depack so you want to know what exactly is the feed you're looking at okay so that's the that's the data we'll be observing and let's just take a look at how this data look direct looks directly from the contract okay so this is a simple contract interacting with the FTS so V2 is it big enough can you see it at the back okay so there's a library which I've copied in here just so we can see it in a real world use case you would on a hackaton you would just import it from the registry so we don't want to deal with all the necessary bureaucracy so what do we do if you want to get a feed ID you just Supply a name and we properly encode it to bytes so you get this feed ID that we've seen in the beginning and getting the feits well you just have to query the correct contract and how do you get the correct contract well on chain we always maintain a set a simple contract with de an entry point to the whole Flare's ecosystem so what you do you first get to the um flare contract registry that is always at a fixed address on all the networks where flare um operates so flare is composed of test net and of a main net and we try to keep the addresses for both test net and Main net the same so that it's easily to Port data between those two okay you get the flare contract registry you get the fast updat contract by the address and then you can work on and what do you do well since the data is available off chain you don't have to do any pre-calculations you don't have to request it you don't have to pay for it the only thing you need to do is you just say FTS so V2 fetch current feeds that's it and you provide some feed indices so each feed is associated with a specific index so indices are hardcoded here flare has zero index Bitcoin has index two and ethereum has index 99 but you don't want to query the feds by indices you want to query them by name so what you how would you do that well we also provide a configuration contract in the middle that just act as a simple mapping between feed names that you would use encoded and feed IDs um in the on the fast update contract so how would you do this here is another piece of solidity code when you can get feed values by name and what do you do well you just say Okay I want to get this I want to get some strings so I'm just going to supply you xrp Bitcoin Dogecoin whatever and I want to get the pricing for each of those feds so what do I really get I get the values so I get the price of this specific asset at this specific point I get the decimals because the feeds can vary by quite a lot we provide the feed value denominated in some decimals so for Bitcoin you get a bit less decimals for more lo you get a bit more decimals and you get a time stamp this is the latest update for this specific feed why do you need this because sometimes you might get a few feed updates in the same block or you might get two blocks in the same time stamp so it's not only important to know that you're in the correct block it's important to also know that the feed was correctly updated and since all the feeds are updated in batches every block you also get a time stamp just to have some sort of a sanity check to know what it's doing okay and then there's just a matter of a simple conversion so we use the pre-pro library to convert the feed so we take a look at the configuration file get the feed ID and use it here and after that we just fetch all of them and return them and how do you use this onchain or offchain well simply you just create a um you just create a simple hardhead script to deploy it let's just check it right now we'll deploy this on cant to and also directly validate the smart contract so we can immediately interact with it let's deploy it here and in a second the contract okay the contract is verified let's open it okay so we got the contract and it's easy to then just get into the correct set to get to the correct method and say okay I want to know Bitcoin price and here it is so might not be very visible yeah and there it is so Bitcoin up to two decimals right now so that's the important stuff so you get it immediately as a view method no checking in it okay those are the fast updates important if you want to do something defi related no what the price is arbitrage in existing tax know that if you have a Perpetual Futures you want to know that the price is correct if you see somebody providing liquidity you can use the onchain Oracle to know if the liquidity is mercenary or not is it doing something good is the price being moved too much and you want to offset this this is the Baseline price Oracle you can use okay that's the first thing so so connecting to external world and getting the pricing data and the second thing you can do on flare is get data from external data sources so you can get data from external chains and connect to them let me just open the this one here and to do this you we use flare data connector so what you do you request an attestation about something that's happening somewhere else um so and the easiest thing to check is just go to sepolia take an old block take a random transaction take a old block pick a transaction let's say this one and say okay so we have a transaction it's made quite a lot of events and it was it did some contract call why is that useful when when you're observing external networks you want to not just know that something has happened you want to be pretty sure that you go deep and you can extract a lot of information so what state connector does it allow data connector does it allows you to see into this specific transaction and prove all these data on flare so this is just a nice Swagger ux we also provide the same tooling as with the fso to just do this directly from the JavaScript so what I'm saying here is okay go to evm chain go to sepolia and give me information about this transaction so I get I get some additional response which is again again a bit small but I get a bunch of information about this transaction that can be then proven on chain and what do I get I get the block number the time stamp The Source address and I also get all the events that were emitted inside so do I want to know if a specific Unis swap swap has been made yep I can see this do I want to know if anc20 token was transferred yep I can see this do I want to know if some liquidation was triggered because of some specific condition y I can see this I can take this information and I can push it to flare and then on flare I have this information information from other chains information provided by layer zero and then I can execute pretty much anything okay so that's on evm but apart from the smart chains when you can easily do this using existing Bridges we can also do this for Bitcoin Bitcoin Dogecoin and xrp Ledger and we can do this in the same way so we take a transaction and we can check that this specific spefic transaction has had some effect has created something has transferred value and had a specific transaction um identifier identified by the op return and op code so what does that mean that means that you can have a simple payment method when you can say Okay pay me on bitcoin and state connector can safely transfer this directly to flare and then it's again up to you use this information do something with it and that's the connectivity part so you have a smart chain with evm support you have realtime pricing with a lot of assets you have realtime data about what's happening on other chains and as a bonus you have layer zero integrating flare with all the other evm chains that are compatible so what that gives you that gives you secure data that gives you connectivity to other chains and that gives you the ability to use this hackaton to build something amazing with price data sources combine this with other chains and get some bounties not just from us but also from layer zero and also from pretty much any other network that is participating so that's it that's flare so getting your data in a secure manner knowing that it's there and acting upon it directly and immediately okay um that's it any questions if you want to find us we're on the boot on the far side um come to us and say for e e hi everyone uh my name is Anon bov I'm co-founder of 1 inch and uh I'm going to tell you today about some interesting algorithms in defy which I find the most interesting ones and I'll tell you why so we we can see that defy computations are very limited and this is happening for many years and we all wait till blockchain adoption and we believe that blockchain computations will scale eventually with the sharding or anything else but you know uh I'm in this industry for like seven years or something developing protocols and I don't see that capacity computational capacity is actually increasing so yeah we we should work with one what we already have and I believe we still can have uh highly scalable or infinite scalable protocols in current state of DIY and blockchains so yeah that's what I'm going to show you some algorithms in their projects and I will describe how exactly they work and yeah this is not only for uh developers hikers uh Builders this is also for understanding how different are those projects from each other and how they are different from other projects which do not use for example such cool scalable algorithms so first of all here you can see there is a classification uh you can see it's like um Distributing value it's about value redistribution among multiple participants so it can happen in the same value or in the another value different asset it could happen instant or it could happen gradually over time each second each block something like that and it could depend on Direction it could be dispensing value or collecting value from big number of users so here I have examples of some projects which already have those algorithms and I classified them so yeah let's start from the beginning you can see that same same asset instant dispensing you can find amm Logos so what does it mean whenever someone uses amm pool for swap swap fee is being accounted in being redistributed among infinite amount of liquidity providers it does not matter if it's like 10 providers or thousand or million or even billion providers computational cost for this is the same because this gthm have constant complexity so next one in this table is same asset gradual dispensing uh let's start with this slide so how money markets usually work so those who borrowed liquidity their depth is increasing every second or every block it's being accounted like that and they like you can say they're paying some annual yield for lenders it looks the opposite lenders get value also accounted every second or every block depending on the implementation but it's happening gradually and the thing how it works inside uh you you could think that it's like collecting values and dispensing values here but actually implementation of money market is different they're using same algorithm in both both sides they're dispensing depth and dispensing collateral so that's why they all uh money markets are listed there in gradual and projects like maker which are all I I mean they have similar algorithms and apply them similarly so yeah one more corner here is same meet install instant collection so there is joke about drug pool it's happens instantly and collecting money from every participant but also protocols here is opium logo but there could be much more many projects which are actually like Insurance protocols or options or other derivatives protocols so whenever settlements happens there are collecting uh funds from pool of participants that's what what I meant and you can see that the different asset is not really popular among different projects but I'm not sure that I have all defi projects here for sure I can't be aware of every project but it's for the most popular so if you have uh projects which are not here but like should be here or here let me know I will add them for the next next time I will have similar presentation so yeah different asset gradual dispensing is something what we called farming and it was initially used in synthetics protocol and now it's being used among many protocols moreover this primitive of dispensing different asset gradually could be used inside of many other protocols so let me check what is the next slide uh yeah and I forgot about this interesting use case right here you can see same asset gradual collection I found only one project which is doing that it's called papay and it's infinite scaling money streams how does it work so you could set up streams which are actually constant streams like uh how many assets are being transferred in one second in one minute in week it's being constant so you can open uh limited amount of outgoing streams but for sure you can have infinite amount of incoming streams so this protocol found a way to have settlement without enumeration of incoming streams so it doesn't matter if you have 1,000 incoming streams or 1 million or even one billion of streams you can get money from all those streams within one short transaction how does it work this protocol stores total speeds of incoming and outgoing streams for every account whenever someone's open new stream or close stream or change stream these numbers are being recalculated for involved participants and then you can count your next balance based on your previous balance how much time pass in this moment and your total speed so sounds basic but that's what allow you to have infinite scaling money streams actually if we will see net fli or YouTube or Twitter or only funds or patreon or anything else on blockchain they should use accounting like that so you they will be able to charge millions or billions of streams with constant complexity gas cost will be the same for any amount of subscriptions so yeah one more Point here is that whenever you see something is happening instantly inside blockchain it it's also there is a room for manipulation here and uh the by default those protocols they are vulnerable to front running and sandwich attacks uh for example whenever someone see that huge swap is coming to amm uh and huge commission will be earned by liquidity providers there is a possibility to inject your liquidity right before this swap to get significant share of those fees and then remove your liquidity that's what's happening uh jet liquidity just in time liquidity so on this slide you could see for for example your liquidity provider with three millions of three different assets die usdt and usdc and there are three different pools it's like Unis swap version two or maybe curve or any anything similar so whenever you see huge swap coming to one or those pools you could inject your liquidity you could inject two millions out of your three millions so that's how you can simulate six millions of liquidity but you only have three if you would use more assets and involve much more pools your coefficient will be much higher here is like uh double doubling virtually doubling your liquidity amount but for sure you will spend some uh uh money on uh fees for making those transactions so it's not passive participation in amm it's more active participation but it have own benefits and on some networks where those transactions are like super cheap it's more than feasible and yeah those uh those projects which do this instantly they have possibility to protect from this for sure this can be done is in two step for example projects in same asset instant collection such as uh Insurance protocol derivatives protocol they lock user funds and whenever settlement is happening they charge users so it's not possible to run away before settlement yeah but some things like amm are still vulnerable and yeah but for example for UNIS swap you can do unisoft V4 hook for those who provide liquidity you can make it as a two-step action first step to commit your deposit and then you have to wait few minutes and then you can deposit something like that I mean you could have some algorithmic protection from this if you consider this this is something you want to solve and that's it [Applause] uh any questions easy yeah that's why I'm talking about it because it's easy to understand that some protocols already utilize algorithms with constant complexity and that's actually huge benefit for them because they are already ready for Mass adoption because they're ready for millions or billions on of users because each of these users will make transactions only when they need to do like real actions when you need to borrow or lend or you need provide liquidity or you need Swap and you don't need any extra transactions for accounting you don't need to uh collect funds for example from millions of subscribers because uh it will be nightmare you will no no I don't know if any blockchain can allow this like if Netflix going to have uh uh subscriptions on blockchain I I don't believe that they going to do hundreds of millions transactions every month we don't have such blockchains yet and I don't believe we will have such blockchains in 10 years and uh yeah yeah we have questions yeah guys asked me to repeat questions before answering them so yeah in short you ask it about uh this slide where I told about uh instant actions instant distributions of values and you asked about Unis swap V4 hook that you heard that there is a bounty for something similar to this yeah I think it's possible to make protection from just in time liquidity provide providing and you can make it the only way you can protect from this is making it to step but yeah it's not that simple if you would make it simple to step like commit that you will deposit and then deposit people will commit and then wait till something is happening and then they will deposit but yeah you could came up to something not very it it will be not very difficult but I think you can came up to something what would work fine for this yes yeah okay I'll repeat your question because I was asked to do this so yeah uh I I uh I talked about computational complexity but for sure there are other complexities for other parameters of those algorithms as uh memory consuming uh notation and other things uh yeah I I think uh this is also important but I never met protocols which have uh which store much more data than actions that happening I mean like for one uh storage slot for few storage slots for like some actions for some users you do not like explode on data which you need to store in smart contracts because it's actually the the most the most expensive thing in blockchains it's like it costs insanely more compar ing to computations like for like numbers uh agent numbers is like two or three gas while storing new slot is 20,000 of gas updating existing slot five is 5,000 so numbers are really wild for storage yeah one more thing regarding uh complexities is that uh whenever you consider those complexities for your algorithms uh anything which is like linear to number of participants or something like that is very dangerous because when you write smart contracts you should always think about computational complexities because your computation is actually limited by the block size if you if you need to perform like Loop in your code over participants or something like that it will stuck whenever you have few thousand of users because this Loop will consume more than 30 millions of gas in ethereum net and yeah I mean uh the size of block is mostly comparable for the most of blockchains so I I don't believe we have any blockchains which have which have like billions of gas or something but yeah this is something what Auditors will tell you if they will see you have a loop over something which can grow dramatically which is not limited in terms of its size yeah Auditors will usually let you know this that this is would not work and you can split this by uh having this Loop in multiple transactions but I would suggest you to reconsider algorithms you use to don't have those Loops at all yeah that that's probably one of the reasons why this farming smart contract became so popular in 2020 because uh yeah any amount of participants can be participating in this farming and they can all join get out at any point of time and values will be distributed among participants in a fair way and all those methods to join get out claim they will all cost the same cost doesn't matter how many participants are participating uh okay uh you asked about as synchronous and non-atomic blockchains which are probably shed or something like that uh and you asked how it will will be affected those ideas of uh scaling and uh computational complexity I think it will be the same uh I mean making things asynchronous or nonatomic will not make it easier for you it will be even it will actually cost more because it will be like a separate transactions not like an actions inside one transaction so yeah hopefully you have to consider your algorith how it works on a different level so yeah this presentation is also about how people should build new protocols think how they should consider new algorithms which are being used inside their protocols and yeah one more point is for people who are trying to understand how different projects are correlate with each other which one is better for this which one is more suitable for this because yeah we can see in D5 the huge variety of different protocols but they all have different implementations and they are being optimized for a little bit different things yes uh could you repeat ah yeah uh potentially yes because when we are talking about the declarative uh programming languages I always start thinking about SQL because that's one of the most popular ones and the idea behind declarative uh languages I think so it was to make some optimizations which is hard to achieve with imperative language for example with uh SQL query you use indexes to boost uh complexity of your query but you are not aware of those indexes actually you do not use them implicitly you explicitly you use them implicitly and uh potentially some things could be integrated I mean we could see some declarative uh programming language for smart contracts which incorporates some ideas of indexing to achieve something I think it's probably possible yeah something like that yeah the difference between imperative and declarative thing is in imperative you tell what exactly is happening in your code in declarative things you uh like it's like intents you ask for what you want to get what you want to achieve and the actual things which are happening they're happening under the hood probably under the compiler or something it depends on implementation thank you for the question thank you guys e e hi everyone welcome to the chronical Workshop I hope you enjoyed the small break we had before uh today we will talk about scalable decentralized and cost efficient oracles before that I want you to picture the following scenario imagine you a Craftsman and you want to build a boat you want to build the most amazing boat out there and you're spending months and months uh crafting your boat finally after all this hard work you're ready to test out your boat but you soon realize that there is no water close to you you cannot test your boat your boat is pretty much usess when it comes to uh decentralized applications that use uh data data from The Real World we have pretty much the same scenario if we cannot provide this data to those decentralized applications use cases such as um stable coins decentralized exchanges decentralized insurance and many more other need this data in order to function properly and here is where Oracle comes into play uh oracles are the bridge that allows the smart contracts from different centralized applications to access real world data a few words about myself uh my name is Bianca buza I'm recently joined the chronical team as Le deal you can see uh my socials out there you can also find me at the boot uh in front throughout the weekend so I'm more than happy to support you with your projects on today's agenda uh we already saw uh the problem we are trying to solve we want to see how we can bring this real word data onto the blockchain now we're going to look uh why Chronicle specifically and then we're going to have a short application we're going to see how we can get the it uh USD uh price feed on chain and then we're going to build a small uh D apps we're going to have a token vendor a smart contract where basically you can pay it and in exchange you're going to uh get a specific token a token that uh we built before now a few words about uh Chronicle we are the Oracle that has been powering maker since 2017 last year in Autumn I was fan out of maker under The Branding of Chronicle and now we are open uh to the community so come build with us in terms of uh TVs or total value secured uh we currently secure over uh six billion uh of Assets Now chronical uh oracles scbe uh it's an extremely gas efficient Oracle using aggregated schnor signatures schnor signatures have existed for a while uh they they were starting in 1991 uh they even are integrated into Bitcoin however this is the first time when snore signatures are used in the context of uh web free oracles now what sets us apart uh is that chronical offers a decentral calized verifiable and scalable uh oracles and we're going to take this one by one and see uh exactly what I mean by this first off decentralized feeds uh feeds are also called uh validators or as you can see our validators are reputable players in Thea in the space which means that they have a stake with their own reputation to make sure uh that the data they provide is accurate chronical oracles are also uh verifiable uh we have end to endend uh verifiable data and let me show you a brief uh demo of what I mean by that uh so here is the is our website uh chronical labs.
org and you can go to launch uh dashboard and let's say for example I'm going to take the no USD uh you can select select on the timeline a specific uh date you're you're interested I'm just going to take a random one and you can see uh in here the different uh validators that I was uh talking uh about for each of these uh validators uh let's let's say um defy saver I can see uh wait I can't one second I pressed the wrong thingy okay yeah you can see in here this is the right page you can see in here all all the different uh validators and for each of these validators uh you can see uh the actual uh data sources so let's say I'm taking the gitcoin validator you can see all the G all the data sources that have been used and as you can observe it's a mix of onchain and offchain uh data sources with very good liquid liquidity another cool stuff uh you can do you can verify cryptographically in your browser that the data uh hasn't uh been uh manipulated so if I go here at uh verify I can see that uh the signature is the same however if I modify even slightly let's say I delete a zero over here we're going to see that the the signatures uh do not match anymore okay back to my back to my presentation in terms of uh scalability because of the optimistic schnore signature that I was mentioning before uh we are able to achieve gas cost of over 60% on l1s and 68 on l2s and this is pretty awesome because it allows for the first time when it comes to web free oracles to decouple gas cost from the number of validators as you might know oracles are expensive so if you are an oracle provider you pretty much have two choices up until now either you increase your prices which makes you less competitive in the ecosystem or the alternative you reduce the number of validators or the number of updates which results in stale data and potential threats on security and decentralization so that's why it's really important to be able to make those gas reduction actually within the protocol such that you can still have this Rich ecosystem of validators and actual decentralization now why we're here it's a hackaton we're offering uh 10K uh in bounties PR across uh three tracks the first one is the defi track here pretty much any sort of defi integration uh qualifies so if you want to integrate our chronical oracles for use cases such such as borrowing and uh lending the apps decentralized exchanges liquidity mining prediction markets table coins Etc next track is the Innovation track uh here we're looking for Innovative projects and The Innovation can stem either uh from the utility of the project or the idea itself and please feel free here to scan uh the QR code if you scan that QR code um I'm going to wait a moment for for people to get a chance I'm going to walk you through the the page that will uh pop up uh when you scan that QR code we got it okay one more one more moment so when you scan that QR code it's going to take you to this uh Bounty page you can see here for each of the bounties you can see the overview of the bounties with all the details uh both for the submission both both some ideas for uh the projects uh you can see here the GitHub repository um that we're going to work on uh today some more information of how to use the C uh the chronical oracles resources very important here for resources we have a scaffold Oracle reader uh built on scaffold E2 so those of you are familiar with Austin's Griffiths uh scaff E2 uh we are using that uh to leverage for our Oracle and very important here you have uh the different addresses for our oracles on different uh networks so you can check out the different networks some of these uh chains are also offering bounties so maybe something to uh consider and finally uh how to get help all right back to back to the presentation yeah finally the the last track and probably my favorite because it's something I think Innovative that I I haven't I don't think I've seen before it Global uh it's a small education track so uh for those of you that um I see here an issue for those of you that uh might not have enough time uh to build a fully fledged project but still want to contribute and to ship something uh there is a small old P full price it's uh 600 um USD dollars for across two tracks I so know that the numbers are a bit messed up um but yeah if you want to build a tutorial with uh chronical oracles this is your track to go now how do I use uh chronical oracles first step is to actually get access so our oracles are uh read protected which means that you need to be authorized in order to read from them the authorization process is called a kiss it's very Whimsical I know and the good news is that on testet you can self kiss you can authorize yourself uh after you authorize yourself uh you are good to go you can start using the data to power your D app one thing to mention here very important is that you need to get authorized for uh each Oracle that you want to use so if uh let's say you want to use it USD and it BTC you will need to do the authorization for each of these two okay and now finally the the fun part here is the GitHub repo that we will work with today for our uh Project Feel free to uh to scan it I'll work a moment I I'll wait a moment for people to to scan it you got it nice so first step we're going to tr create our own uh token I was using here the ERC uh 20 token and I was using the open zi in Access Control in order to uh manage roles we have two roles the default admin role in order to create roles and then the M roles in order to enable uh meting so the address who has the Minter role can mint uh tokens then in terms of the meeting functionality itself it restricts the token minting to accounts uh with uh the Min role and yeah it's pretty much the the classical erc20 uh nothing fancy uh here I put um uh the name of the token uh the ticker feel free to choose to customize it for yours if you follow along uh and I think we're good to go to the Token vendor so the token vendor basically will be the smart contracts where we're going to send our it and in exchange we will get this token that we just created so for the token vendor we're going to start by creating these four uh variables over here the first one is the chronicle this is uh the price feed is of type I chronical this is the interface for chronical uh oracles then we have the self kisser this is of type uh I self kisser this is the interface that uh manages uh authorization for the different uh oracles and then we have minor and owner then in the Constructor uh we're going to deal with the different uh instantiations first one is the min we're going to pass the address of our token that we just uh created the erc20 uh token I put here some uh comments you will see that this is hardcoded for uh sepolia Network however if you're using a different network you can just take uh the address uh from here you can just uh find the address uh from here corresponding to the uh to the network that you're using so yeah here we uh initialize the self kisser and then oops and then in terms of uh the chronicle we pass the uh address of the E USD we're going to use for this example uh it USD and then we're going to self kiss ourselves as I was mentioning earlier in order to be able to read from this Oracle next step is the read function uh itself uh we're going to uh read from this Chronicle that we did in the previous step and then we have the token amount uh function in the token amount function we basically calculate uh the price uh keeping in mind that uh we deal with uh 18 decimal places Precision if you used uh other Oracles in the past maybe you've seen that they have like different decimal places in our case it's 18 decimal places for all our uh oracles also something important to keep in mind here uh we're handling everything in integer mat so solidity doesn't have a decimal so it's important to for example do stuff like uh multiplication before division in order to uh maintain Precision finally we have uh the receive function this allows us uh to basically send it and in exchange uh get our uh token which is getting uh Minter we only have a modifier on the owner to allow uh only the owner and then the withdraw function at the end we want after we collect all these ether we want uh to be able uh to uh withdraw it uh this is it in terms of uh the workshop I'm going to show you a demo of this uh token vendor example uh this is again the the QR code but I think you already uh scan it so I'm going to go and do the demo I have here already the the two contracts deployed the the erc20 token and the token vendor so the idea is now that I'm going to send some eat from my EA my external own account to this uh tokken vendor address and in exchange I should get the token that I uh created so let's see that in action let's send let's say 0.1 sepolia e and after it gets minted we should be able to uh see it on ether Scania okay it's confirmed let's view it on uh e scan sepolia uh so you can see that uh I received some Bianca token if you remember at in the erc20 I puted uh Bianca token the name um of my ERC uh 20 34 uh seconds ago yeah it's it's it's a pretty easy uh example yet powerful to kind of demonstrate you the different functionality how you can read from the uh Oracle and uh how you can uh then um integrate this into your uh D app for the hackaton uh okay I'm going to put this are there any questions sorry a bit louder please um yes so as I was uh saying uh because we don't have decimals on solidity so we need to to deal with integer ma it's called in in solidity and if you're doing first the multiplication it allows you to maintain Precision when you're doing the division so usually in real life math it doesn't really matter if you're doing a multiplication or division but here in order to maintain the Precision of the imals it actually has uh an influence it's it's 10 to the power of 18 it's 10 to the power of 18 yeah yeah no worries any more questions all [Applause] right e e all right hello everyone I'm Ian I do Devin Partnerships at tools for Humanity supporting the worldcoin ecosystem and I am going to talk about global proof of personhood how you use World ID so what I will go over in this workshop I'll go over what world ID is why worldcoin created it what you can do with it and most importantly how to integrate World ID into your project then I've also got a couple extra special notes at the end that are unique just to this event so the big question that world ID answers is how do you know who or what is a real and unique person right you might use captas online to prove that you're not a bot AI is getting really good at solving captas right and when AI gets so good that captas aren't really that useful anymore most places will then default to have you upload a photo of your passport or your driver's license or some other ID and just a few weeks ago the ID verification provider for Uber and lft got hacked and photos of people's IDs got released and lots of personal information so that's not a great solution either right so with World ID you can think of it as this like passport right to prove you're a real human online totally anonymously we've built World ID to be private inclusive and robust right so for privacy we want to know as little about you as possible just that you're actually a real human we want to make sure that as many real humans as possible get to use World ID and we want to make sure that it actually does what it says it does that with World ID you know this is one real person so when it comes to this we looked at a lot of different approaches of how we can help solve this problem right email or phone don't really work well super easy to get extra phone numbers super easy to get extra emails when it comes to doing kyc of official government IDs while it does work fairly well for knowing okay yes this is a real human is verified by some government the problem is that less than half of the global population has a digitally verifiable government ID web of Trust Systems are a little more web 3 native also can work fairly well but they're not quite as scalable as we need them to be right in a web of trust system where you start with maybe a hundred sort of pre-verified people right you might know them personally or they might be well-known figures in the space that can work well for a moderate scale but when you scale up to all of humanity you have to be so many sort of hops away from that initial core set the more hops away you are the less trusted you are inherently and that leaves us with Biometrics is really the next and only way to verify humanness that solves our needs and when it comes to Biometrics there are lots of different biometric factors you can look at right fingerprints face scans Palm scans those are ones that we're all pretty familiar with but face ID and Touch ID on iPhones can only distinguish up to about one in 30 million people and those odds are great for authentication right I live in the US the odds that the person who steals my phone is one of about 13 or 14 in the entire country that could unlock it with face ID I'm totally comfortable with those odds that's way better than just them randomly guessing a six-digit passcode but we're trying to ensure that you unique at the scale of billions and one in 30 million is not going to get us there we also looked at one of the most data heavy pieces of biometric information DNA but that is impossible to do in a private way we can't claim to not know anything about who you are if we're using DNA and it's also really expensive to work with and invasive generally something we wanted to stay away from so we settled on Iris Biometrics right that colored part of your eye around the pupil it's got lots of entropy so it can be used for distinguishing that you're unique at the scale of all of humanity but it's also something that's visible it doesn't require any sort of invasive thing right it's just a photo if you don't want to have that photo taken you can close your eyes it inherently requires like consent and attention whereas a face scan is something that someone could do like while you're walking down the sidewalk going past them so that's why we settled on Iris Biometrics and then when we've looked at what we use to work with those Biometrics phone sensors simply don't have enough detail right a photo of your iris is not going to actually have a high enough resolution to get the iris code that we use to distinguish that you're unique at all of humanity we also looked at off-the-shelf Hardware if you've heard of clear uh at the airports to like Fast Track your way through security we looked at Hardware just like that but that off-the-shelf Hardware is very expensive it's very heavy it's meant to be at a fixed location it's not portable and it comes with a lot of trust assumptions about it right none of that offthe shelf Hardware is open source so we had to settle on building custom hardware and that was a pretty long train to get to being a hardware company which we never wanted to do in the first place but we did and this is the hardware we built this is the worldcoin orb the orb has been in development since early 2020 gone through lots of different revisions making it faster more secure more affordable for us to build and the orb make sure that you're a real human it has I believe over a dozen AI models running on the orb to check and make sure that you're not a cat not a dog not someone holding up a photo of a human not a mannequin head right making sure you're not wearing colored contact lenses to try and trick it into thinking your iris is different than it actually is so and then it takes a photo of each of your irises and on the orbit calculates the iris code a digital representation of the pattern of your iris the only thing we use that Iris code for is making sure that you don't get to sign up twice the iris codes are stored in an S smpc setup so there's no one entity that has your whole Iris code right we are actually like pushing the boundaries of how MPC is being used in production and once we've verified that your iris code AS generated by the orb is unique then we verify your world ID your world ID is a self- custodial key pair stored on your mobile phone and verifying your world ID means that the public key goes into a Merkel Treon chain so that when you use your world ID to prove to some application that yes you're a real human only signing up or doing this specific action once you're generating a zero knowledge proof proving that you control the private key to one of those public keys in that Merkle tree we've designed World ID to be privacy first decentralized and open source or and the orb overall right so with the orb specifically 95% of the hardware is open source uh the only things that aren't open source are the security board which handles like secure signing operations tamper resistance Etc understandable why that wouldn't be open source um and then the major of the orb software is also now open source and we are gradually open sourcing more and more modules as we have them audited and ensure that they're you know safe to put out into the world because we want to make sure that the tech we're building uh is structured in such a way that it's difficult to use for any sort of Nefarious purposes people might want to do World IDE has lots of different use cases that it's suitable for right World IDE is built on semafor a protocol built by psse by the theum foundation and one of the core use cases there was around voting right you want to prove that you're part of a set and that you're casting a certain vote without revealing who's casting that vote uh social media obviously makes sense we've all seen all the bots on Twitter and how you know paying $5 a month for a blue check mark doesn't stop Bots from paying $5 a month for a blue check mark and customer incentives are one that I find particularly interesting Netflix used to have a free twoe trial when you signed up with a new email and people spun up a bunch of new emails and never ended up paying Netflix obviously didn't like that so they stopped their free trials but if they were to use something like World ID they could offer you a two-e free trial or a one month free trial and they know very strongly that you're only going to be able to get that free trial once right doesn't matter what email you use if you try to verify with the same world ID to claim that free trial again they'll know that you've already claimed it we've designed World ID to be super easy to integrate using it either on the web on mobile or on chain there's two main ways to integrate World ID sign in with World ID and Incognito actions so we'll start with sign in with World ID with sign in with World ID you can use off zero next.js use our oidc well-known file with some other Library you can custom Implement your oidc flows on and on and on we'll focus on nextjs if you want to use Sig in with World ID and nextjs this one single provider configuration is all you have to add to your configuration of nexo and then you have implemented sign in with World ID right and we have a template repository that already has this built out right you don't need to try and snap a photo and type all of this into your code editor but it's pretty simple right we are instructing next off to use our well-known file that includes a lot of configuration of what endpoints to use things like that you'll put in the client ID and client secret that you'll get from the worldcoin developer portal and then in the profile we include the ID which is the nullifier hash your unique identifier from World ID for the specific website you're logging into and then the credential type or verification level is this user orb verified or they just device verified right the device verification allows you to install World app on your phone World app checks to make sure it's running on a real phone not a virtual machine and that that only has one world ID associated with it so it's a much weaker civil resist resistance mechanism but still a a valuable one because you'd have to spend at least $50 or so per phone to get another device verified World ID so that especially works well for signing with World ID when you don't want to require that the user logging into your application has to visit the orb first for example then we can also talk about Incognito actions Incognito actions are sort of the Native way to use World ID with Incognito actions your application gets to know that your user is a unique human doing an action only once or however many times you want you can make it two times or three times or 10 times or even unlimited times you have that flexibility and optionally with a tamper proof message that we call the signal right so I'd mentioned that seor the protocol on which World ID is based had voting in mind is one of the key use cases so this signal is where you would put uh the information of who you're voting for for example right it's a piece of information that's an input to generating that zero knowledge proof as well as verifying that zero knowledge proof and if it doesn't match exactly between both of those the proof won't verify and that's how you can make sure it hasn't been tampered with another place that you might use that signal is if you are say gating an airdrop behind World ID you might have that signal be the wallet address that should receive that airdrop and then when you verify that proof in your smart contract on chain you know that when they generated the proof they wanted it to go to this address so just send it to that address rather than maybe the uh the wallet that sent the transaction and the flow with Incognito actions is quite simple a user will scan a QR code created by ID kit our SDK that's displayed in your application's front end and that tells World app running on their phone what application in action they're verifying for the user will generate the zero knowledge proof on their phone and return that zero knowledge proof to your application's front end and then your app will verify that zero knowledge proof and you can either do this offchain or onchain offchain it is an API point on our developer portal whereas on chain it's directly in the smart contract right and this is that zero knowledge proof that your app will receives the Merkel root says you know this is the root of the Merkel tree that this proof was fa or cre Ed against um the Merkel route on ethereum mainnet for orb verified users is updated at least once an hour because we batch insertions from new orb signups that nullifier hash is the unique identifier of that user for this specific action right so for signing with World ID that will be anytime they sign into your app this is that identifier or if you're using Incognito actions uh that nullifier hash can vary if you use multiple different actions within your application right so if you have a vote once a week you might use a different action for each vote the proof is actually much longer than it looks here and that is mathematically the Z knowledge proof that's getting verified and then the verification level tells you if this user is orb verified or just device verified so let's see what using World ID in COG to actions actually looks like so if I go to the worldcoin docs in our try it out section you can just experiment with World ID here so we'll go with Incognito actions in the production environment since I have World app installed on my phone I will say I want a minimum verification level of device verification and we have this action with this randomly generated string here so I haven't performed this action before so I'll click continue with worldcoin and this QR code pops up so I can either scan this with the QR Scanner built into World app or just with my phone's camera and it will take me to the app I see information about what application I'm verifying for a description of the action and I tap verify with World ID so then on my phone that xeron proof is generated sent back to the application this application passes its proof or passes this proof to its back end and its back end calls the worldcoin developer portal to verify it offchain and we see that I successfully verified so if I try to verify for this action again I've generated another proof it gets sent over to this application and we can see that I've already verified for this action doesn't let me do it twice so any integration of incognito actions starts with ID kit with ID kit right and for this example we're using react uh ID kit is a single react widget you give it the app ID and action as you configure them in the worldcoin developer portal on success and handle verify are two callback functions handle verify gets called as soon as it receives the proof but still shows that pending State on success gets called after the uh proof has verified successfully uh handle verify is optional uh because for onchain use cases right you don't want to keep ID kit open but have to you know have the user send a transaction so for onchain you would typically just not Define handle verify on success would store that proof and then you would have your user submit the transaction on chain that would include that proof to verify uh and then that last parameter the verification level you can set the minimum verification level you want for your user that one's also optional it defaults to orb verification but if you're doing an app offchain and you want to let the device verification be allowed you can also specify the device verification and then the child of the widget in this case it's just the button that opens the widget uh we do also have a vanilla JavaScript package that you can use um and we have a we also have a cloud verification template using nextjs if you're interested in that right so this proof response here is what gets passed into the handle verify and on success call backs right so after we see that green check we're not done with it I have seen lots of projects both at hackathons and like production use cases that get this proof back and think great the user's verified but that is essentially you know a piece of paper that says yeah I I'm human right you have to go check that the signature on that piece of paper is legit so we have to verify the proof I cannot like make that clear enough we have to verify the proof and when it comes to verifying that proof right I've said we can do it offchain and onchain and I'll start by describing how we do that offchain right so in your back end this again is a nextjs example we have our app ID in action from our environment variables uh we get the proof object and the signal from the front end right so the signal if that was specified you can have it be whatever you'd like uh we get that in the request body to our backend we have this verify cloudproof helper function that will call our developer portal pass in all the necessary information and will return a success response or an error based on whether the proof verified or not it'll explain why the proof wasn't verified and then if it was successful you should return that successful response to your front end or you should uh you know send a response to your front end explaining why it didn't succeed um but you would also typically want to actually do something now that the user's verified and you should do that in your back end where the user can't manipulate State like they can in the front end so that might be that you mark the user is verified in your database uh it might be that uh you go ahead and you know send them a discount code on Shopify for example that's an integration that we've built um but verifying these proofs is super simple it's a single API call and we have a helper function that abstracts that away for onchain verification it's a little more complex but again we have a template repository that already has a very basic smart contract written for you so in the Constructor of your contract you need to input the app ID and action ID again as you got them from the developer portal but World ID here is the address of the world ID router right that is the Smart contract that is a proxy that will always make sure that you know that contract stays consistent and that's where you call the verify proof function submit the proof and get to know if the user is actually verified with World ID or not the external nullifier as defined here is actually a term from semaphore if you're familiar with it you'd know that that's what they use to scope the uniqueness of an action for us we combine the app ID and the action ID to create that external nullifier that is so you can have multiple actions within one application uh so when the user scans that QR code they'll see the same app they'll see a different description for that action uh but in seore like every time you change that action it's something different and the external nullifier is just the value that defines that and then the function to verify and execute something here right that's left undefined it takes in the signal the root of the miracle tree the nulli fire hash and that proof object itself a very long hexadecimal string that's really just used for all the math and the first thing we do is that we check a mapping that we defined earlier um that should have been in the slide for the Constructor um we have a mapping of nullifier hashes where when we sort of use a nullifier hash we Market as used so first thing we check is have we seen this nullifier hash before or if we have we know the users already done this action we're just going to revert because we don't want them doing it twice you could also have that Ma to an integer and count how many times they've done it and limit them to doing it five times but once we've checked that the user hasn't done this action before then we call the verify proof function on that world ID router we pass in the root the group ID which onchain currently is always one for the orb verified group uh device verification can't be verified on chain at this time um then we have the signal hashed a specific way to ensure that it's within the field of the curves used for the zero knowledge proof a nullifier hash that external nullifier res set in our Constructor and the proof that verify proof function call Will revert if the user is not verified or the signal is incorrect or for whatever reason it shouldn't but if it does verify correctly the program just continues there's no value returned or anything like that so the first thing you should do after that proof gets verified successfully is that you should Mark that nullifier hash is used and after that is when you should do whatever it is that you want the user to have happen after they verify with World ID so that could also be marking their wallet address as verified if you want to reference that later that could be going ahead and sending them tokens as part of an airdrop right that is where your your application to find what happens now that you know the users verified so we have $220,000 in prizes overall 10,000 of that goes to the four best overall projects so $4,000 to first place 3,000 to Second 2,000 to third 1,000 to an honorable mention we have $2,500 each for the most creative use case the best governance app and the best public goods use case and then a $2,500 prize pool and in that prize pool uh that is for projects that don't win one of these other prizes but make a good faith effort to integrate World ID right so if you just say that you integrated World ID or have somewhere in your code a comment saying this is where we put World ID that's not going to have you be eligible for the prize pool but if you make an actual effort to integrate World ID right if you have ID kit in your front end and some commented out code in your contract saying so we couldn't get it to work that's a good faith effort right and I will be at our booth all weekend I'm probably sleeping here Saturday night because I like staying up late working with hackers right so it's much more about like trying to use World ID obviously I want to help you get the Integrations to work that's why I'm here um but if you aren't able to get it to work correctly you can still get some funds from that prize pool and then as I mentioned at the the start of this there's a couple new things that I'm excited to talk about here the first of them is that just on Tuesday we announced that the developer preview of world chain our own op stack layer 2 is now live so if you want to apply for access to this Dev preview you can go to worldcoin dogworld dchain dpreview um and this Dev preview is more for protocols and existing products that want to deploy to World chain before General availability um but if you're interested in building on world chain during the hackathon you might be able to get you access but a lot of the protocols you'd expect to be there aren't there yet and that's why we don't have any bounties around uh World chain so far and then the next thing I'm really excited about this is the first time we're publicly talking about world ID mini apps mini apps create a seamless integration of world ID Incognito actions signing with World ID or inapp payments by having your application open in a web view inside of World app these apps can be displayed on the world app homepage they're discoverable by our 10 million plus World app users um and getting your app in front of six million verified uh or verified humans around the world it's a pretty good distribution mechanism for this industry especially if you want to learn more about mini apps and get Early Access come see us at our booth the team member responsible for them is arriving this evening um so I won't be able to help you until later this evening but learn more come chat with us thank you all for your time at worldcoin org Brussels 24 you can see a notion page that covers a lot of what I went over here links to our template repositories everything like that and you can come find me at the worldcoin booth at almost any time through 8: or 9:00 a.m. on Sunday and then after that for judging I have to sleep a [Applause] bit e e go cool hey everyone my name is Jared representing the polygon Labs team uh as developer relations engineer uh just in case you want to reach out to me ask me any questions and for whatever reason you don't want to ask me in person probably the best way to reach out to me is on uh Twitter just send me a DM and I I'll be able to reply but uh I'll be around like everyone else all weekend so don't be afraid to come up to me and ask me any questions uh related to this talk or just polygon in general I'm happy to have a chat with you so I thought about what I wanted to present at eth Global and you know I'm uh audience member a lot of the time myself and I kind of find myself scrolling Twitter messaging people not really paying attention to what's being presented because uh I don't know whatever it is like my my brain rot or or whatever it is I'm just not paying attention so I tried to keep it as like brief as possible I think there's like 20 words Max on the whole slides um and just link out to a bunch of resources that I've created to help you uh understand what the poon cdk is so hopefully I can keep keep your attention for uh the presentation all right so just tldd like what actually is the polygon cdk it is our chain development kit so cdk chain development kit and it is a way to build your own ZK powered layer to blockchains so specifically ZK EVMS um and the story behind it is essentially we open sourced our ZK evm uh production main net chain around a year ago and then we've been running it in production ever since and we said you know what we already have all these components we spent the time and resource Research into uh ZK and the issues that you run into running a production ZK evm why don't we just open source each of the individual components and create a kit to combine all of those components to make your own L2 just like the polygon ZK evm the idea behind it is that you can kind of plug and play different modules like data availability uh you can choose what type of ZK Behavior you want like type two type three Etc and essentially just pick and choose and configure and customize each of the aspects of the chain that you want to build um but the kind of default behavior is it is essentially copy pasting the zkm and changing the data availability module to be a validium instead of a rollup but all of that is configurable all right so here's what we're probably all here for uh at eth Global is to make some money so I put this this slide nice and early um this is our Bounty for the polygon cdk so you can see we have eight grand us over five different projects uh the first prize winning three grand us so um some money to be won I wanted to put that nice and ell to keep your interest up all right so with the cdk uh like I said the main goal is to build your own l2s but the pathway to get there can be kind of split up into two different uh categories one is with no code so I'm going to show you a quick little demo of a platform that'll allow you to ship your ZK evm in just a couple of clicks and then for our more hardcore devs I wanted to show you how you can get started locally running all of the components like the sequencer the aggregator the bridge inside of Docker containers on your local machine which is uh a bit more fun to kind of configure and customize the behavior of the L2 so first I'm going to show you through uh the process to do it in no code so you don't have to scan the QR code but on my channel if you just search my name or search build a zkm you should be able to find this uh on YouTube and pretty much what I do in this video and as I'm about to show you is literally in like five minutes you can launch all of the components required for an L2 in testnet and if my demo works I will show you that as well in this presentation but just in case it doesn't I have pre-recorded uh the exact step-by-step tutorial on how to launch your your own L2 test net and show you each of the components and then also show you how to build apps on the test net that you create as well so just before I show you the demo the way that this works is typically polygon Labs doesn't run the infrastructure for uh whoever wants to build the l2s we've kind of uh partnered with these implementation providers and kind of vetted uh expert teams who are qualified to launch these l2s and run the infrastructure for you and maintain that over time so these are often called rollup as a service providers or Ross providers and like I said it literally deploys all of the components the aggregator the Prov the sequencer Bridge RPC and even the developer tools that you need if you're kind of kickstarting your ecosystem like a faucet and a block Explorer etc etc all right so my little man over here didn't quite fit on the screen but what I wanted to show you now is one example of these implementation providers and this is called Gateway so I'm going to Tab out here and make this little full screen so this is Gateway one of our implementation providers who can launch a ZK evm with the polygon cdk and I want to show you how easy it is I realize I'm not signed in so I might have to do that but I literally just click deploy you don't have to uh get a credit card you don't have to put in any personal information all you need to do is just click deploy I've just signed in sorry click click deploy and I already have one so I will show you what it looks like once it's provisioned so it'll go you literally just click deploy you click through a couple of options this is the default Behavior here and here is mine called uh it gives you a little demo name but these are all of the components that it deploys so you can see I have my own RPC I have my own chain ID I have my own URL here is the information about the gas so before you actually get to this page you'll go through a couple of different configuration options and reach a point where you say yeah I'm happy with the configuration of the chain that I'm about to launch and you'll reach this page after a couple of minutes of provisioning uh the resources required to host each of those components for you behind the scenes so this is like the easy route I would say if you don't want to run it all on your local machine but like I said you get the bridge you can actually go to this URL I think this one is hosted that doesn't look good does it that's the demo effect right there but what you would hope to see is the uh Bridge from the L1 test net to your L2 test net of course the demo effect is uh in play here but that is like the uh easy route as I was saying so this is really no code and like I said you just click through a couple of pages configure uh the options that you want like the gas settings uh what L1 you even want to host it on is customizable as well so it's pretty cool custom iations but the other route that you can go through is to launch everything locally on your machine as well inside of Docker containers so this is pretty fun uh I've been playing around with this for like a couple months now and this video will show you the first hour I know two hours is kind of scary but the first hour is just concepts of like what is an L2 uh what why would you want to make your own L2 what are the different configuration options like data availability uh different kinds of approvers all these like fundamental concepts of stuff that you would probably want to know if you don't already if you're launching your own L2 so that is also you don't have to scan the QR code you can just search that up on my channel as well but that will walk you through what this is here which is our kosis package so the kosis cdk package is it's kosis is an open source Dev tool that specializes in uh kind of orchestrating these containers for you so you specify what steps you want to occur and how those pieces that you launch should interact with each other so for example in the default Behavior it will launch a local L1 it will deploy the rollup smart contracts to the L1 it will deploy the node containing the sequencer the aggregator uh the bridge from the local L1 to the L2 all of these components and it'll kind of like sequentially go through them and build the relationships between each of those components and then you just swap over to your do and you can view each of the components running sorry each of the components running and then uh kind of shell into each of those instances so for example if you shell into the RPC you'll be able to see all the requests firing off the effect of how much each of those transactions cost in terms of gas and you'll be able to track those transactions just from the logs running on your local machine which is pretty cool as you'll see uh in the video as well so I know it sounds scary to run all of these components like the sequencer theover the aggregator but it's actually super simple it's literally two lines of code with a massive caveat of having a bunch of stuff installed so it assumes you have uh docka and python and a couple of like basic Dev tools installed on your machine and all you need to do is clone the repository change into that repository and the second command is the ketosis run command so basically ketosis is a CLI tool it's going to inspect uh a file that tells well basically tells it what to run and in now case it's going to run each of those components launch them and kind of deploy each of the required smart contracts in sequential order so yeah like I said to get started massive caveat you must have a bunch of stuff installed like Docker and python uh couple of other CLI tools but once you get it uh your environment running it's literally one command and it's going to deploy every single component instantiated inside of Docker containers for you the one cool thing I'm just going to check what okay so this is what I wanted to show you is like uh a preview from the video and the reason I didn't do it live is because it takes around 15 to 20 minutes to deploy and with the Wi-Fi I uh didn't trust the process to go very smoothly so I just took a little screenshot of what happens when you run this command from the video um where I skip through all of the all the breaks and explain what's actually going on so you can see in this example it basically literally just goes step by step through here's every single thing that needs to happen when you're launching your own L2 so for example here you can see this is adding the synchronizer it's deploying the smart contracts it's then going to deploy the components of the node like the uh sequencer and the aggregator and basically it just goes step by step prints out the logs of what's happening in that deployment process and at the end you'll get either a big giant red error message that says what's gone wrong or you'll get a green error message to show you here is the docker um container IDs of each of the services and I think what I wanted to go through before I I know I'm going back and forth sorry this pam.
yml file is like hundreds of lines of configuration options so uh there's a couple of config files like pam. yml that you you can configure uh how often you want to post batches of transactions to the L1 how often you want to post proofs to the L1 uh what the gas limit is like what token you want to use for gas there's like hundreds of lines of codes hundreds of lines of configuration Flags in this one file and then you can even go deeper and configure the behavior of each of the services like the aggregator and the prover and the sequencer and configure um pretty much like at a very granular level what's actually going to happen when you run this ketosis run command cool so I just put this here at the end I know it's kind of like scary but I wanted to talk about what you're actually shipping so I keep yapping away about all of these components like the sequencer aggregator Etc but what actually happens when you run this command is you pretty much instantiate all of these pieces and this is even simplified of what you launch so there are a lot of moving pieces but what's going to happen is you launch the first you launch a local L1 but you can also swap to sepolia which is what I do in the video you deploy these smart contracts here so basically you deploy a rollup smart contract that is responsible for receiving the batches of transactions as well as receiving the zero knowledge proofs to verify those batches of transactions so the steps are deploy the L1 which is optional you can choose to deploy to ethereum test n if you are rich in uh ethereum test net funds you then deploy the bridge smart contract and then essentially I'm simplifying it here but you deploy uh a trusted node and a trustless node which contains the aggregator it contains the prover and it contains the sequencer here so the sequencer basically reads these transactions from the L1 takes them in executes them so it's like is this transaction complete garbage is it uh a duplicate with another transaction in the pool that's been submitted is it uh going to conflict with another transaction in the transaction pool basically it just does a couple of Sanity checks and then executes them or discards them and then it gets sent so there's a a kind of sub component of the sequencer called the sequencer sender I think and that is going to send the batches down to the L1 and then this kind of SE process gets kicked off where the aggregator says hey I see you've got some nice looking juicy batches for me let me go ahead and prove those sends it to another component that you've deployed inside another Docker container who proves generates a zero knowledge proof sends it back to its buddy the aggregator and posts it back to the smart contract that you've deployed on the L1 so there is a lot more pieces like the the bridge and the RPC and the block Explorer and out of the box you also get get this awesome stuff to kind of inspect what's going on to see how many people have bridged how much funds have been bridged uh the block time the the time that has elapsed since you've last proven the blocks all of this cool information is kind of uh ready for you out of box just with this two commands that I showed you in one of those previous slides nice so one of my goals before coming to CC was to ship some new cdk docs um so I just chucked this around right at the end to say we've just shipped like a week ago uh new overview page new getting started New Concepts all brand new fresh docs uh ready for the hackers to kind of play with in case you're sick of listening to me in these videos as well you can just read the text uh it's pretty much exactly what I'm doing in the videos is just going through the process in these documentation so yeah that's that's pretty much all I had like I said very text uh light so hopefully it kept your attention but uh um yeah $8,000 available to be awarded for projects building their own l2s I've been saying to a couple of teams already some strategies for teams is to ship a cool product build it on a couple different l2s why not slap on your own L2 and ship it there as well it's uh like I said very very easy to do but if you want to go more granular get some cool customizations you have cool idea for creating custom L2 uh you can experiment with the local deployment as well yes Mr Blake a lot of are a lot of ideas around would the best to start a team to discuss IDE is into where should I start if I do that yeah know yeah so just to repeat for the stream the question is like what's the best resources to get started with the cdk for the hackathon um I think there's a couple I think the obvious ones just come speak to us like uh see if your idea is feasible if you have a crazy one um if you run into any issues like just come and speak to us I know uh some of us are a bit scary but no we're we're very I'm super Keen like I've been working on this for a couple of months trying to improve the developer experience so I would love to hear if you think it's complete garbage please come and tell me if you can't get anything running please come and tell me um what you should also do is we have a ton of our Engineers who are about 100 times than I am in our developer Discord or R&D Discord so you can jump into our Discord server and speak directly with the engineers that actually built the tools that I'm trying to uh Shi to you here today as well um and I mean if you take it a step further we also just shipped our grants program so I mean there are kind of Pathways to develop this more seriously um if you're looking for kind of financial rewards after the hackathon as well so happy to comment talk about that at our booth too round two yeah are there any use cases that you would to the like you know soltions problem stats that yeah I think there's there's like like you said there's options to go completely off the deep end and try and ship something combining I don't know maybe like you could combine one of the da tools that is here and ship a a new roll up with a different da tool I think a cool one that's pretty simple to customize is like changing the gas token of the L2 that you ship so something that would be sick would be like if you launched your own L2 with usdc or something like just kind of one simple change that doesn't exist today um for example changing the gas token or or changing what um where you send the data to or or things like this that's you know it is approachable you could go completely off the deep end but within 36 hours uh I realize it's probably probably a lot to ask to go too crazy but um yeah like I said I think the best approach would be pretty much just come and talk to us see if your idea is feasible um the whole idea of this is is meant to be customizable so um we're keen to see pretty much anything that people come out with uh and if you think like I said it's it's terrible it sucks I don't want to use this anymore that's also amazing please come and tell us so we can improve it uh for for future iterations as well sweet no more questions awesome thank you [Applause] for
Automatic transcript — names and jargon may be misspelled.