DappCon 2023: EVM vs SmartWeave: How can EVM chains interact with Arweave - Marcin Kazmierczak

DappCon 2023 · September 2023 · 19:19

RedStone Oracles co-founder Marcin Kazmierczak compares the EVM's execution model with Arweave's SmartWeave, at DappCon 2023. He walks through how oracle infrastructure could bridge the two, letting EVM chains pull verifiable data from Arweave's permanent storage layer for use in DeFi and other onchain applications.

Speakers

Topics

From DappCon 2023, hosted by Dappcon Berlin.

Transcript

hello everyone I know it's hot I know it's late so I'll I'll try to keep it fairly compact so my name is Matt I lead BD for Redstone which is mainly an oracle provider but we also do General infrastructure and our second product is warp contract so naturally I'm also a contributor to warp itself and this presentation is going to give you like a brief intro to how you should think about evm systems in comparison to warp contracts and smart weave so um the framework of building smart contracts on top of rwe which is a data storage layer

I'll also quickly explain on why those sort of ecosystems are not competing against each other they are fairly complimentary but I'll dive deeper into that um in a second as well so first a bit of context so obviously a smart contract is a piece of code that you can run in a decentralized way but when you look at the market of smart contract development right now then you can see that it's fairly dominated by evm obviously and the most prominent language of evm which is solidity but also when you look at the second place well the second place is taken by Viper so another evm based language so even though there is an increasing number of competitors joining

this space it's still very much dominated by evm based languages but obviously evm does have its own sort of drawbacks that you have to keep in mind so in general it's it's fairly convenient to use it right now because everybody uses it because the market penetration of it it's so deep that you have a large database of knowledge you have a ton of um YouTube tutorials on how to use it but when it comes to its important char istics what you have to sort of keep in mind is that it has a shared memory and shared state so sharing that in general it's not an easy task but from the point of view of a developer or from the point of view of

smart contract execution what you want to be doing is writing code and contracts that can access the whole Space of that memory because it's almost as if you were running a local local process but obviously from the point of view of the network it's not that easy because what you have to do as a network is you have to will incentivize a lot of developers to keep a lot of data at hand at all times because all of that data needs to be synchronized across thousands and thousands of of nodes which becomes increasingly expensive that is why storage on evm based systems is super super expensive and to give you a bit of context for

that if you wanted to do an nft the proper way so instead of just storing the link to the content on chain if you wanted to store the content itself on chain let's say an image in the Raw format directly in the chain storage you'd have to pay around $100,000 just for one picture right now to get that on chain so you you'd have to be probably out of your mind in order to to do it so that's how expensive storage is right now on EV based systems and this is a huge limiting step if you want to build a data heavy application on top of an evm

system however we have R weave and for those of you who don't know R weave is a data storage layer so it's specifically designed to store large amounts of data indefinitely or at least for 200 years that is what the r weave team guarantees right now based on the math so basically indefinitely and the most important thing about it it's that it's a blockchain as well so you have all of the security guarantees of a blockchain including things like time stamp verification for for the computation or the strong guarantee of the Persistence of that data you put on R weave as long

as the network still exists and that is great the storage capabilities of rwe are great but what if you want to build some Logic on top of it so what if you want to determine okay how do I get the data in R weave or how how do I get the data out or if you want to build like a real product or a business on top of it then you have to use something that's called smart weave and smart weave is basically um a paradigm on evaluating the smart contract state that is a bit different to what you see in the evm based ecosystems because it's based on the premise of something that's called lazy evaluation so the data layer itself

does not do any arbitrary computation itself it leaves that out to the smart contract caller so I don't want to calculate the state of the smart contract I'll just leave that to the smart contract user and that's why I'm lazy hence the name lazy evaluation so if you are the smart contract user what you have to do is in order to evaluate the state you have to go through all of the interactions that all of the users on R weave have ever done and basically calculate the state of that uh smart contract from the very very beginning from the moment of inception of that smart contract that is how you do it and

so basically the way it works with smart weave in other words you just put the code out as a developers as a developer for people to use then the users come in they interact and calculate the state all of those interactions are saved permanently on our weave and then the state can always be re-evaluated by based on those interactions now what you have to do and know about smart weave is that it used to be not really usable back in the day at least before warp contract so the product we build At Redstone came about because what we did was we basically took the philosophy of smart weave and just made it production ready and

feature complete so that developers can really build and deploy smart contracts on our weave so what we are doing that is basically the original idea behind smart weave is we are just putting the code into the storage so as a developer you have a decentralized and trustless access to the code you're about to execute and then we also decouple the execution of that codee from the code itself so why do we do it why do we do it because basically when you decouple those both sides of this this equation you can really upgrade and and optimize both of them independently okay and this gives you a lot of flexibility in terms

of things like the choice of language you would like to use for that so with warp contract we've we've gravitated towards JavaScript which is basically well the Baseline language for all web development currently but obviously it's not just vanilla JavaScript we've done like a subset of it just to make sure that everything we do with that JavaScript is deterministic that every computation we do is is safe and deterministic but we are also big proponents of sort of bigger um environments for doing these things more um environment that just make more sense things like wasm or rust specifically

just for you as a developer to have a bit more control over the costs and the complexity of the computation you're about to execute so warp contract currently is the most prominent and the most popular implementation of smart weave there is so basically you could say it's the default way of of building smart contracts on top of R weave that's mainly focused on modularity so that you can upgrade separate pieces of that system yourself it's all open source you can Fork it as well and if it comes to the most important parts of that system well you have the gateways which are directly responsible for indexing the

transactions on our weave so that we have the best possible view into what is the current state of that Data Network we've got the sequencer as well that is probably the most interesting part because obviously sequencer what it does is it just orders the transactions you can also as a user you can send your transactions directly to the sequencer and what we are going to do in the upcoming months is we are going to release a decentralized version of that sequencer that we were working on for the past one to one and a half years so it's going to be you know a lot of work has already gone into that so I think it's going to be a very robust kind of

an implementation so if you're interested in those kind of topics decentralization of sequences then you should definitely follow us on Twitter because more info on that will be coming up soon we obviously have the wasm um environment for deterministic execution for you to have more control over the costs and complexity of that execution we have the Dr nodes which is a decentralized execution network if you don't want to do the computation yourself what you can do is just delegate that to the Dr nodes what they do is just take the code calculate uh the state and give you back the results and obviously we also do have an SDK for developers to build smart contracts

easily on top of our weave so the way it works operationally when you look at the life cycle of our transaction is it all starts with a sequencer then it goes directly to our Gateway and the result of that is used by the executors to evaluate the state you can do it either yourself with your own rules or you can just delegate that to the Dr noes now so what's the business value behind all of this what are the use cases that you can do with smart weave but you can't really do with evm based systems so let's take content once more as an example and nfts so we got used to using nfts on evm based chains we got

used to owning trading uh trading them and and just having them in our wallets but what we really do have in our pocket when we say we own an nft is well just a derivative right a representation of the underlying content with no underlying content itself being stored on that chain and that can be problematic because what we see happening more and more often right now is those kind of zombie nfts where the content has already been deleted or whatever the storage has expired there's a bunch of different reasons that you can have behind it so basically there is just this empty shell derivative but there is

no underlying content beneath it so an atomic nft is basically a different kind of an asset because it gives you a single place where you can store the content itself as well as the logic for trading that token so what you really own is the content itself as well with that underlying logic and what you trade is the same kind of a situation the content plus the logic so there is no possibility of the content evaporating suddenly going further we have a lot of decentralized databases or databased systems being built on top of work right now so these are those systems that let

you define okay how do I get the data in how do I get the data out of our weave and you know do all Bunch whole bunch of stuff like indexing the data formalizing it um processing it whatever you name it these are protocols like we DB a first bch and a couple of different very strong teams building right now on top of warp to for all the people that would like to build a permanent um decentralized like truly decentralized database AI obviously we do see the the the Boom in AI but with that boom comes a lot of protocols that would like to build it in a truly decentralized and

open way not only calling themselves open AI as some people uh do in the Silicon Valley so what I what I mean by this is basically training the models in a open way so you can see all the inputs you can see all the calculations you can check if there is any malicious or potentially malicious data involved in that whole process and this is probably the way AI should be built in the future not sure if it will be built this way but it's probably the way it should be built so I just hope that those kind of solutions get more and more traction as we progress with the development of that sphere as well so basically those kinds

of use cases are not even close to be possible on evm based systems just because of the sheer volume of data that you have to process and just because of the amount of computation that you have to do in order to make this work so for this kinds of use cases warp is an enabler and R weave is the data storage layer as well data FY so you can think of those sort of content markets um the way you think about social graphs right now it's a bit of a of a broader category than social graphs but in general these are the markets that can allow you to incentivize people to post content or reward content

creators or content curators actually for what they do and this sort of plugs in really well into my last slide today which is going to be a little bit of a case study so this is a real business use case that we've done with lens protocol you've probably heard about them the biggest social graft to date uh to my best knowledge so basically what lens does is they have a lot of interactions between users between users and the protocol it's all based on polygon as the underlying originating chain but what lens needs is first they need to

offload historical data of those interactions somewhere and R we is definitely the place to do that but it's it's fairly easy it also goes through warp but what they also need to do is to give you an example let's take comments on L as an on lens as an example here so let's say you want to reward the person that comments you the most in the lifetime of your profile so what you can also do thanks to R weave and warp you can just look at the historical data retrieve it and Bridge it back to the originating chain which is polygon in that specific use case so now this data is not only stored permanently but it

remains operational throughout its whole lifetime so you can just Bridge back the data package with what you've just calculated and then just trigger the smart contracts of lens protocol to reward the right people or do whatever you want to do with what you've just retrieved from our weave so there's many many more of those use cases WE Post post a lot about them on our blog and if you would like to dive deeper into how that works specifically then probably our website and our blog is going to be the best sort of uh place to start so that's it from me for now if there's any questions just hit me up right now yeah

we have uh about five minutes for for questions right over here um you shared a very interesting example uh about nfds we like that you can store the data permanently and have a programmability of the the nfts and the interactions essentially reminds me of some of the things that are currently uh built on Solana and are gaining traction I was just wondering if you could maybe share some uh statistics of projects like that are already using this and uh if it's gaining traction on Warp mhm so I think I don't have the exact numbers on nfts specifically but just to

give you like a benchmark on how that looks like so if it comes to to my best knowledge um protocols that have deployed something on production in general with warp it's about 35 teams in general if it comes to if you wanted to count all the GitHub comets also those that are not yet deployed to production that's around 80ish protocols so in general the the numbers are not like super big yet but there is more and more big pliers coming like like lens protocol and also if it comes to rwe and salana so I'm sure you know about metaplex so basically R we I think it still is if I'm not mistaken um

is like the underlying storage layer for nfts on salana through metaplex anyways but yeah if it comes to that specific use case I'm not sure if some somebody did that on production already on our weave would have to double check that but yeah it's definitely an interesting use case if you can do that on Sal it's also it's also great I'd love to dive deeper into that but in general I I just believe that this is probably the way you should do nfts in general in the long run just for it to make sense and just for it you know to have like this um historical almost value because I like to look at nfts also as you know as pieces of history but if the underlying context is gone then it's like you know it's an empty shell you don't really have that behind

it so super interesting use case definitely any other questions for Matt all right I think we'll wrap it up there thank you so much Matt and uh please join us out on the patio for a happy hour