Nerif Network: Automating Non-Core dApp Processes

EDCON 2023 · 23 May 2023 · 8:34

Johannes Kern, co-founder of Nerif Network, explains how automation can reduce repeated maintenance work for decentralized application teams. He distinguishes core application logic from surrounding tasks such as processing off-chain data and coordinating cross-chain activity, then introduces Nerif’s approach to automating those tasks.

Speakers

Topics

From EDCON 2023, hosted by EDCON.

Transcript

yeah hello everyone my name is Johannes as he said I'm with nerif and what we do is we make web3devx suck a bit less and we hope to improve everyone's life in here everyone who's building that's really what we do so you know how does a d-app look like you would think we have some blockchain right on top there's some business Logics some smart contracts which are you know having containing all the functionality and then on top of that you have some kind of user interface which allows you to interact with the smart contract or a set of smart contracts now the reality looks a bit more like this right you have a lot of moving Parts you might want to include

off-chain data you might want to have Crosshair interactions you might want to process things you might want to have events a smart contract doesn't execute itself we have some to have some kind of trigger and all that stuff you need to build and all those different things they make actually developing a diab a headache it's a non-core parts as we call it and maintenance is even worse you know we've talked to to some larger projects out there and said that you know about 20 of the engineering and then of course is it running all those moving Parts it's not about you know the actual contracts in the middle but it's all that stuff around which makes it really really annoying and complex to use also

many of those non-card non-core parts are repeated they're repeatable everyone uses them everyone needs to have some kind of scheduling everyone needs to be able to react in some kind of events so let's automate it and that's exactly what we do with narrative one more comment and we'll get to that in a second what about platform risk right do you want to trust the centralized system to automate your stuff and if that system breaks your system breaks not really so what do we want to be do right a narrative we are with the biddlers from the beginning when you start building a project you open your vs code your ID of choice the open remix to debug to deploy things the open hard hat and you also open nerif it

basically what it allows and you'll see that in just a minute it allows to automate and enrich your d-app from day one while building it and the whole thing that's the cool part it's completely decentralized you don't run any kind of party risk narrative is a separate physical Network that allows us to be cross-chained 0.1 but it also allows you to have peace of mind that no one you know not the centralized entity no one can change your workflow once you've deployed it and you can be sure that it's actually executed the way you have built it okay let's build something very simple example a lottery contract or a lottery app so how does it work on one hand side you can pay in money into

this the app and then once a week by Magic One winner gets chosen out of everyone who's paid in and it receives all the money very very simple however which is with Native tools you can't build it because who's going to pick the winner so please start the video and I'll walk you through it okay so here we have the smart contract of that logic contract you see there's a function called enter in the middle um and there's a function called Pig winner the function enter allows you to you know enter its payable and the function pick winner is basically just

executed it checks is there enough players in the game and if so it randomly picks someone and sends to money there now please don't nail me on the security of the smart contract I know the random function is not very secure it's just a demo Okay so we've seen that and now we open the narrative application give the video a minute please can I exactly we log in using my metamask you don't see that in the recording but I'm basically just signing a message and now we're logged in into the the app which is interacting with the network we

built a new workflow they call it workflow Lottery and what we want to do now right we want to execute this workflow once a week now do it once a minute so we actually see how it works but you can choose different triggers all cross chain we're going to use now Chrome rule and we Define this we want to run it once a minute and then what we want to do first we had an action we actually want to check first to make a gas efficient is there enough players in the smart contract so we select the chain polygon Mumbai in this case you can all do all cross chains so you can basically mix and match

inside workflows we copy here this Mark the contract address and the function you want to execute is player exists then based on this data we get back from that call we check okay is this function we get back through so we select that same variable we had before and we check if it is true if it's false that means there's not enough players in the contract we basically just exit the workflow we don't do anything if it is true now we pick the winner

right this way we only spend gas we actually only write to the contract um if there is more than two players in the game once again we select Mumbai same contract address we now have to put a gas limit because that's actually going to cost us something and we now execute the pick winner function on that contract very simple very simple let's deploy that will deploying it on chain so it's completely decentralized it's now registered in in the narrative smart contracts on polygon Mumbai that's it it's pending quickly it's going to be

active just in a second and now we can try it out so now we switch over to our smart contract we have deployed we connect my meta mask once again with one address and we execute the enter function with 0.2 Matic we switch now to a different wallet we once again do the same 0.2matic that's it so now we have two players in there so now we should choose you can see there's two players who've entered and we should see just in a second how now that this workflow is being executed

every minute um it selects a winner you can see here exactly the winner already if we go into that transaction you see 0.4matic have been transferred from the smart contract onto the winner of that Lottery very simple example I think um everyone in here who's a developer knows how you can build a lot more complex things because that it's basically Limited on limit to to scale at I'm stopping it now um and then we can actually go back to the presentation so one more thing um narif Alpha is live you can try it out it's currently live and active on

five different evm chains we have it on polygon Mumbai we have a diagnosis we have it on ethereum um girly we have it on linear and we have it on BSC so it can you know really build really cool cross training attractions if you use the referral code narrative edcon you'll get Priority Access and you can actually start building very very quickly So yeah thank you very much for this if you have any questions I'm here [Applause]