New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Sygma 🛠 An SDK for Interoperable Apps -Nicolas Riquelme Guzman

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Nicolas Riquelme Guzman from Sygma for a workshop titled "An SDK for Interoperable Apps -Nicolas Riquelme Guzman." Thank you to everyone who joined us for ETHBogotá 🇨🇴 and helped us kick off Devcon Week. With over 1400 attendees from 62 different countries, ETHBogotá was our biggest hackathon in Latin America ever! ------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com #ethereum #web3 #blockchain #eth

Transcript

foreign [Applause] [Music] my name is Nicola Nicolas and with my colleague Nikolai also we're going to present and explain this motive of the hackathon working for Sigma SDK you know doing stuff funny stuff with Sigma SDK the first thing that I want to ask is how many people here speak Spanish okay a lot so foreign Okay so so what is Sigma so Sigma basically it's uh cross chain interval activity protocol allowing General General message passing but also sc20 and nft transfer so with with our SDK and with our like with our infrastructure you can relay message you can transfer tokens you can transfers nfts uh cross chain between evm compatible networks right uh so the basic idea here is that you have chain a and chain B and you have Sigma in between and then of course you can transfer the most popular formats I would say rc20 LC 721 and we use This Acronym GMP and gmps because it stands for a general method General message passing uh okay is um Jamar functions um a sigma so okay so and we also with our infrastructure we have also our SDK so of course all of this is open source um and or with our SDK the the main idea is to allow developers to that usually are familiar with JavaScript or typescript to build a cross chain applications in an issue like easier way like uh without too many hassles like without without the need to set up a lot of stuff you know so um and or SDK had mainly like three methods or I would say three big General methods and those method methods are aligned with the with the type of transfer or type of message passing that we do so rc20 tokens you know nft stuff uh and of course you can use this SDK in the front end and of course in the in the in the back end so for instance if you are building some something in node.js you can use this is this SDK node.js uh we have documentation for this and of course uh you have to provide perhaps a little bit more setup but it's pretty straightforward and also you can use this SDK in the front end so you can communicate directly with our contracts and another big thing that I think we have and it's like I would say a winning in in this like I would say uh scene is that we have like a if you want to develop something that is so custom that uh that uh you need to I don't know iterate a lot over this you can use also our local setup so we have we have something called local setup is basically uh or all our infrastructure you can run it in a Docker container uh so it's like just one command and then you have uh two uh notes and then relayers so then you can play with this like play around with this you know building stuff if you need of course speed because sometimes test Nets are a little bit slow or or if you need something that is so custom that uh you that you need like uh to iterate really fast over your code uh so what's the main idea of the of the challenge to hack with us uh so many ideas to see how many developers they want to be excited and interested in in building cross chain application applications with us uh I mean the sky is the limit in this case you can you can build a I don't know uh you have a uni stop LPS it's an nft you can try to build a cross-chain uh liquidity pool uh because you can you know transfer nfts you can do you know defy typical stuff with rc20s and also with our contracts you can interact with General message passing uh so if you want to uh escape a little bit the defy space I would say and you want to do something that is not related to this uh you can do this with our with our contracts uh so yeah we have a lot of resources we have our home page we have dogs uh we also have or read Miss in of course or repos uh we have our contracts right so everything is open source so you can just you know clone the repos play with it uh of course we have also a definite environment so you can if you don't want to use our infrastructure like in your machine you can just you know uh use devnet and just connect to the contracts so in in a way it's a little bit more straightforward uh so yes and let me um General [Music] uh numbers foreign [Music] okay so we have a so we have a faucet uh UI so you can get tokens from this uh faucet and also we had a so it's it's pretty straightforward you just go to this uh this URL and you get the tokens to so in case you want to use devnet you get the tokens and then you can do whatever you want you can pay for your nft transactions or transfer sorry so yeah it's pretty like uh there is not too much hassle to to do this using like devnet and faucet UI and the main idea the main like Bounty prices for this hackathon is tier one is to build or showcase something using general message passing uh and this is the amount that we are giving for for this and also there is this tier two price in this case is utilizing uh Sigma SDK and showcase something with nfts or sc20 uh whatever your imagination can I don't know build so yeah and now I I would like to explain uh a little bit in more technical terms how can you use our stuff or SDK and our infrastructure to build custom applications so I'm going to I'm going to show sums called Snippets then I'm going to show you a demo of a nft application and then I'm going to try to run uh live demo of rc20 transfer so yeah I hope demo got a behaves well with me today so basically for you to build uh with a or SDK you need to provide addresses because of course you need to you need to know who who are the contracts that you need to connect and this is our standard configuration uh for uh to use our SDK so you define this stuff like domain ID the network ID in this case is the chain ID of of a node and then you provide the addresses when you if you run or local setup addresses are provided after everything is running so you have this and then you can plug this and use it locally so is I would say it's a seal environment so you use SDK locally and with the infrastructure locally if you want to use our devnet of course you have to go to our resources and get the addresses of our contracts and then you plug these addresses in this setup format and of course you define for instance here the rpco URL and in this case the rc20 code token the address Etc if you want to uh if you want to deposit for instance in the case of rc20 if you want to transfer some tokens from one network to another uh besides of course of course the setup uh you need to initialize connections and in this case we have two separate ways of doing this because of course this SDK works in the front end and also in the back end so if you want to do stuff or if you want to transfer tokens in the front end you just initialize connection from web3 provider in this case you are going to use a metamask provider so a metamask is going to carry out approval and all the actions behind the scenes with the account and and of course since uh in our infrastructure we have some we have a fee structure uh you need to get uh the fee in order for you to then do the deposit because uh our entry point and I think this is one of our advantages or anti-pro entry point for our application is the deposit on the bridge so you need to provide this fee and in order for you to provide this feed you just need to fetch this this fee data in the case of our local setup uh fidata is like a constant and you get this and then you can play a play with the with it um and of course in the case in the case of devnet also a fee is already provided so there is no no miscalculation you know and then of course you do the deposit and and you define this like parameters amount recipient address and free data and after that you should see if you are running for instance infrastructure in your machine you should see the logs of the message to be carry out to the other network okay so in El Cason is foreign a um so for SC 721 it's kind of the same configuration but you add this FC 720 100 address of course again another address and you know it's like there is no much change in terms of what you are calling you are always calling deposit method and you are always providing in this case recipient address basic fee uh and in this case the amount represents the token ID so in a way transferring sc20 and nfts kind of behaves the same in our SDK so this is an advantage in a way that we don't want to provide like a different apis or like a lot of methods and we want to in a way make a developer's life easier and for this we have this like straightforward way to to use our SDK in the case of generic Handler it's a little bit more I would say complex but still straightforward since uh from this week we have our contract is permissionless meaning that you just register uh the resource in this case resource is the function that you want to call in another Network and then this registration make the function available for everyone and you need to provide this sort of format for the for for the data and the most important part of this is of course metadata depositor in this case is the address who is doing the deposit and then execution data and execution data is uh are the bytes that correspond to the arguments of the function that you want to call in the other network and then again it's straightforward for instance in this case deposit function signature you can get this using web3 JS or slgis providing of course the ABI of the contract and and then just for instance in this case uh we have this like a hex red color and you just want to transfer this color to another contract another another chain so you just call this create generic deposit data and you provide this like signature uh the address or your contract in the destination chain and other parameters that are described in our documentation that like Max fee and depositor address and of course the data in this case the color that I want to transfer and then using our contract you just do again a deposit so again it's really straightforward nothing really changed provide domain ID in this case for Destination chain and deposit data and deposit data in this case is going to be bigger because you are not just transferring an asset like an nft or a C20 you're you are transferring like a function call to a to another Network there is like a questions up to this point okay if you have questions you can ask me later oh okay foreign like more because I want to show you how everything works so first I'm going to show you the video of this is our this is our nft example that we have in the SDK is like pretty Bare Bones it's super basic and simple but it's a it allows you to like check the code and then see how easier is to use our stuff so I'm just going to press play okay so what you see of course you have different application right you are doing stuff with metamask you are doing the transfer with the metamask you have of course the dev tools with the logs and this in the right corner is uh or local infrastructure so this Docker image that you just run and you have nodes and relayers working for you with contractual addresses and then you wait a little bit because of course this is not uh this this is a this is really fast but of course it doesn't happen like right away and those logs that you are seeing right now are the locks of the relayers relaying the message to the other network so we should see a result in the say transfer complete so we managed to transfer uh one nft to the other network and this example is as I say it's currently in the in the GitHub repo so you can just clone install and run it and it's pretty straightforward I'm going to try to now I'm going to write try now to run like a demo of the rc20 so I hope everything works so here I have a local setup so and I'm going to run it with the docker you can also use there is a make command to do this but since I like to tweak a little bit the docker file I always ended up to using Docker so now our infrastructure is running and and here is the example of the rc20 application also like a really bare bounce application of for transferring tokens so first we're going to run this command called mint sc20 so what I'm going to do now is going to mean some tokens 99 for me then to transfer so okay everything went smoothly now I'm going to run the server okay so demo code please okay so we have this verbal on the application and you can see that we have 99i tokens to this account and then I can try to transfer one or whatever we can put I don't know 11. because we have a lot so you get this message because you are getting first defeat as I show you in this code snippet and then if everything works great we confirm the operation and I'm going to try to put this no oh okay of course demo went to want to put it aside on yes so okay so there is a an issue I'm going to try again if not you can check the the repo so um I don't have access to this okay so let's try this I wanted to show you the logs but since this screen size is kind of weird Okay so first getting the fee and yeah so confirmation and let's wait for it so here are the logs now you are seeing the locks of the transaction being carried out from one node to another so this is the are the locks of the relayers and that's it so simple it's pretty straightforward so yeah and yeah this is this is our this is our SDK this is this is the main idea that we want you to get excited about that like build with us build what in your imagination across chain application looks like and use our open source code user SDK your infrastructure your devnet and yeah and we are going to be here so if you have I don't know questions doubt if you went to debug stuff yeah we're here to help you so yeah I think that's it thank you

Automatic transcript — names and jargon may be misspelled.