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

Loading player…

Curvegrid 🛠️ Building On MultiBaas

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join us for a MultiBaas workshop with Curvegrid! From November 17-19 2023, ETHGlobal is welcoming builders from around the globe to help shape the future of Ethereum at ETHGlobal Istanbul. $500,000 USD in prizes are up for grabs at the prestige ICC Istanbul Congress Center... you're not going to want to miss this! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] hi my name is Jeff rorth and I'm a co-founder of curv grid we're a blockchain middleware company based in Tokyo Japan our product is multi bass which is blockchain middleware that helps you build on blockchain faster easier and much more cost effectively than doing everything from scratch I'm going to show you today how to get your dap up and running on Multi bass and use it to build your blockchain vision let's dive in basically multiv bass is blockchain middleware that makes it fast easy and costeffective to build on many different evm blockchain platforms it sits between your dap and the blockchain you can use all of it or you can use some of it uh you can build a frontend uh app on top of it you can build a backend app uh or both so your typical dap stack looks something like this essentially multi bass sits above the blockchain node provider uh and provides a number of different facilities for you to interact with the blockchain okay so here we are at curv gd.com the first thing we're going to do is Click get started and that's going to take us to the curve grid console now if we have an account we can log in here or we can sign up either with an email address and password or one of the social accounts let's go ahead and log in now the curv grid console is your platform to deploy new multi bass deployments and typically you would have one or more deployments for development test and production with different permissions and different access controls so let's go ahead and create a new deployment first I'm going to give it a label and description and then I'm going to pick a network and we support a whole range of different blockchain networks here I'm going to pick the curv grid test Network which is our own uh fast cheap and cheerful private test Network shared amongst all of our customers I'm going to select uh the free type of deployment M and create once I click create uh we're going to see the uh the deployment is is uh being created here and just wait for a moment for it to be ready while we're doing that you can see that at the curve grid console level I can come in here and add additional users and manage my subscriptions and check my deployments okay here we go it's being created so I'm going to click the link here to log in and I'm going to be taken to multi bass there we are it's as easy as that so this is multi bass and this is the multi bass web UI which you used to manage the multi bass blockchain middleware let's take a quick tour around it to help Orient yourselves at the top here we've got the menu bar of course and we have onchain and uh contracts as well as our libraries smart contracts we'll talk about that uh blockchain and Cloud wallets in just a minute first let's go to admin you can see there's a place to manage your users your groups uh API Keys cores Origins and audit log let's take a look at the API Keys first because what we've done is we've created a deployment on a blockchain network that we don't yet have connected to our web3 wallet that would be the curv grid test Network and so we're going to go here first to admin API keys and I can also get to it from my users API Keys here and I'm going to click new key I'm going to select the web 3 key type and give it a label web 3 click create and there we go now I can either copy and paste this into my web3 wallet manually or simply click configure my wallet I see the popup here I click approve switch Network and there we go now I'm on the curve grid test network with my demo account let's move now to contracts we have two kinds of contract uh Pages here the first is our library of contracts that have been uploaded to multi bass ready for deployment or linking to an existing onchain contract and the second is onchain contracts so let's look at the library first when I first set up a new multiv deployment I have a number of contracts pre-loaded into the library here my ERC 1155 20 and 721 interface contracts uh multi token which is a sample full-featured uh erc20 token my nois multisig wallet and the witness contract what you can see here in my uh for example erc721 interface contract is it lists all of my different events along with their parameters and my functions here at the bottom both read and write if I toggle the call function button I can enter an address and uh the inputs to that function and call that function on the blockchain I can also view the ABI and see any onchain contracts that I already have deployed so let's go ahead and add a new contract to the library first I click the plus button and then I'm presented with a series of choices I can either upload from source code from the ABI or I can view details about how to use our multi bass hard hat plugin so let's first try from source code I click the source code button I click to upload a file and then I select my smart contract here I have the wrapped ether smart contract open it up it gets compiled in browser and then here it is ready to upload to multi bass I click continue and that's it I can see that the we contract here uh is now in multiv let's try that again with an ABI I've got two options for ABI I can either take Soul C compiler combined output which would be done with soulc uh-- Json command line or I can take it hard hat compiled artifact let's take a hard hat compiled artifact this would be found in the artifacts directory of any uh hard hat project I'm going to give it a label in this case Sprite right and a version 1.0 going to click here and I'm going to select my Json file go next and there we go Sprite right is now also uh in our library here so let's try deploying a smart contract from our library I can click the three dot menu and hit deplo and click deploy I could also link an already deployed smart contract if I know the address um but I'm actually going to show you how to do this from the onchain tab so I'm going to go to onchain the onchain page and I don't have any contracts that have been linked or deployed here I'm going to click the plus button and I'm going to say deploy a new contract from library and I'm going to select Sprite WR going to click continue I need to give it a label Sprite right and I have the option to sync events or synchronize events from the blockchain if I don't click this I'm just interacting with the smart contract itself I'm not able to view any of it of its events that have been emitted but that's we definitely want to do that so I'm going to click the sync events button I'm going to click deploy and I see that I have to select an address to sign uh this transaction with so I'm going to click connect account going to collect my demo account and click deploy I get my metamask popup and I confirm the transaction and that's it now I've got my Sprite right contract deployed on the blockchain now I've got three views of uh for a Sprite right here I have my overview view which gives me my basic details about the smart contract it's label the contract name um its address and whether event indexing is active and then the contract state which are my functions or state variables that don't take any parameters and we're we're pulling this information automatically from the from the smart contract so I've got owner symbol total Supply Etc I also have my functions view which gives me my read and write uh functions uh that do take parameters finally I have my events view you can see when the contract was deployed there were a number of functions Sor there were a number of events that were emitted within the Constructor so first the ownership was transferred uh to my address here uh and then uh roles were granted uh two different roles the admin Ro and a mtor ro uh to my uh to the address that deployed this let's go back to functions and I want talk a little bit about the multi bass signer selector and in order to do that I'm going to switch over to a different multi bass deployment that has a few more wallets in it and the signer selector here you can see uh is complimentary to my web3 wallet uh selector of different accounts in my multi bass signer selector I have my web three accounts my metamask and others and I can label these I've labeled this one main and this one demo I also have what are called Cloud wallets and these are uh software backed uh uh wallets that exist um in Microsoft jure and can be used to sign uh transactions and send them to the blockchain basically interact with the blockchain uh without the need for a web3 wallet this is great for both automation operational automation within your dap as well as provisioning wallets for your users so let's talk about Cloud wallets as I mentioned Cloud wallets exist in Microsoft Azure and are configured in multi bass if I go to the cloud wallets menu click on configuration I can see my cloud wallet provider configuration here I can add a new one entering the label client ID client secret Etc and then creating one or more Cloud wallets either importing one that's already be configured in Azure or creating one here uh through through the uh uh mic sorry through the multi bass uh web UI I can also select HSM protected key for extra security and extra cost and this is a Microsoft uh Azure key Vault option once I have a cloud wallet it shows up in my signer selector I can click this check boox here to add it and then I can use it just as I would any other web3 wallet so I've now selected the qa1 uh Cloud wallet so let's take a look at how we actually use a cloud wallet I'm going to come back to our contracts uh uh page here our onchain contracts I'm actually going to try deploying a new contract uh this one from source code and I'm going to again upload it I'm going to pick my w 9 smart contract and I'm going to click continue I'm going to click sync events going to call it we 9 tests and and I'm going to say yes use my cloud wallet for this transaction got my cloud wallet selected in the signer selector here and I'm going to going to click deploy now what did you notice it went through right away and I didn't get a metamask popup that's because the signing request went through to Azure key Vault it was signed and approved there and now my smart contract is being deployed so I can see this is my wrapped ether on my curv grid testnet of course it's not real wrapped ether it's just my own uh test deployment here I'm going to come to the functions Tab and I'm going to click right and let's try depositing some ether into it so let's try depositing 123 way into the smart contract again with the qa1 uh signer uh uh wallet selected in the signer selector here so call function and again instead of getting a metam mass popup I get my speed bump here in my multi bass uh UI I'm going to click confirm and I can see the transaction here that um uh where that that deposit was actually made and I can see the deposit that was made in there 123 uh wrapped ether I could also look at that um in my events I can see the deposit was made here and if I go up to the signer selector and I copy my address oops my qa1 address and and I come back to my functions here and if I go balance of enter my address here call the function I can see 123 and that's it's that easy I can also uh go to my cloud wals menu and my uh transaction manager I can and I can see the previous transactions that were executed now if these were still in in progress I would have the option here to cancel them or to speed them up just as I would in a web 3 wallet like metamask that's it so we've talked about web 3 wallets in the signer selector we've talked about Cloud wallets there's one more type of wallet that we have access to through multi bass and that's multisig or multi signature wallets so if I click the multisig tab at the top I get my multisig page let's try deploying a new multisig wallet so I'm going to uh click the plus sign I get new wallet I'm actually for this going to switch to one of my uh web wallets My Demo wallet here I'm going to call it multisig one and I'm going to start adding owner addresses so let's add three addresses I'm going to add main I'm going to add my demo account and I'm going to add my QA account there I'm going to say I'm going to need at least two out of three confirmations and let's click deploy wallet get my met metamask pop up I hit confirm and my multisig wallet's deployed can see the address here and the label required confirmations I make changes to any of these and I can see all of my transactions here as well so let's try putting this onchain multisig wallet to use first I'm going to copy the address here and then I'm going to go back to my contract library and what we're going to try doing is we're going to try deploying a new smart contract with the multisig wallet as the owner so I've clicked multi token and v1.0 and I'm coming up to the three dots here and I'm clicking deploy I'm going to paste the owner address uh into the owner field here I'm going to give it a label multisig token name test symbol test six decimal places then I'm going to click deploy if I don't have a wallet selected I get this popup from the signer selector I'm going to click My Demo wallet and then deploy I get my metamask popup confirm the transaction and my erc20 token has now been deployed on chain you can see that the total Supply is zero so I'm going to select my functions and write and now I'm going to Mint so I'm going to enter 123 tokens to Mint I'm going to come up to my signer selector and click My Demo account and then call function I can see that the transaction's been rejected because the owner of this smart contract is not the demo account it's actually the multisig wallet so let me come down here again to my signer selector to my multisig accounts and select main under the multisig uh wallet click call function again and we have our metam Mass popup so we're going to Mint the tokens now you can see the uh the transaction has gone through and if I take a look at the events I can see on that token I don't have any events here that's because uh what multi bass has done is actually recognized that this transaction is being signed by a multisig wallet so it's wrapping the mint function uh in a multisig uh onchain multisig wallet call and so I if I come to my multisig tab here I can see I've got the transaction pending if I pick the account that signed it I can revoke it if I pick one of the other accounts uh that's an owner account in this case my cloud wallet I can confirm it click confirm we see the speed bump click confirm again and uh the transaction uh will uh go through to my um Cloud wallet let refresh the page here we go we can see it's being executed now if I go back to my uh onchain contracts to my multisig to toen uh the overview page I can see that um in the contract State once this pops up can see that the total Supply is 123 and I can also see um in the events I can see my mint and my transfer event here with the details if I click into this transaction hash it's actually going to be interesting because I should be able to see my multisig events as well so this was actually called to the multisig wallet to confirm the transaction and then I can see both the confirmation event from the multisig Walt and then the subsequent mint and transfer events from the um ERC the multi token there's something else interesting I want to point out here which is the fact that you can see that these decimals have been shifted on Multi token so this is another feature of multi bbass called type conversions and so basically what we're doing uh what we have the ability to do is uh modify the input and and output going to and coming from uh smart contract functions as well as events so I've come back into my smart contract Library multi toen uh V1 and if I click the adjustment icon here I can see that I have my decimals type conversion set on the output of this allowance function and I can either use a decimal function which will use the the output of uh one of the functions on the smart contract in this case decimals or I can use manual input and I could adjust that to say you know 17 um but in this case we want to use the output of the the decimals function next I'm going to show you uh a function uh of multi Bas called event queries and uh this is basically a way to um to Aggregate and um retrieve onchain events right so when you're writing a smart contract um you almost always want to emit events when um you know some kind of action happens on the blockchain because what you what you would do is you would present your unsigned transaction to the user they would sign it and then sometime later that transaction would be included in a block on the blockchain and you would want you know you may want to take some action on that update a balance in your dap or display the fact that an nft has been minted and so uh monitoring uh events is very very important but it can be very challenging to do that effectively uh first because um you know the blockchain is eventually consistent um and node infrastructure is sometimes you know somewhat unreliable uh and so we've solved that problem for you in multi Bass by building a chain indexer into multi bass along with an event aggregation facility and that's called event queries so this is a predefined uh event query for Sprites um we're actually going to build a new one I'm going to show you how easy it is to report on um balances so we're we're going to call this one multisig uh multisig token balances and first we're going to add uh some events to it so I'm going to click plus here we're going to select the transfer event and we are going to add a couple of different fields so we're going to say the from address we're going to Alias that as the owner uh and then we are are going to um oops we're going to add another event field which is the uh tokens and we're going to Alas this as balance and we're going to aggregate this on um uh subtraction right so every time there's a from uh address we're going to basically subtract and you can see it start to preview the events down here they don't have much meaning yet but we'll get to that uh in uh in a second add then we're going to add another transfer event so transfer and in this case we're going to add an event field again we're going to add the two event field we're going to Alias this again as owner and add and we're going to add another one here uh tokens balance uh we're going to uh we're going to aggregate this uh as the ad aggregator so we've got we're subtracting tokens when there's a from transfer and adding tokens when there's a true trans a two transfer and we're also going to need to add a filter so when the contract address label is equal to multi Sig token I I have that right and uh add filter there we go Okay add filter to group oops sorry we go done so I've got my end filter there and we'll add another filter here so the contract add address label is equal to multisig token we go done okay there we go just checking that okay and then we're going to uh aggregate so we're going to group by the owner and we're going to order by balance let's say descending and here we go you can see I've got 123 tokens that are owned by the multisig wallet address going to hit save query and we can see it now here as well I get the preview here and I also get the query Json so you can actually um either save event queries like this or you can post to them um dynamically so another feature we're very excited about uh and that we've launched uh recently ahead of eth global IST Temple is web hooks so I've come up to blockchain clicked web Hooks and uh here we are and so this this gives you the ability to be notified uh via web hook uh when any uh kind of onchain smart contract uh or transaction event happens and so I'm going to click and create a new web hook I'm going to call it uh test web hook and I'm going to enter an endpoint URL I'm going to use this free web hook testing service and we're going to come back here paste in the W uh the endpoint URL and I'm going to say anytime a transaction is included in a block or any event is emitted from a smart contract uh that we are um uh that we have uh linked on Multi bass here we're going to add that endpoint so the web Hook's being created and uh here it is so uh there's we're basically waiting now I can click to reveal the secret of the web hook and there's there's information in our document uh documentation which shows you how to use this to validate the fact that this web Hook is being posted for multim mask is it's a public URL on the internet anybody could theoretically post to this if if they knew about it so let's go and generate uh a transaction so what we're going to do is we're go back to our onchain contracts and we're going to do we 9 test and I'm going to go to functions and we're going to go uh WR and we're going to deposit uh one way and I'm going to call the function select one of my um Cloud Walts call the function and there we go and so let's go back to our web hooks here we can see that um it's being posted uh basically immediately uh within a second of one another and if I take a look at my web hooks here here they are so I've got uh the body there and I've got uh my signature and my timestamp um and again there um you know there's documentation available uh we have documentation on our doc site about how to uh decode and and validate these so I've talked about documentation and there's a link right at the top here which takes you straight to our documentation page you can also get to it from our our homepage we have a number of uh articles uh documentation on on the left here by the time at eth Global Istanbul you're looking at this we will have refreshed this um and and updated it but the key thing I want to call out here is our interactive API reference so all of the different pieces uh whether it's multisig wallets or web hooks or uh HSM cloud wallets uh event queries it's all available through um our uh documentation site and this uh you know this shows you exactly how to use it you can try it out here with different code samples you can put your deployment uh URL in and um um yeah um work with work with the multi bass API very easily right from within the documentation addition to our API we've got uh comprehensive uh SD dks both for typescript and go uh as well as uh a truff or sorry hard hat uh plug-in and so the typical endtoend dap development workflow might look something like provision of multibus deployment and set up a uh a repo a hard hot repo introduce the multi bass plugin use that to basically upload the smart contracts uh into multiv bass and Link them on chain once they're deployed and then write code using either the rest API or sdks uh to build your dap and the whole idea here is you can build your dap much much faster uh than if you were doing everything from scratch by using all of the features available in multiv bass thanks for watching and come by our booth at eth Global looking forward to meeting you thank you [Music] yeah

Automatic transcript — names and jargon may be misspelled.