ZKV Presents... Privacy on Moonbeam XCM Workshop
15 Dec 2022 · 1:46:30
A recorded workshop from the Privacy on Moonbeam event, produced by ZKValidator, in which Alberto Viera of Moonbeam and Georgi Zlatarev of Manta Network demonstrate how Polkadot's cross-consensus messaging protocol, XCM, can carry a privacy layer between parachains. The session walks through sending XCM messages between Moonbase Alpha and Calamari to privatize a native token and an ERC-20 and execute private transfers, covering zero-knowledge-powered confidentiality on Moonbeam.
Speakers
Topics
Transcript
nice to see you hello hello cool um okay so yeah welcome to privacy and Moonbeam I'm gonna get my slides set up hello how does that look well maybe I can make this a little bit more that's perfect that's good cool cool hi welcome everyone who's arriving um yeah this was a long time coming this event we're very excited to kick it off so I think I'll start on the intro
so yeah welcome to privacy on movie it's an event hosted by the ZK validator um zika validator is a actually I'll tell you a little bit about it but uh what we do is we aim to support privacy and ZK technology over multiple blockchain networks we are currently live on 10 networks three of them in the polka dot ecosystem including very obviously Moonbeam um we're also on polka dot and kusama so we're Moonbeam cool later we're also uh validators on other networks including a number in the cosmos ecosystem like Cosmos osmosis evmos and agoric were on near Mina and cello as well and we're
currently always evaluating new networks and looking to like expand into yeah different places maybe to share a little bit about what we do with these networks is what we're usually doing is we're aiming to support privacy or serial research sometimes the networks already have it built in sometimes we want to bring it to them and so obviously what we're doing is we're running validators but we're quite strategic about who we validate with we act as advocates for privacy on these networks we participate in governance we support emerging teams and we also launch initiatives to promote and fund ZK Tech initiatives a little bit like this one and here's our amazing team that's grown quite a lot this year I mean yeah I think we've
doubled this year or something so that's pretty nice we're eight people now and we are always looking for you know great people who might be able to to are aligned with our vision and want to want to join us so keep an eye out for jobs and stuff as we post them so I want to share a little bit about General zkv initiatives so we have run in the past event series focused on ZK Tech and privacy this is in a way one of the first ones that we're doing as a real Hands-On workshop and we're doing like we had a vision for really trying to see this Tech that didn't exist kind of come to light through this particular series we also zkv also was an initiator of the ZK hack project so ZK hack just
we just wrapped up our ZK hex 3 event so ZK hack is a Learning Hub there's events there's content and it's very focused on onboarding new developers into ZK Tech education like being able to actually code specifically with your knowledge proof stuff introducing them to libraries I do want to just highlight there's a whiteboard sessions uh video If you go to zika hack.dev you can actually find the ZK whiteboard sessions we released that last summer and it's a great kind of Learning Resource the first three are from Dan Bonnet it's like great to let on board you're just into the concepts of ZK Tech and what that is yeah we also do things like the open legal report working group so this is a group of like a lot of the ZK projects
members of their teams coming together and trying to find out if there's like risks or opportunities that we could um yeah actually like build initiatives around so maybe more working groups preparing reports trying to work a little bit more with legislators um and it's still it's it's very open and if you're interested in that do get in touch with us because we are always looking for new participants we also do zikivi also does early stage funding so we do small like we do a little bit of investment into early stage projects usually either their ZK focused or we think that we could bring ZK to them similar to our Network strategy we also were involved in CK grants so we did like the git coin ZK Tech side round uh we were like one of
the co-organizers with CRX Park trying to get funding into the hands of really early stage contributors we've also supported the Z prize initiative which is looking at accelerating Hardware ZK hardware and um yeah they just finished actually they announced kind of their winners just recently and at our at our ZK hack event yesterday we actually had a small presentation from zprize it'll be on the YouTube channel too I think someone just shared that so yeah that's YouTube channel is a great place to find out about a lot of these things um yeah and then the other thing we do and this is we don't do a lot of it but we're looking to do more and that's building ZK enabling Tech um yeah
so tell us a little bit about this event yeah uh I don't see this slide change yet oh no so the goals for this event uh first of all we want to introduce ourselves to The Wider Moonbeam and Mazda Community but we also want to hear from you we want to get to know you better we want to get to know your needs and interests around the ZK um topics main goal of this event is obviously to explore the topics of polka dots cross consensus messaging protocol xcm what is really exciting and then I already said a little bit about it is that through this event series both teams actually made an extra effort to make this tool
usable for us which you're going to see through the walkthrough from a use case for privacy on Moonbeam as a demo hopefully as well we'll spark ideas for the future ZK application using xcm and we're gonna get you excited to use this tool okay so what's on the agenda for today after this introduction we're going to jump right into the two hour Workshop the transact remotely through xcm where both teams will be presenting so both Moonbeam and Manta will be presenting first we're going to start with the Moonbeam presentation then we're going to jump to Manta and as far as I know
Alberto will finish the third part after that obviously we're gonna rough up a little bit tell you about exciting things that are coming foreign treasury that supported our idea of creating this series and provided with us with a grant that made it possible we are also the one of the first companies that went through this grant process which were very very proud of kind of want to say thank you to our media partner so ZK podcast you were
asking about the video yeah it's it's Anna's initiative so you were asking about a video it's going to be you know recorded this session is going to be recorded and it's going to be uploaded to the YouTube channel on VCC podcast and things to look out for like I mentioned privacy and Moonbeam is a serious we already did our Twitter spaces I don't know if you if you've seen them if you haven't two weeks ago we had the Twitter spaces you can find it on our Twitter today we're gonna have the first online Workshop uh Hands-On which I cannot wait to see to be honest and we are also planning around April 2023 a workshop that is going to be in
person so look out for that if you want to be up to date with everything that is happening all our events um regarding the polka dot ecosystem and the ecosystem itself sign up to our newsletter yeah I think Hector already posted it in her chat so please sign up to the to the newsletter not to miss any information that we have for you and yeah thank you very much for everybody that signed up and is with us today if you want to contact us please use their email events at zkvalidator.com if you want to learn a little bit more about us please go to our websites like physiquevalidator.com follow us on Twitter ZK validator and now it's the time that we work oh
really really hoping for and we're excited to to see I want to introduce on the stage Alberta from Moonbeam and Jory from Manta guys I hope you are with us it always takes a moment sometimes so yes to for the presenters to come on stage so I hope everything is okay and we're gonna see there you go and maybe just I forgot that I had to go and click on the upright Corners like share audio and video I forgot about that so even though we rehearse it you know we always rehearse and then we forget about doing
this stuff yeah hi Jody hi uh actually just a note to the audience you've not touched the blue button because when you click that you're asking to be brought onto the stage so don't click the blue button um and just know that there's two chats for this there's an event and a sessions chat um and so you're going to be trying to keep this in the sessions chat I hope I come in okay is my internet very bad yes yes it's perfect it's okay yeah and also I wanted to add that in the chat you will see chat and Q a and make sure that you ask your questions in the QI q a section so that we can read them out loud and answer all the the
questions that you guys have you guys have so all right should I get started then all right yep I'll share my screen and so yeah like and yes said I'll be doing a lot of talking first uh so bear with me and then uh I'll do a demo as well and then uh Georgia will take over he'll do his part on Manta and then I'll do a last demo which we sort of combine everything but I'll start working on my part of things so all right perfect yes we see your screen awesome everything is okay good luck yeah thanks all right cool so yeah uh my
name is Alberto I work at developer relations at boombeam and today I'm going to be presenting it's going to be sort of like a mixed presentation between you know things about polka dot things about boombeam things that are generic about xcm and then you know Georgia will take over and explain similar things but on the Manta side but you know my part will be a little bit longer I think because I'll be talking more General things about Polk data and xcm as well so I do developer relations on Moonbeam I've I think unluckily I've been uh working with xcm for over a year I think and and I say unluckily because it's a really really complicated topic uh anishika said something that I I found really interesting is like you know that this is going to be like a
Hands-On workshop and it's gonna be super super you know it's not something that is straightforward right and so the idea is that when you guys are using this knowledge to build the applications on top of your responsibility will be to be make sure that it's easier for end users to use a tech that we'll be showing today and so today for the agenda let me click on the Q a just in case so today for the agenda I'm going to briefly go over polka dot it's going to be super short just to set the stage then going to talk about an overview of Moonbeam then we're going to start going into an xcm overview and I'm going to briefly show a tool that might be helpful in this sort of scenarios then we're going to talk about remote transaction this is going to be mixed up
with the part of xcm overview as well and last but not least we're going to do first the first demo of the two demos that I've prepared uh today the first one is going to be mostly focused on a simple xcm interaction with mumbi and Manta but it's not going to be like the main juice of things because we're going to wait for Georgie to present the month of side of things to then come back and do a little bit of a more complex demo so um polka dot in one minute and and so the idea of this slide is that you're not going to be a polka dot expert but it's sort of like set the stage so you understand uh why moving exists why Manta exists and and the whole idea behind the polka dot architecture and so the main sort of idea of polka
dot is a specialization and connectivity there is no one blockchain to rule them all right there's no one blockchain that can do everything but there are many best blockchains and so the idea is that polka dot acts sort of like a hub or it's normally called a relay chain or layer zero that it's able to connect all these specialized blockchains and secure them so the idea is that these specialized blockchains don't really have to worry about the game theory and the complicated part it's about consensus about making sure what who's telling the truth but basically they only have to worry about making sure that their blockchain does something really well and that they can just produce a Blog they don't have to make sure that this block is okay or not
these um elements are specialized blockchains are called paratenes and if you didn't know the paratine's terms comes from parallel blockchains and so like I said before they provide a specific functionality to the ecosystem maybe as a pair Chain by themselves this this blockchain doesn't do anything fruitful you know for for themselves but as if you think about it as an ecosystem it can provide a very very cool service to the ecosystem and actually I think this Workshop is a really good example of this because moving by itself is just a smart contract para chain but it doesn't have any privacy built into it right it you can think of it as like ethereum ethereum doesn't have any privacy tools that are are basically
embedded into the blockchain itself for that we use uh we can use Manta as a privacy layer for Moonbeam right and how can we do this like why does the polka dot allows all these uh sort of participants of the ecosystem to to work with each other and the main reason is it's xcm so xcm as it says on the slide is the way that these participants can communicate with each other and the key word here is that they can do so natively right so when when you can say that you know ethereum can talk with Avalanche or with Moonbeam you're talking that you have sort of like a middleware called a relayer or a bridge or a GMP protocol in which you're sort of trusting this infrastructure provider
but in the case of polka dot you're already trusting the consensus mechanism so you can more or less say that you know Axiom is embedded into that so it's a little bit safer so I probably went over a minute but I hopefully this gives you an idea of what polka dot is and that the main proposal of polka dot that is you know you have each of these Spirit chains does something very very very well very optimized but together they can provide a stronger and more optimized product for blockchain users so with that know what it's uh I think I mentioned it before it's a it's a smart contract parenting on polka dot that it's focused on ethereum compatibility compatibility so we want to be sort of the the most ethereum
compatible and frictionless environment uh to build smart contracts on top of polka dot and in order to do that you know as with any other evm compatible chain you need to have sort of like an evm as a base layer right and so you can see here at the bottom that you know the evm is sort of the core layer of all the EVN compatible chains but we provide sort of added layers of of value on top that makes us different from from any other like evm chain out there the first one is that we're built with substrate which means that it is it substrate is the SDK to build blockchains on top of polka dot and it makes us be basically connect to polka dot quite easily and benefit from the
nature of interoperability right and we can do other things like you know benefit from substrates modularity to create some sort of modules that allows us to expand certain things like for example the staking module that the pure stick team which is built in Moonbeam developed another key feature is the web3 RPC which makes any ethereum compatible tool Like metamask Remix hard hat and all these tools work out of the box uh on movie so basically this means that every every tool on ethereum that uses the ethereum Json RPC can more or less work directly on mumbim without any major modification um the other one that it's a big one is Unified accounts and this means that
substrate natively uses an account system that is very different than ethereums right you will see in today's demos that for example Manta they use a different sort of account naming system if we want to call it like that at a very high level and so this really creates a lot of friction when you want to interact with like ethereum tools and and the ethereum API because it's not really like compatible so we've modified the substrate account system to use ethereum at style accounts and so that's why on Moonbeam you can stake using your Ledger or metamask and so on and you always talk about you know ethereum style accounts and last but not least um Lumi offers an uh basically frictionless ethereum
deaf-like environment with expanded features so all the tools that you expect are available on moomim like you know chain link the graph uh ether scan that's called Moon scan at gnosis safe multi-friendly uh fork and and all these tools that you know ethereal developers sort of expect from a an ethereum compatible uh blockchain as moonview all right so I I mentioned before that that um mummy Muffler is sort of like an evm with expanded features and what does this mean right if if Alice wants to interact with with the movie VM she's gonna interact through the ethereum interface using the regular wallets that you know and and so basically but what happens is that if Alice wants to
interact with a more powerful part of moomim which is a substrate interface um she actually cannot use sort of the regular wallets as you can see here on the image but the software interface is really powerful because it's what gives end users uh access to features like staking governance and xcm which is a key feature in this demo that we have prepared for you today and so the way that uh you can do this on Moonbeam it's basically through a special things called pre-compiles in which they have a solidity interface so you can interact with them as if they're wearing smart contracts but this allows Alice for example to to access staking or governance or xcm features through the ethereum interface that's what like I
said before this allows you know Alice to sign a transaction on metamask and then do more complex things like for example send an xcm message and so yeah let's let's talk a little bit about xcm which is I think the the main topic of of today's sort of demos and and collaboration with the Manta guys so this part is is gonna be General generic so it's not going to be mummy focused even though you know you might see some mummy logos around but the idea here is sort of to provide a general knowledge on xcm and how it works so xcms is like the native intra-communication layer of polka dot so Axiom by itself is just like a message with a given format right uh at
a high level the way that I like to explain it is like an email right an email we all know that you have like a given format that it's like it's embedded into what when you in your mind when you write an email you have the introduction you have the immune body you have the part where you say goodbye so xcm is similar to that what that is a message with a set of given instructions and a combination of these instructions it's what results in a specific action right I let's say you have you know 20 instructions to select from like extending up from the chair turning right walk 10 steps and then flick the switch right if I do these four instructions in that specific order the action or the result will be that the lights will turn off but if I do like
you know walk 10 steps to the right uh and stand up and it's something completely different is going to happen right the other important element is that xcm VM which is um the basically the virtual machine that that interprets sort of the this instructions and executes them so in this case it would be like my brain right that here's the instructions understands them and then just starts you know doing an action and these xcm messages basically move around uh through communication channels right and they're unidirectional there's no like if you set up a Channel with another chain it's not a two-way Road it's a one-way Road only and and this is what allows message to move uh in that
given direction right and these channels have names and if you send a message from to the polka dot relay chain it's called a upward message passing so ump the other way around is stand downward so the DMP and then between pair of chains is called xcmp but the current implementation is called hrmp which is basically it actually is routed through the relay chain and so on so let's let's give a practical practical example so you understand you know how xcm works and we'll we'll start high level and then we'll dive down into the instructions involved in each part of the of the of the steps so let's say Alice on polka dot she wants to transfer some dots um to
another account called Alice on movie so Alice and aleph could be you know separate people they don't have to be the same but the way that this works is that what happens is there's one instruction on that it's going to get executed on polka dot and then four instructions more or less that are going to get executed on movie and I say more or less because there might be some slight variations in these instructions but the end result might be exactly the same and so the what's going to happen is that Alice through an xcm instruction she's going to transfer some dots to a special account called a sovereign account and it has to be through a special Axiom instruction because if she does a regular balance transfer it's
just going to be a really really nice donation to The Sovereign account The Sovereign account is a special type of account that it's keyless so like nobody knows a private key and it's controlled by the an entire chain itself right it's you can think of it as like a a an account that can be controlled only through the Democracy for example right so or only through a specific interactions that are are considered secured and so basically this moving software account is in charge on polka dot to to hold these dots and then there's another xcm message with that instruction there's an axiom message that is sent to Moonbeam that when it gets executed the end result is that you're going to Mint a representation of
the dots in this case we call it XC Dot and these are going to be sent to alith which is the target account that Alice decided to transfer the tokens to so remember four instructions on moving one instruction on on polka dot and The Sovereign account is a special account that it's it's holding these dots uh in the meantime so that when you send it back you're gonna actually transfer them out of the Sovereign account to the destination account that you want so let's go into a little bit more detail as I said before when when you um Alice transfers the dots through to the moving server and account she actually it's using this instruction this Axiom instruction and you can find in this URL sort of the mode more like you know details on when it gets
executed on the code but basically this instruction what it does is it's going to take funds from Alice's Alice account and it's going to deposit them to the moving software account in this particular example this instruction also is going to send an xcm message to the destination and that to the destination blockchain and that message is going to start with two more um instructions for security reasons and I'll explain uh why is the security there's a security concern here in just a minute so remember that um basically this is this instruction is the one that does attract the asset transfer On the Origin chain but also sends an xcm message to the destination chain which is the same as the Sovereign account
owner basically so basically the the transfer surf asset instruction uh code snippet it's shown here on this slide you know it looks really complicated but I want you to focus on this part you can see that this line of code right here the one on the top is the one that actually transferred the assets to a destination account and the second part here at the bottom is where the actual Axiom message is built and then it gets sent as you can see here the bottom line to a destination at blockchain which is here in the destination and you can see that that message starts with the reserve asset deposit and clear origin instructions so in the case of mumbi when when the message it's it's received by Moonbeam and this is a a an async operation right
so the message gets executed on polka dot and basically just polka dot hopes for the best on movie there's no way to say hey only execute this is this is going to be successful on moving to just execute it execute it on polkadot and just send it and just hope for the best that it's going to get executed correctly on movie so the first instruction is called Reserve asset deposited and this is the instruction that is going to Mint the exit dots but it's not going to transfer it to alif just yet it's going to actually put the the tokens in a in a special State called holding and the analogy that I like to give here is that it's like you're putting the money on the table like you have it there on the table in front of you uh it is there for
people to use it and the only um account that can mend these assets is the The Sovereign account of polka dot on mumbi all right and that is basically the the origin of the Axiom message when it's received by mumbim the the message if if I send a message from Moonbeam to Manta the origin or the the account that is going to dispatch is going to be used to dispatch the xcm the first thing that's going to happen is that it's going to be the moomim Sovereign account right if this is the message that gets received and so after we mend the XC dots then Essex the next instruction has to be clear origin so that this dispatcher account can no longer be used to dispatch stuff all
right so that's why it says removes origin register information so you cannot use this account no longer because it could be dangerous and it could create a security uh concern and I think there was a problem like this uh on kusama in the early ages of xcm the next instruction is by execution and this is basically you're just saying Hey I want to do some work on Moonbeam right so I need to pay for it and you're going to actually pay for it with the money that it's on the table the money that it's on holding so let's say the person that it's gonna you know do this work has to you know say hey I'm going to take this part and then you know reserve it so I can pay for blog space on Moonbeam and the last instruction is the
one the final finally you know we're gonna grab all these tokens that are on the on the table and then give it to alif which if you actually follow this example along if she sent uh one dot from polka dot she's not going to receive one dot on mumbi because she had to pay for execution so it's gonna be a little bit less so let's follow a similar example with the remote Trend stock I think but by now you know token transfers are a little bit boring and so I think this is where the actual juice of of Axiom it's you know it's going to be because um it's where you know we're gonna be able to talk with Manta and do some privacy stuff on Manta like the example that we have for you today
and so the remote tracks hack example is basically let's say once again Alice she wants to do some special operation on on on Moonbeam right she could be doing a simple balance transfer on Moonbeam or a staking operation on Moonbeam or even you know calling a smart contract on mobile so the way that this works once again is through a special uh a special combination of xcm instructions so he's going to send an xcm message with something called transact and some some bytes okay and these bytes might not mean anything on Moonbeam oh sorry on polka dot or on Manta but on Moonbeam it's an instruction saying hey go to this module go to this function and call this function with these parameters all
right to polka dot once again these bytes don't mean anything polka dot probably don't don't cannot understand what the bytes are for but when the message is received by on Moonbeam and it gets executed on Moonbeam this bias actually means something and it means what the person wanted to do from polka dot basically the way that this works currently is that Alice on polkadot actually owns an account on Moonbeam but she doesn't know the private key of this account on mumbi she only can control this account by using a specific combination of Axiom instructions the cool thing about this is that you can do a lot of like remote transacts or like remote stuff on
another chain without having not even having to to own an account on that chain or having a private key on that chain right you can do stuff like for example yesterday I was doing a demo when Alice on polka dot she did she did some glimmer staking on without even to have a signing at having to sign a metamask transaction and so that this account is calculated through a special like mechanism that I'll explain a little bit later but it's it's called we call it the multi-location derivative account and it's actually going to be used in the in the in the demos that we have for you today the instructions related to the remote transact uh and the origin chain you might have some instructions for you know fee payment or whatever but this is
not really mandatory and then the destination chain in this case Moonbeam uh you might have the sent origin which is this this this instruction is what actually creates the multi-location derivative account and it has to be included uh in some scenario so we don't actually accept a message that doesn't have the Descent origin instruction well actually just depends on the case then you have the withdrawal asset instruction which is going to remove assets from an account upon them put them once again into holding into this special state that it's putting money on the table note that this instruction is different than the one from the transfer example because in this case the assets are already in the account that we're like withdrawing them from right and
this account is related to The Descent origin so in this case if we go back here it's like you know taking money taking glimmer out of the a multi-location derivative account from Alice and putting them on the table to use them for something else the next instruction is to just pay for execution time on Moonbeam and the last instruction which is the most important one is the transact instruction which is you provide some bytes that are going to be basically you know understood in this case by moomim and it's going to result in an action happening actually on boombeam like you know like I said before a balance transfer a staking or something else all right I don't think there's any other question there's no questions so
I'll just continue and so just to give a more high level example of what can what can you do with with uh with these sort of like transact stuff you know and we're gonna show one today with like uh Manta but but one really cool one that is right now in production it's it's stick it's the liquid staking with lighter right so a user basically signs a transaction on Moonbeam you know using metamask Ledger truss or whatever wallet they they're normally use and this this transaction is going to basically interact with some Lido smart contracts and they're going to mince like stdot which is the state version of dot that exists on Moonbeam but more interestingly what's going to happen is that the Lido contracts are
going to use the Axiom pre-compile so it's a it's a pre-compiled to sort of like send xcm messages with a transact instruction on on another chain to another chain in which basically we're saying um hey polka dot I want to stake these tokens to these validators right and so basically if you think about what this means uh I use your mum beam you know signing with metamask it's taking tokens on polka dot that it's an entirely different blockchain with an entirely different account system and and it's just basically just signing a transaction and that's it this the system is a lot more complex at what I'm showing here on the on the image but it's just to give you a high level idea
of how this works and this is pretty incredible right because two completely I mean not completely separated uh blockchains because they're they have this sort of like relation that is but you know they're talking with each other and they negatively and basically you can stake on another blockchain without having to show like have a private key on there so this is pretty pretty cool all right so let's go through uh I've sort of like a it's sort of like another example of remote transact but this is another really cool one which is you know entering the moomim evm through xcm and so the idea here is that you're
still going to use the same transact instruction but instead of saying hey I wanna Target uh the staking module you're going to Target a special uh module called the ethereum xcm palette in which allows you to enter the evm through an xcm message you can actually do this from a multi-location derivative account which I already explained briefly or you can actually also do it through a proxy execution but this is a little bit out of the scope of this presentation so I won't actually uh Define this here as always if you have any questions or any comments you know you can always find uh links throughout the presentation to our doc site which has a lot of details on these sort of topics and so on
but you know let's talk about what is a regular path uh for a regular sorry the happy path for a regular or remote evm call through xcm so if you want to call the moving evm what's going to happen is that you as a user are going to you know sign your transaction using the typical wallets that I've mentioned before and basically you're submitting a sign track section using ecdsa cryptography for signing let's say it like that and so what happens is that uh the frontier RPC extension which is a module that we use in Moonbeam it's going to basically communicate with the palette ethereum to validate a transaction and then send the validated transaction through the pallity VM which is another
module to the rust dbm right so there's a lot of like middle steps between the user and the rust evm which is going to execute the the call and you're going to see some logs in the block Explorer and so on however when you are doing this through xcm the story it's it's a lot different because a user is signing a message an xcm message using a completely different um uh it could be using a completely different cryptography right in this case a typical one on polka dot it's sr255.9 and so basically this is gonna send an xcm message to move beam but when moomim receives this xcm message
there is no track of the signature basically we can just receive a message saying hey this message was sent by Alice in Manta let's say right but what we do basically is that we calculate the multi-location derivative account without a specific thing called you know Alice in Manta and then we execute this through a special palette called the palette ethereum xcm and then basically send the validated transaction to the rust DVM because this uh message doesn't have any signatures the validation is done a little bit different than through the regular ethereum uh palette ethereum validation because in the left hand side
you do have a signature so there's there's one key difference there and so the main differences between remote evm calls and regular IBM calls can be sort of summarized in three things first uh if you're you know more familiar with the ethereum sort of tech um you know that the evm transaction hash is actually uh calculated uh with the signed ethereum transaction right so if there's no signature you can actually have two remote evm calls have the same transaction hash to prevent this we actually use a global nons instead of a non-spur account so there's you know if Alice sends the first ever remote ebm culture have non-zero then if Georgie
sends the second one you'll have notes one and so on because there is no signature you cannot use Easy recover right so I mean you cannot uh you know recover the sender um from the signature however in in if you're in a smart contracts application the message dot sender still exists and it's rather the same one that it's on regular ebm calls and it's actually also included on the ethereum transaction receipt and so on and another really weird thing is that the gas price for these remote ebm calls is zero and this is because we're charging uh this call on an xcm level and not at an evm level right so when you get to the evm you already pay for
your execution so the evm is not going to charge you anything so on the right hand side I provided an example of what if you actually get the transaction by hash of a remote evm call and this is actually what you get you basically get uh you know a transaction that has no signature as you can see here the vrs values are basically nothing nothing meaningful you have a gas price of zero right and you have also unknowns that it's not actually represented of the account your accounts nons but the global nodes from the palette itself and so this is not basically representative of how many uh remote ebm calls have this account has this account done so what I am presenting this is even
though it's a little bit out of scope but I'm presenting this because you know you might find some use cases that you are in Manta and you want to sort of tap into the momentum CVM to do something cool right so I think this is a something that you can do as of today in our test net in moon base Alpha and so that's why I wanted to present it just in case it's helpful for the hackathon hopefully it is before we start like there's a lot of content to cover so before we start going into more details I think one thing that we have to talk about is multi-locations because that is something that is very unique about the polkadot ecosystem and in the demos we're going to be showing them at least I'm going to be showing them I'm not sure if if Georgie is going to be
showing them but you know we'll we'll be using this and if you're gonna do an application between Lumi men and Manta at some point you're going to use multiplications I can bet money on this so think about what polka dot is Right polka dot it's an ecosystem of accounts on different blockchains of tokens on different blockchains of multiple blockchains out there right and so multiplications is a way to sort of represent all these things with one uh well-defined structure or well-defined way the way that I like to see them is basically as folder paths right so you can think of as polka dot as a root folder or the parent folder of
everything and then you have each pair chain as a subfolder inside of this main folder and then you have all these accounts tokens and everything in there just just line in those folders all right and basically if you think about you know the terminal line if you're in in a folder and want to get to another one use use a specific Command right and so basically the the way that multiplications are used is that you can represent anything like I said before chains tokens accounts and they're expressed in relative terms to An Origin so if I'm in Manta you know I am going to Target boombeam using a specific multiplication but if I'm in polka dot I'm going to Target Manta using a separate uh multi-location and they have two main things a parent and an interior
the parent can be seen as how many hops to an upper level or an upper folder you're doing all right and the interior is basically the content in that level and you can use actually no fields to Define it you can use one field two Fields three Fields Etc all right so let's do some examples so you get more familiar let's say we're in polka dot and if you wanna you know you're in polka dot and you want to Target polka dot you actually would say that your multi-location its parents zero interior here right if you want to Target Bob which is an account on polka dot you just have to say hey I am already in polka dot so parents is zero and the interior is like I'm already in polka dot I just need one
field which can you have like predefined fields and one of them is account id32 which is basically polka dot uh Bob's address if you want to Target let's say you know I have the color logo but let's say Manta uh from polka dot you have to say hey I am not going one level up I'm actually going one level down so I just keep parents at zero and then the interior would be just a parenting ID of manta which in in this case in our test net it says 2084. if I want to Target Alice which is an account on Manta I am not doing any level of hops to an upper level so I'll keep this parents at zero but I need now two fields to Define Alice on Manta which it would be
mountasper chain ID and then the account ID of manta itself or of the of the account in Manta itself so please keep these things in mind because in the demo we're going to see this stuff and hopefully this is helpful to understand it if we go to moomium it's very very similar right so the para chain will be using the parity ID and the account would be the main difference here is that because we use a different account scheme it would be using account ID 20 which is the ethereum style accounts because these are 20 bytes and uh Manta polka dot uses 32 bytes accounts if I have let's say you know a token let's call it Albert token uh on Moonbeam you can actually let polka dot know that they still can exist by just
saying hey the parents is zero but then I made three fields in the case of moon mean we use three fields to Define tokens one of them is the first one is a peritone ID then the the palette instance which is like the module that is hosting this token and then the general index of the asset which it could be zero one two three whatever the uh the asset ID is when I registered it so if we are in mumbim and we want to Target you know other things it's very similar so inside boombeam the main difference now is that we don't need to specify the parent chain ID because you know we are already in that folder if we want to Target Bob or polkadot it is the same as before but we only need to put parents one because we're going we're
going one level up right if we want to Target akala or Manta we just have to put the same as before but in this case only parents one because we have to go up one folder and then down to the pair chain ID and then Alice it's more or less the same as before but we just have to put parents one because we have to go once again what up one folder Manta or akala and then the account ID itself so hopefully this gives you sort of like a better understanding of what multi-locations are and how you can use them uh for building when building an xcm message all right and I think this is the last part that I have before the first demo so this is a little bit of a a tool that that is part of a repo that it may be
helpful to sort of understand what's happening when you're doing an interaction and I'm actually going to use it on the on the demo I'm actually not going to use it just show you the result because it's a lot easier and so basically this is a way that you can use uh to decode xcm messages right so when you send an xcm message from Moonbeam to Mamta what Manta receives is a lot of a bunch of bytes and so humans I mean normally cannot read bytes right I mean bytes are not something that it's really easy to read and so basically this tool allows you to transform these Bisons to the instructions which are human readable and so you can start sort of understanding what's happening and help you debug certain things right so you
can actually the the decode xia messages that go between two para chains in this case for example we have one between uh Moonbeam that moomim received from akala uh we can decode messages that are you know from a pair a chain to the relay chain in this case this is a middle example here a message that received kusama and it was sent from Moon River and we can decode messages that are uh from the relay chain to another para chain which is downward message passing messages right and then you have here A bunch of inputs that you can provide if if you want to read more about it you can read the click here on the URLs where you have you know examples on how to use it and so on and you can also have examples here uh if you clone the
repo and run it yourself so um why like I said before why do we need to um decode xia messages right and this is a practical example of of why if you go this is a this is a movie right on polka dot JS apps and if you go to a Blog that mummy received a uh xcm message and you find it on the sort of on the blog you will see that these are just bytes right and and when you have problems with xcm this is not really helpful because you got to understand what's going on and so you know this is like I said it's not helpful right so if you actually go back and run this you know let's say we gotta in here we got a message from akala and the
message was you know and block 1649282 you will actually run this exact code snippet here and basically this will print out all the instructions and then you will have you you will be able to understand at least what's happening and if there was an issue you know to debug it so it's actually a pretty useful tool for you to you know sort of play around with xcm all right I think we got through the main part of the presentation so let's do the demo let's do our first xcm demo and so you will be able to see uh you know first of all I want to extend a huge thank you to the Manta team because um when we actually met like a couple months ago a lot of this stuff we're like no not working and so you know there was some huge uh engineering
effort on making sure that they onboarded uh a pair of chain into our test net ecosystem uh we did a lot of tests a lot of back and forth a lot of meetings and this is just to show you a little bit of the result of all this so what we're going to do is that we're gonna um we're gonna do a balance transfer it's a normal balance transfer nothing fancy all right but we're going to do it via xcm we're just going to complicate things because we like to complicate things and so we're going to do a balance transfer but instead of going to mat to in this case calamari or or the Manta deployment on our test net um we're gonna do it from Moon Bay South all right so this is the things that we sort of like need and what's what's going to be
helpful to sort of like look into it we need first an account on mobile software funded with our token Dev so we can send them to transactions we need to calculate the multi-location derivative account and this is done really really easily with a script that it's it's linked here in the URL um it is not really like it's not straightforward but it's not super super hard and then when you calculate it you need to fund it with with calamari tokens color my test net tokens right so don't think that these are real calamari tokens in this case for this example I'm actually gonna this is the multi-location derivative account that I calculated so if you want to follow this along you need to calculate this yourself and then ask us to send us send
you some tokens so you can try it out remember when I said that when we're doing remote transax you need to have up some bytes that are not really understood by Moonbeam but are actually you know pretty clear instructions on calamari so this is Step number three we need to go to calamari and build sort of the encoded call right or the bytes that are gonna actually when they're gonna be executed they're gonna do the balance transfer and then we also need to go to Moonbeam and then build our own xcm message and then basically just get the call data there so that we can just replicate this I left some you know important uh URLs and some tools that we're going to use to sort of like you know look at all
this stuff that is happening and then in here you have also the xcm tools repo to decode the xcm message all right all right let's get to it uh let me see cool so the first thing that we're going to do and I'm going to show you this so you can get a sort of like a you know a sneak peek before we actually do it that we're gonna head to calamari on on moon base you can see here and we're going to build sort of the trans transaction it's like we're going to do a little bit of cheating and build it but then we're just gonna copy this down here and what this is is basically the encoded call data or like I said before the bytes that represent on on calamari a balance transfer to this particular account and of this value right here of
one kma token right then uh you can actually get this encoded call data as well using uh the polka.js API so I have left sort of like a code snippet here that this is how you would do it you know you have to instantiate the provider provide the destination the amount create the API provider and then do the API transaction balance transfer with the destination and amount and then just get the encoded call data using this here so this is very very similar then here just in a nice typescript JavaScript uh you know code the next thing and this image might be a little bit too small but that's that's fine is that we're gonna go to Moonbase
Alpha and we're going to build our xcm message but instead of building it sort of manually right I mean it's it's like you know you're not going to grab I want to do this instruction I want to do this instruction you're going to use actually a palette and a palette it's like a module that it it's going to help you build an xcm message without you having you know to build the xcm message you know piece by piece so you're going to use this transact through sign method and you need to provide this information and I'm going to go through this uh in the demo basically when you build this out this is the bytes that represent this on moon base Alpha in case you want to check it out later and I think that's it so this is the way that you would actually get that encoded
call data um using a JavaScript typescript uh script uh but it's similar as before you just need to instantiate sort of the provider and then put some stuff down like the destination this is a multi-location as you can see here we have a parents and an interior we have a fee and I'm going to explain this a little bit uh you know later on when I actually do the demo all right so I think I have it here so let me go out and let me all right so we have and I'm gonna zoom in don't worries all right because I know that it might be hard to see hopefully this huge Zoom that I put it's enough for you to see this cool all right so what I have here is this is calamari right this is calamari on on
moon base Alpha it's a testnet and I have my account uh it has two kma tokens hopefully you can see this well uh let me hop in the chat just in case cool yeah Frank there's a link to the slides I'll provide it uh and at the end of the presentation so actually you're not you know distracted by the slides because I know they're great I'm just kidding but uh yeah but uh but I'll provide it when I finish a presentation so you can take a look at it after so we have uh this account on on you know with 2kma and this is going to be the destination account that for our balance transfer I also have here the multi-location derivative account uh I have plenty of funds here but remember that this account I don't know the
private keys of this account but I I can control it via xcm which is a pretty cool thing and so I could just go ahead and do for example here uh you know a balance transfer I'm going to select the balance module I'm going to select the transfer I'm going to put here that I want to transfer it to the demo account and then put some value in here and you can see that the bytes are changing every time I put something different because this represents this here that you can see but basically in in code in bytes okay so that is what I had here before that I had here pre-prepared uh it's just these bytes that represent the balanced transfer as you can see all right but there's not not much in here
this is this is not the interesting part this is actually the boring part the only thing that you have to remember is that I have this account with 2kmn kma tokens and by the end of this demo it should have three hopefully if everything works out we're doing a live demo and so live demos might might not work but usually they work hopefully so the second part is that we have to go through mummy right so in mumbi might have you know an account called xcm test eth and so this account I have to use the right account because remember that the multi-location derivative account depends on this one right here so if I were to use my other account Alberto this example would not work because the
multi-location derivative account will be different and if it's different I don't I don't know if it has funds and if it doesn't have funds then it will just fail all right and so what I'm gonna do is I'm gonna cheat a little bit because I feel that for this is the the sake of time uh we should probably you know move a little bit faster and so I'm gonna just grab this this bytes that represent the call that I want to do I'm going to put them here so I can explain it to you in a sort of more simple way all right so this this is the same that I would have just like done this manually step by step so the xcm transactor palette is like a module it's like a helper to help you build an xcm uh a set of sem
instructions that are going to do a transact on a remote chain and we're using the transactor sign method because this is the one that actually does everything through the multi-location derivative account the first thing that we're providing is a destination this is a destination chain and this is done through a multi-location so if you think about you know we are our feet are a Moonbeam and we want to Target Manta and I know because Alberto just said so that Manta has a peritone ID of 2084 and so basically what I have to do is do parents one because we have to go one hop up in the in the uh sorry in the uh diagram that I showed you I
have to go one Hub up and then for the interior I only need one field which is using the para chain field of 2084. all right if you wanna you know if you're curious about the uh how do you know that the pair chain ID was 2084 you actually can do this in this case in calamari you actually go to pair chain info and there's a method called parenting ID and you can actually query this right I went to developer chain State and you can actually find it here all right so our destination was already set and you can see that I set it as a multi-location the next part is a fee payment and this is interesting because we need to have first of all right our
dispatcher account on Manta needs to have tokens to pay for the execution and in this case the only thing that we're doing here is that we're telling Manta or calamari which tokens do you have to take out of the multi-location director account to pay for this execution right so this in mumbim terms this right here in moomium terms means the calamari token on calamari right there's like a mapping basically between these two so basically this is basically saying hey you can actually do this as well as a multi-location where you specify the token as a multi-location I don't really remember how they how the Manta team uh basically sees their own token as a
multi-location but from a moving perspective the easiest way to do this is as a currency ID and so the currency ID is basically the asset ID in this case it's not the the reserve token of movement it's not glimmer it's not mover it's not Dev tokens it's actually a foreign reserve and in this case the asset ID you can find it in this section Network assets and then in here you will see a bunch of assets but you have to find the calamari token and so you can see that it's two one three three five seven one six nine blah blah blah and this is exactly what I have here two one three three five seven one six nine all right so this is
when the palette builds the xcm message it's going to say remember what when we had the withdrawal asset what we're saying is that I want to withdraw kma tokens to pay for the execution if if this would be permitted I could actually let me copy this I could actually pass this but you know calamari would have to be configured to accept glimmer mover or in this case Dev tokens to pay for execution all right cool we're getting to it uh so this is uh I think that the hardest part is already behind us this is the call and this is pretty straightforward these are the bytes that we want to execute on Manta and so this if you take a wild guess this is basically the balance
transfer that we created before right these are these bytes that represent the balance transfer but in this case we're just spacing them here remember that these bytes have no meaning uh on Moonbeam right but they do have a meaning on calamari and then we have two elements regarding the weight so the weight um if you're in a hearing developer the easiest way the easiest but incorrect way to think about weight is that it's related as gas limit right it's not that so don't take my word on it but it's sort of the easiest way to start understanding weight but weight is basically time of execution that this is going to take okay so basically what I'm
saying here is that for the transact for these bytes I am giving 2 billion weight units to be executed all right so 2 billion weight units one weight unit it's one picosecond so two billion weight units it's like two microseconds or something I'm not really good at these quick maths but you know we're saying hey Manta the maximum amount of time that I want you to take to execute this it's two billion weight units all right and this is American billions if it's more just please don't do it right if it's less then everything is fine um and this is related to the amount of
tokens that we're going to actually take out so that's why you need to provide the it's sort of like that's why I mean that it's sort of like gas limit because this is like the maximum amount of of money we're willing to put to execute and this right here it's it's similar to this one but this is for the overall xtm message right so this number it's only for this action here but this number is also considering that you need to provide some weight for the execution of the all the instructions that I've mentioned before right so this number has to be larger than this one because this includes the Axiom message plus the weight for the transact so hopefully this is more or less clear what I'm saying here is that for the four Axiom instructions I'm providing
one billion weight units which is more than enough actually all right I did a lot of talking so once I built my xcm message and notice that I'm not building the instructions I'm just putting some inputs and this is going to be done for me you can actually copy this just so you can have it as a reminder if you want to repeat this in the future but we can actually now go ahead and submit our transaction I'm going to put my password and if the gods of live demos are nice with me uh nice to me so this is gonna be we're gonna check that an event was emitted on Moonbeam on the moon side
there was a block still not produced there you go oh wait no there was no xcm message what happened did it work I didn't see it oh yeah I didn't see the event on Moonbeam so I don't know there might be an issue with the events let me go into this Vlog just to see but not this one hmm I have no clue where the message went but I think it oh no it did not work this message is actually an old message let me see what happened here I have the correct let me send that send it again yes
usually the error shows up here so I just want to know what happened on the momentum side oh there you go this one worked I have no clue what happened before but there you go you can see here that there was a message and actually a message send um right here right this was sent by me and this is saying hey you know you've sent a message with this instructions to this destination with these bytes and hopefully if we go to calamari we have a
message being executed which I don't really see so we didn't see ah interesting and that might be an issue here with Explorer let me see if I see it manually oh there we go yeah there's an issue with polka.js apps at this time so you can see here that you know a couple blocks ago Manta received an axiom message and you can see that this message there's this hash 780c and in here we have the 780c message and you can see that the message
basically says that there was a balance transfer between this account which is the multi-location derivative account that I had to the demo account which is a Talisman account for one kmm token right and this this event right here is basically that I I basically put too much money to pay for the execution and because I didn't include sort of like a special xcm instruction there are some minor kmn token kma tokens basically are locked are are lost let's say uh but this is a test net so that's not really nothing to worry about cool so to show you the proof that everything worked I have here now for kma tokens right so I mean I I increased my balance I think by two so actually both of the demos might have actually
worked so yeah all right before I give it to Jordan I want to show you one last thing uh I'm not going to bring this uh on like actually I can bring it on to the screen that's fine let me find the uh want to find the block where I had the uh xcm message so give me one second what I'm gonna do is that for this particular xcm message I'm going to actually grab the instructions and I can't remember which block was okay it was this one so I'm actually gonna decode the Axiom message uh so you can see the instructions right so let me do this and I'll do a really really big Zoom so you see basically what I'm doing
here I'm using the actium tools repo that I showed you before to actually the code the xcm message so you can see what's going on with all these instructions and so on let me move this so I can give you more space there you go all right cool so you can see that the hash matches the message it was a 780c this message that was received by Mamta had these four instructions the send origin withdrawal asset by execution and transact and basically you can see here that The Descent origin it's using this account which is the moon base Alpha account that I used the withdrawal asset is basically saying hey you're going to withdraw assets located at this
multi-location which is basically the kma kma assets and you're going to withdraw this amount basically that three whatever this is three million KML tokens but the the decimal ones then you're going to buy some execution and you're going to buy basically uh 3 billion weight units or this amount that you're withdrawing right so either one of these two whatever is it's it's it's it buys you the lease execution it's going to be the one that's gonna limit you out and last but not least we have the Transat instruction which basically says hey can you execute these bunch of bytes and using this much weight basically all right so this is to show you that you know this is the Axiom message that was crafted on the moving side you didn't have to do this manually
because the palette does this for you right and it does it in a way that it's it's a little bit more secure because you don't have to worry about all this you know things and little details all over the place so yeah I talked for I think one hour already so that was that was a long a long time uh before I showed you the last slide because I'm gonna be coming back to the last part of the demo uh I'll give it to Georgie which is gonna present the part of manta so thanks a lot for for all this and I'll be right back so George if you want to take the stage all right thanks thanks man yeah let me stop sharing and yeah I'll see you in a bit
okay let's see let me um I want to share a screen right yes yeah okay guys hello um I have a short uh like two three slides just uh hoping to get you acquainted in general what uh our project does as it relates to privacy as well oh it's privacy focused and then give you like a small demo on basic like the general idea of how to use our software to integrate it well just use it but also to integrate it into your applications
and to utilize also xcm to send over uh data into to the private transactions so uh yeah as uh Virgo mentioned my um George and uh I'm actually uh an engineer doing uh mainly like backhands of the blockchain systems uh uh for Manta and I've been I've been with a project I think for a year and a half already a little bit more uh yeah and uh right our main mission I guess is uh as it relates to the polka dot ecosystem is to uh to to bring on-chain privacy uh we've already deployed the our Canary
network uh which is on kusama called calamari Network and uh soon hopefully we'll be also deploying our pocketbook based uh chain and uh this will obviously this allows us to privatize both those assets the dot in case and assets and once they're bridged over via XM furthermore we are also able to privatize all other power chain native tokens like home beam uh you know the follow or all of the uh all the other chains that exist uh are uh basically our private leader
supports uh multiple assets it's kind of like well it uses your knowledge proofs to to privatize like the data relates to uh the information of the user and the information of the asset and the amount of the assets and uh I guess it's kind of like Z cash but again it supports multiple multiple us it's not just the the armor calamari or Manta native token uh yeah and also we can support not just the native tokens of other power trains but any kind of like I guess I'm not sure if there would have asked is a good way to describe them but the exit 20 tokens which are creator of Moonbeam we can we
can we can support even privatizing those uh soon we'll be actually making the the assets that we can support permissionless So anyone will be able to create an asset and privatize it uh not just existing and not just an existing one and um yeah soon after that we'll also have a known uh support for non-fungible tokens which can have you know different applications than that's the general functional tokens uh transfers that we would be privatize uh right so this slide is a kind of aims to show the general
architecture of the whole system how privatizing other power chain assets can what would work as you guys can see there's this so let's say this is Moonbeam uh we have the jellamara asset here through the xcmp uh transportation system between purchase we can transfer bridge over the asset to the amount of public Ledger which is the general uh substitute functionality and at that point we can also create a a private version of this public asset which will exist in the private lender of our our system called Manta pay this is just a
pilot that we've implemented that runs in our uh on in our runtime and that's uh that's where the yeah the zero node rules are verified and the transactions can be obfuscated like I said the identities uh assets that asset type and the asset value and you can transfer them around it's a utxo ledger so it's kind of like Bitcoin in that sense but uh there's no link between the inputs and the outputs and the values and yes um right so I'm gonna see if I whatever so I guess
this is my last slide in terms of just a general architecture um yeah what else yeah um there's a this slide you guys can uh if you guys want to like learn like have a deeper dive into all of all of our everything that we are about uh there's like a Discord which is pretty active a telegram group obviously the website and uh and you guys can tweet at us um right so the other thing I wanted to do uh is to show you how you can basically so let's say you're in your app exists on um or let's say your app exists on the map
if you want to work directly with Montana um uh Albert will show you guys how you can even integrate from another chain and then send messages to XM so to to basically work with our system which is the the main thing is creating these zero knowledge proofs that can be verified on train right with the that include all the transaction details um for for this there's a one piece of software which is really our wallet our private wallet um it's called month assigner it manages so it creates this UK piece it does the cryptography work and also manages the private keys that are related to all of your uh ZK addresses but that's what we
call the the private addresses in our in our layer so just like any any other uh signature scheme you need to have these keys that spend right um and that's managed by the signer so for now we're assuming that this piece of software is kind of running in the background for the user right the user has already installed it and already created it and I'll show you exactly how how that works so you guys can uh for the Builders out there you guys can set it up and you can test it the other second part is our SDK which will which will work with the signer and also kind of generate the the required data for the ZK uh that you can then use to
submit transactions um so it's kind of like how just some some code that can allow you to use the signer and to get the correct and to build a some front-end on top of it okay so um right now let's let's just jump to the demo actually let me see if there's any questions for the demo I've uh already I will send you guys uh I guess the the link to our but this is all open source
so the signer and the SDK uh just bear in mind that uh we're uh we got we managed to get the this functionality ready for the demo but we still need to clean up the documentation a little bit so tentatively hopefully very soon we'll have a nice document for for the hack or for sure the organized documentation how you how to use uh this because I have had a little bit of setup before we started so but right now all I'm gonna do is just run the signer for the first time on a machine I'm building it and running it it's going to take just a few seconds oh yeah before that actually yeah just
like uh my word or showing I have a calamari power chain open which is uh this is running on the moon base relay chain and it's connected to the home base Alpha Fire trainer of uh remembering this this is what we've been using to test this so right now the sign is starting up it has a so this is part of it is a keeper generation tool the other part is a wallet so just like you know what if you want to create I'm going to give it a password and uh yeah this is a nice electronics [Music]
so it's making me save this and actually always save your place I'm just gonna paste it here so this is gonna ask me to rewrite it [Music] before foreign that's gonna be the next step
but okay so now it's running in the background I have this wallet [Applause] and it has a wait there should be a some more front end for this app basically it needs to show me the the zika address for my from my wallet but let's just assume I'm having I have it um and now I want to run the SDK so in the SDK Repository there's a an examples page and one of the examples is basically this piece of code
which we need from this piece of code we need the sign result which is this is the this is the thing called it called data for for our transaction we actually our Ledger so this this our Ledger actually has three functions uh one function to Mint from a public assetment a private private asset and then a function to transfer prior to do the private transfers and then a function to reclaim to make a private US public and then so this uh piece of SDK code we're looking at is a just do a mint
for the example basically create a so here it's going to take so we're gonna take one don't pay calamari asset which is our native asset and it's going to take one with 12 0 so just one one came here let's clean and make it private and create a private version uh all right anyway um and it's gonna send it to the private address which is gonna get from the assignment we will just run so there's a bit of setup that I've done here but the last part is to run this example
and what this is yeah um and this basically going to print some data that we want to take and it's going to print it in the console so but obviously this is a in the final version of this SDK you won't need to this this manually it will be yeah uh much more straightforward tips so let's just open the console as I said there's going to be some data here [Music] it actually it also actually so there's actually connected to my um polka dot
jazz and it understood what's what my accounts are um because the account the public account that I want to use is actually this Alice it's a well-known account where I founded it um so my well-known account is Alice and Alice is gonna prioritize some of her color Market and right now so this is my private address which should have shown up as a there's something with the signer that probably needs to be fixed uh there's like a front end where you you can choose different private addresses and yeah anyway um this is it uh and now the data that I want is actually printed a little bit
below this is the yeah this is the data basically my whole transaction and we can I can show it to you by going to the extrinsics tab pasting it so basically decoding it um yeah you can see how it's month pay the two private is the minting function well out of the three or the private transfer well there's also public transfer which is just a kind of like a helper so the main main ones are private transfer to private and to public and this is all the data that's required to do uh foreign [Music]
addresses how to spend it um and yeah the proof is at the end um and we can submit it anyone can submit this doesn't have to be good oh the person who submits needs to have the money so the one came a but as you can see Alice has like 20 billion came here so it will pass and it did pass and the event is actually very straightforward so yeah this is basically showing the the mint was successful and we now
know that yeah some uh the one came here was a privatized obviously at this point we know that this one kma is owned by Alice but Alice can easily break the link with one private transfer sending it to some other private address and then at that point no one will know yeah or others can also allow ask someone else to sign this transaction this paid a payload that I copied that was returned by the SDK if you didn't have anyone uh anyone submitted actually and uh uh yeah the private address of Alice will still be able to control it the
private version of the asset will be controlled by some private sorry some private key that's owned by others but someone else can submit the public part of this transaction uh anyway uh just in general you need this encoded data of the of of either the two private or the private transfer the two public which you get from the SDK and uh you can use that in your applications to submit transactions on a chain uh and uh right and those are very just private transfers or minting or retraining the other asset um and then
right I think yeah I think that's pretty much for me uh I think the next part is uh which Alberto will show you is how to to use uh this data we got from the SDK but use it in an exam to send it from the moon beam power chain to our chain and still do the private still have this succeed yeah correct one question in the Q a if you could answer it uh let's let me repeat the final version of mindful signer oh
well this is the pretty much in terms of uh yeah the cryptography this is the final version for hopefully it's gonna be the final version uh it's been like really stressed out sort of uh it's been this being stress test that doesn't speak uh for for our release of official release on Monday on calamari which is the current Country Network we have right so yeah that should be the final version obviously there's gonna be some front-end changes that need to be done um maybe there's gonna be some front-end bugs I don't know I will see but the cryptography side is that's the final version yeah I think we're aiming for some January or so at some point in January to actually
produced but right now you guys can use this software yeah if you're like really curious uh before we actually make an official release you can just go on the development branches I guess how link which are the development branches that that I just used and uh we'll be appending documentation uh to those someone you guys can subscribe to these two repositories to not sign your SDK and uh and see us as we build out the documentation yeah any feedback will be really appreciated cool thanks George oh there was another oh
there's a smartphone I guess um I'm not sure no I'm not I don't think though this I'm not sure actually this isn't being planned but there is a plan I think there was a plan to to get it into the because this is like a desktop application right now um there is a plan to have it become a browser extension which has can be done with uh wasn't but this is under development um right and the other thing I personally kind of want to make I want to make the SDK kind of embed this signer so you don't have to assume that users already have this signer but you can just once once you
embed the so once you use the SDK in your app and on the user the first interaction with it maybe somehow downloads the signer and navigates them to the process of actually using it so I kind of want to make this a little bit centers not have this assumption that it's already running it also yeah and then it's gonna hope soon it'll be in this in the other extension in the browser yeah but using uh browsing yeah yeah so the this whole disallow private dot or KSM transactions right they will have so they will so you have the dot right you sense that someone or that
or calamari at that point it's still public then you can create the private version of this token then you can do the transactions for the private although the private version so it's not like it's going to be private transactions on kusama but there will be private transactions on calamari using uh a corrupt private version of kusama token so yeah you will be able to I mean we'll be bridge over I think we've already bridged over a rural um column home beam obviously the Moon River asset and we'll bridge over all of them hopefully um and we'll make a permissionless so
anyone will be able to create kind of like one statement anyone can create an asset there right so we want to make make like this as well and then also be able to Mint entities oh I think I can take over for that final part of the presentation thanks Georgie it was pretty cool and and I I do want to say that you know a lot of the stuff was like you know just released really really shortly and so you know there's not a lot of documentation and stuff so hopefully you know this will be sort of provided so that you guys can use it but um it's really cool to see how you know you can do private transfers and so on and so now the next example that I'll do
and I'm going to take over the screen now is to show to like combine what George's presented but now short of uh uh from an xcm perspective right so just to do a little bit of summary basically he was able to create this like bytes remember what we're doing the xcm transact he was able to create the bite that we're going to provide to the Axiom message so that we can do the private minting of the asset but initiate it from Mumbai saltha from our test net okay and so one really important thing is that uh this private minting will will happen to the wallet that created the bytes right so it's not in this case it was not me uh Georgie just gave me a bunch of like you know bites with the
zero K proofs and everything so that you know I could do it from Moonbase Alpha but in the in the in the world that if I want to privatize my assets I would have to generate this myself and then use this on Moon Bay cell phone ideally you know ideally in the ideal world where everything is perfect you know I do see in the future sort of like a way to have like a slider that it's like you know privatized with Manta or privatized powered by Manta and then underneath there will be a bunch of xcm interactions that will allow you to sort of like privatize your asset transfers and and one thing we none of us discuss like not even Nana or nishika Georgia and I it's like what things can you do right I mean I think we'll discuss this on the Twitter space but the idea is
that you know we're going to start with a very simple um you know private transfer but you know you can have to think about as well what this unlocks right so if I Alberto on moon base or Moonbeam or let's say Moon River goes to calamari and I privatize movers there you know I can do a lot of things I can do like private payrolls I can do one question because we don't see your screen so no no I'm not sharing I'm not sharing I'm doing some I'm I'm sharing some thoughts and I'll do the the screen sharing knowers yeah so I mean once I privatize assets you know the the possibilities are I would say endless like you'll have to think about them but some of them that we brainstorm were you know uh private
payroll or even like private staking because once you move this to you know man Tower calamari and you privatize them you can bring it back to Moon River but like you already privatize these assets so there's no traceability to the original account and then you can stake on Moon River and also you can do private voting using the same mechanisms right so the idea is that you know you and the hackathon will have to sort of think about these scenarios and you know build them yourself with a sort of like a simpler UI and sort of provide this to to end users so I think we we all forgot to say oh it's the purpose of all this stuff and how you could use it right all right now I'm going to share my screen I'm going to put my um
so I I'm gonna go back to Mumbai Salfa to you know calamari and of the Explorers I'll actually be using the same basically uh xcm transactor and transactor signed so all of this is going to be very very similar there's only going to be three changes and I'll go through them right so I have here in my notes right in my notes I have here um three private mints bytes basically that Georgie constructed and gave to me you know via a DM a direct message so what I'm gonna do is that I'm gonna you know grab one of them go to calamari to ensure that this works right if I if I decode these bytes here
in 360 code you can see that this is actually something that Manta understands in this case calamari understands right so this is a private minting that is happening here I'm gonna do one that is actually I think this is not gonna work because I use this one already excuse me and uh you know when I was testing this out but uh just for the sake of this example I'm going to use it and see what what's going to happen all right so what I have to do and I'm going to build this from scratch so you can you know see it and and and and go with through like through it with me so I'm gonna click the xcm transactor palette which is the palette that allows you to um
to build xcm messages basically with a transact instruction in a simpler way and I'm going to look for the transact through signed uh function right for the destination we're going to use multi-locations V1 and then we need to go from Moonbeam to calamari and then in this case we have to hop one novel up we need to provide a field which is parachain and then 2084 as a peritone ID excuse me so uh for the fee payment I think what I'm going to do now is that I'm going to use in this case let's use multi-location I've not tested this before so we'll see if if I remember correctly but basically this multi-location right here even though it
seems similar as a destination multi-location this is how Manta or calamari sees its own token right so if if calamari says Hey as a token I want to use this multiplication they'll understand okay so this is a kma token all right for the bytes uh I need to provide the bytes that you know it was I already showed you here these are this is the call that we want to execute on Manta and so in this case or this one and then we need to provide the weight or remember the amount of execution time that we want to buy on calamari for this call and then also the overall weight which is all right so I mean how much weight do you want to provide for the xcm execution measure itself so because
this call is quite expensive I I'm I'm not really sure how much it would take so I'm going to put a very large number and the maximum is actually 20 billion so I'm going to put 17 million right and for the overall weight I just want to dedicate 1 billion because we know that this worked before 1 billion for for the Axiom message execution so the overall weight will be this plus 1 billion which is 18 billion all right so hopefully if I did everything correctly because I build it out uh for memory I'm going to sign this transaction and then what should happen I think this one is going to fail but it should not fail on moon base it should fail on calamari because I think this uh private
minting uh bytes were already used uh before I'm not 100 sure if I picked the the wrong one but I I'm trying to pick the wrong one so you should show you just to show you that this process is also async right if it's successful at Moonbeam doesn't mean that it's going to be successful when it gets executed on on on Manta so you can see here that I have my xcm message was sent as you can see here I'm going to go to calamari and then it Axiom success oh actually yeah this worked so I mean this is probably the the wrong one I actually use a good one all right but anyways this is just to show you that basically I was able to in this case I privatized kma assets all right and
these assets were held by uh by like the the assets themselves were held originally by the multi-location derivative account that for whatever reason it's not showing up here but the private utxo now it's owned by the account that Georgia used to create this this bytes okay so I was basically I privatized I did a private transfer where the origin it's known but the sender the recipient of this assets are is not really known all right and so yeah I mean now I could you know if I did it I could have also done the the transfer a scenario using you know the private basically I did a PRI a
pseudo-private transfer let's say and so yeah I guess this is to show you that basically this Axiom six message was successful and we can also now decode this very very simply by just providing the newest block which if I remember correctly is one one seven zero three so I'm gonna decode the 11703 message foreign just to show you uh what this script is doing uh there's some weird issues with uh there's some weird issues with um polka.js apps at this time let's see all right so you can see that what happens is that uh this this this
part is where actually the Axiom message is received and you can see that it received a horizontal message from the peritone ID 1000 which is mumbi and this is basically the block uh the the bytes that were sent with the xcm message all right so if we look at it basically it's the same one as before excuse me it is a descent origin we draw acid by execution and transact in this case uh the the withdrawal asset is to pay for the execution uh The Descent origin is to calculate the multi-location derivative account we're buying some block execution time and last but not least we're doing a transact in which we're providing now uh the bytes that you know I was given to by Georgie which is going
to do the private minting of this asset um he actually we tested already I think we tested at one point I'm not sure to privatize Dev tokens So Def tokens is the native token of the test net movies Alpha uh and actually you can also privatize you know Dev tokens and we created an erc20 uh nubei software called privacy of on mumbim um that you can actually I you know get as well sent to um from moon base to calamari and also privatize using you know the SDK and the signer to get uh you know to create the sort of the proof and then put the bytes on the Axia message to privatize these
assets right so I think that's all I had for you and well and Georgie as well so there's there should be a lot more to come in terms of you know documentation making sure that these things are clear but Axiom is quite new and and you know we tested this out probably two or three weeks ago and and so this is also quite new for us and quite exciting and so now just to show you the last bit of my presentation uh you have here the QR code in case you want to see the slides I'm going to actually share this in the chat we find it oops this is not it it's this one so this is the URL because it slides and I don't see any new
questions so if you want to learn more about Moonbeam you can go to moomim.network you know you can find our documentation at dog shot movie.network you have the telegram the Discord artificial Twitter and you can find me in telegram s Alberto v19 I'm one of the admins in the movie official channel so I'll make sure that you you know DM me because there's impersonators as well and if you have any questions comments about this activity let us know we're happy to help and yeah I think this is really cool because it's showing a little bit of a more useful use case for xcm that it's just not uh you know typical token transfers so yeah thanks a lot for tuning in I'm gonna stop sharing thank you so much I see that there is
one question in the chat does Manta have documentation to help understand how to use zkp I think that's a question for Georgie right yeah yeah I mean I think we're we're building this out right now it's the SDK is the way you guys Builder would use uh uh to create the zero knowledge proof submit the transactions to our chain right so we're focusing on building that documentation out now I mean I think I'll start oh there was one other engineer who was developing the whole SDK and now both of us are probably right some documentation over the next one or two weeks
yeah and there's already example called let me actually send I guess let me send what is the uh understand the uh SDK readme it's already a little bit so you guys can like what what you're big I guess um but uh I probably this won't be enough to get you started um you'll also need the signer and but uh yeah this is our one of our priorities over the next now that everything is working and we're at the phase of just final stress testing the whole system before we're releasing it so we can finally start writing the
documentation uh and the sign is soon there's some examples recovery okay I don't see any more questions so thank you Alberto thank you Georgie very much for everything that you presented today Okay so we are slowly let me just um share my screen now
foreign see everything so we wrapped up our second event of privacy on Moonbeam like I told you the pre first one was the Twitter spaces that we did so what to look out for um I know that Hector is keeping with our presentation he will provide you the link to the polkadot newsletter because we are planning our privacy on Moonbeam uh in-person event it's going to be a workshop around April 2023 so look out for that I see that the link is already
there so sign up for the newsletter like this you're up to date and you're not gonna miss it once again I would like to thank Moon Bean treasury for supporting this um event series and our Media Partners so ZK podcast like I mentioned at the beginning this session was recorded and it's going to be uploaded on the YouTube channel of the ZK podcast keep in touch with us if you want to know more about the key validator if you want to see more events more initiatives that we are doing on look at our website or our Twitter and if you have any questions obviously we're here to to answer them write to us
at events at zkvalidator.com and again remember to subscribe to polka dot newsletter if you want to know about the events or news from the ecosystem as general and that's it that's it from from us I hope you all enjoyed the event thank you very much for the first participating again thank you very much to Manta thank you very much to Moonbeam to the teams for bringing it all together thanks again and see you on the workshop in person bye bye