introduction dMPC by Jason

ETHSydney Meetups · 19 Jun 2024 · 33:44

A speaker presents decentralized multi-party computation as an alternative for organizational custody, splitting control of an ordinary Ethereum account among several signers without a central server. Multisig vaults must be deployed on every chain and keep their spending policies in public contracts, while centralized custodians require trust, can be asked to freeze funds and charge transaction fees. In the dMPC design, signers run software locally, coordinate through smart contract events, generate keys through distributed key generation, and can add or remove signers without changing the address, while a separate key refresh issues everyone new key shards. It also covers a custody web app and a progressive onboarding pattern for apps, and admits transactions are slower and cost gas.

Topics

From ETHSydney Meetups, hosted by ETHSydney.

Transcript

and then my sister who Liv in Lisbon had just sentr and said TR TR and it's top of the boom just learn it all reallyy to best solution the various reasons

solution suited us as well valid so yeah today to talk to you a little bit Cody with Cody in terms of sharing between groups people about distric I'll show you Sal

is using distributed NPC and yeah next one all right so basic assets funds isiv or you can all right so little bit of

History 2016 quickly and but for which means you have to launch oh thanks uh you have to launch a vault on every single chain um that you want to custody funds on so now if you have you know multiple signers across digital assets across multiple

chains then if you remove a signer from um you know a VA on one chain you got to remember to remove them from all chain then it gets more complex if you want put risk management policies on it for example spend limits Whit list now not only have you got to do it on you know one of the vaults you got remember to do all the vaults so you can see that are trying to scale it up nois can become a bit clunky for that and the other thing with nosis is they are developing out their policy lay to make it more sophisticated uh however the policy set in smart contracts those smart contracts are public so a lot of um trading houses especially do not want their policies as to when they will close out deals who their counterparties are and all that sort of stuff they don't want them

public so no this is still a great tool but um there was definitely a gap in the market something else so in 2009 uh 19 sorry fire blocks they're certainly not the only centralized custodian um but they're probably the biggest one um came to the market and they grew very quickly essentially because they solved the problems that nosis has so um five blocks all the policies are private off chain so you know they're not public which is great and um yeah the other good thing about Firebox is it's multi- chain uh and it's multi- chain because and I'll get it onto that in a minute but um essentially they can form the

transaction and then just push it to the RPC node on you know any particular chain they want to so so that's centralized custody I'm going to talk a little bit about centralized custody because why am I bothering with decentralized custody centralized is the answer so I'm going to talk a little bit about that and then and talk then talk about um the MPC all right so if you have a look at um a c fo of a digital asset organization they have a hierarchy of needs that is they want to keep the private key nice and secure that's fine but they can't just keep it to themselves because they're an organization they have to have you know other people using the digital assets being able to sign um transactions on the digital assets they also have to

earn a yeld and a return on their digital assets so just storing them all on a ledger under their pillow is great but it actually doesn't S help a too much so what they've generally done is turned to centralized custodians to uh to help them with that problem and centralized custodians to solve some of the problems of NIS so that worked really well however centralized custodians have some problems um the first problem with centralized custody is the trust assumption so centralized custodian will retain some or all of your key material and it can be problematic if they go dark so you think about silvergate FDX those collapses what happens when you got digital assets

with them it's problematic um and uh the other problem um with centralized custodians is they're not free from government evence they could be asked to you know freeze your funds and and things like that which which is also a problem and then last big problem is centralized custodians uh they're actually quite expensive so when we were looking to custody 50 million usdc um for our investors we then have to make a return on those assets but one of our biggest costs was actually going to be paying fire blocks or a similar custodian um because they charge transaction fees for um inflows and outflows from your wallets so um so yeah centralized cust custodies a

step in the right direction but it's certainly not the answer in my opinion how de centralized platforms work they work a whole bunch of different ways this is just one way and it a lot of them reconfigure it how they like but essentially you have a platform layer here which is sort of very we to like you have the user devices coming in using API authentication so they will propose the transaction they want to do the platform will then check off the risk policies such as white list limit on transactions that sort of thing they may also then ask other devices to you know okay the transaction um if a CEO's got to ass sign for it or whatever it might be once it's all clear um and it's passel the risk checks they will then

run um three NPC nodes generally or it can be more and they will push that transaction down to the NPC node which then use a private Network to communicate with each other and share off sign off their share of the transaction what the nodes don't do is they don't share the key their share of the key with each other um so if you've hacked one node you still have to go and hack the others to get all the private kit so that's essentially how centralized custodians work all right so is is there another way but trusting um the centralized C well what I'm here to tell you today is there is another way um that can have the benefits of a centralized custody

provider without the risks that you're running by using it so it's called um decentralized NP or dmpc uh it was originally um came from academic paper um called distributed key generation with ethereum smart contracts by um Philip Schindler and other authors in 2019 he actually has a a GitHub repo that you can go have a look at and it basically just proves the concept and then in February 23 um a project raised $2 million to um create like a commercial audited SDK version um of this technology and that was backed

by coin fund metaweb and kin which is the trading company um that my sister and I founded back them as well all right so how does dmpc work like why is it why is it going be pretty handy well dmpc allows you to create an organizational wallet up the top here and that is basically an EA so if you go look at it on at the scan it would just look like an EA it will be indistinguishable from any other EA and it will have an address and the control of that EA is actually split amongst participants here now I've

just got an example of three participants you can create ones with much more than three um but like this guy's got his EA in metamask this guy's got his EA and this gu is using a different Hardware solution and what happens is the first guy proposes they're either called deas organizational wallets or vaults those terms are simp used interchangeably I don't like vaults because it sounds like no's fault and it's not um I'll call them organizational wallets deas so the first guy will propose that a um DEA is created and he will say I want these other two guys to be sign on the um DEA and then they are listening to events on

the smart contract as each DOA has its own smart contract and in front of that smart contract there's actually a routing contract so that they know that there's a smart contract they need to start listening on um and they will um start listening for events and they will realize oh yeah you know someone wants me to join this Vault and if they decide to join it they will um start the ceremony process to essentially create the um private key uh it uses decentralized key distributed key generation so that so this organizational wallet here has no se throws these guys down here do have private keys in their EAS but here there's no se thr to which is quite and these guys here are just

running a light little um npn no package that's doing all the cryptography locally there's no apis or anything like that there's no centralized server they're all running it locally they're listening for events on the smart contract and that's how they're participating in the Deo all right so what configurations have you got once you set one of these things up um you can add or remove underlying signers uh which is those EOS I was shown in the previous slide and that's super handy because if you're an organization and you've got five people on a wallet and then someone leaves a org well you just drop them off that and you put someone new on you don't have to change the top decentralized address

that stays the same but what you've done is you've removed one former staff member and you've put someone new on so um you can rotate out easily which is great uh and then for security you can also do um a key refresh where you essentially just issue everyone new key shards and it's more just security if someone's hacked one of the participants and they're listening under APC they can start to work out key information of other participants and so um you can just do like a key refresh to um reduce the chance of that um hack occurring so um the each DEA has has thresholds and ass signing threshold two or three uh

two five three five four five that's how many people are required to sign the transaction have to agree with the transaction uh rotation is um when you want to remove a participant like I was talking about before you have to get agreement on that um and you have to get a certain threshold to agree on it which is really important and if you set your rotation threshold really low then even if you have three or four signers on a DEA and you have a low rotation threshold someone can just rotate everyone else off the wallet and steal the PS so um you want to set a sensible rotation threshold and then the administration threshold it's not particularly exciting you can name your um de like that all right so how would a transaction

flow actually work if we think of three people Alice Bob and John um Alice proposes a transaction to um the smart contract and Bob um will listen see the event there's a propos transaction confirm it and then either and we're talking about a three person VA here either either now John or Alice can confirm it because Alice can actually confirm her own transaction which is a little bit takes a bit of time for WRA your head around but Alice can do that or or or John could do so um once the transaction is proposed and confirmed then any participant can take the um transaction um shards I guess you'd say which are in the smart contract and

combine them and that happens locally and that forms a fully formed ethereum transaction and then they can push that to the relevant um EDM chain that they want to um have the transaction on all right so this process is great because it's really really decentralized it's really secure because if you hack one of the underlying signers you don't have any information about the other underlying signers it's um there's just really no information you might know what their EA is if you look at smart contract like you don't have um their IP address um if they're not if they're not privately networked

you know you know nothing about them so makes them hard to find but where it is uh difficult to deal with is that it can be a bit slow because one person has to propose a transaction and then it takes um you know a block cycle for that to occur and then as other people confirm the transaction it takes you know more block Cycles uh and it also takes gas for each you know transaction as the underlying participant proposes and then confirms so um we're running it on polygon it's cheaper and there's no reason not to because um you can then form the transaction and push it to ethereum so you know that's handy but it's still a bit slow and some trading firms uh like to do thousands of

transactions very quickly and and even pogon can be too slow for that so uh what you can do is instead of using the smart contract for all its functionality you can just use a Smart contract to keep the key shards of the um elas and the um like configuration thresholds I was talking about before so that is that is kind of handy because if if you lose these key shards and these key shards are encrypted to the EA so yes they're public in the smart contract but the only thing that can decrypt the key Shard is the EA the private key of the EA um that controls it um but yeah if you lose that information then you

lose your Vault so you definitely don't want to or your do so you don't want to do that but the transaction proposal confirmations um they're only really useful while the transaction um is being formed and after that doesn't matter so much the transaction's done um it's it's already submitted to the blockchain so what you can do is you can take this out of the smart contract and you can either put that in a um database you run yourself or you can use um like a distributed database or any other sort of case storage meeting you like and what that does is it reduces the gas requirement for proposing and confirming transactions which makes it cheaper and it also makes it way faster because you're not waiting on blocks j s it's not as secure because

um for the um participants to communicate with each other they then need essentially a private Network to communicate with each other um so it's not as secure but it's still like pretty secure just because you got a private network doesn't mean you're vulnerable um you know you still have all your f w and all your protections around that so some of these features I have sort of touched on but I'll just go through them um so it's cross evm out the box which is Handy compared to account instruction and smart accounts it supports everything in the AA W so you can transfer nfts erc20 tokens you can sign arbitrary messages for defy so your distributed EA can trade digital assets

on Def platforms um so there really is no limit um there's no limitations on this as to what you would get in eway uh it's an open protocol um you don't have to have a sales call a demo um sign up to something and that's a bit scary um it's just open you can just go on the web download the SDK and start playing with it it's very lightweight um it's implemented implemented in both njs react environment or you can just use pure JavaScript um as well there's two SDK flavors depending on how you want to deploy it uh it's very cost efficient uh much much much cheaper than signing up to a centralized custodian signing

service um it's I believe it's more secure than centralized NPC if you do run it fully decentralized but you have those drawbacks if you run it um where you're using a sort of database for the um transaction proposal and Confirmation then it's definitely as secure as a centralized custodian um and yes I've gone through the low latency already all right so I'll go through two use cases um salt using it for custody so I'll go through that one and then I'll go through Progressive F boarding which is another great use case so um custody right so there's a um screenshot of our D which is pretty in Orit doesn't

actually tell you how it works um and this is how we're using it so essentially salt um when it's released is a web app and CFO cosos will log in to salt um they will log in using an EA their EA they'll create an organization and then they can go create accounts they can add um users to accounts um and then they can add policies like Blacklist white list all that sort of thing um and so that sort of sits up here and then what happens is down here is that you have the um deoa technology and salt is basically an

orchestration layer for the DEA technology so when you invite people to your organization what that will do is allow them to log into salt with their eoa and become those underlying participants on the deas so that they can propose and confirm um transactions and what happens is when an organizational signatur is an underlying signer on a DEA if they um they're going to salt and they propose that they want to do a transaction um and then after that time other organizational signatories can uh they'll get notifications and they can essentially confirm that they you know they want to do this transaction or they

don't want to do it um and also we have a concept of Robo signers which uh um is basically like an automated um signer and what's important to understand about salt compared to a centralized custodian is that all this all the the key material and all um this sits inside the um project organization so all salt does is just provide an orchestration layer for it um the actual um key material sits always with the organization so the organization will set up a robo signer which is like an automated signer um it's just set up using at the moment using um Amazon ec2 and we've just got cloud formation to set up really easily

and um it will store some key material so it's kind of clever because we've set the um threshold high enough that if one person here proposes a transaction then the robo signer will go and check that it meets all the um like Risk policies that being placed up here by the CEO and CFO and if it does then the robo signer will agree to sign off on the transaction and so now you have um you have enough key uh enough key material that transaction can be formed so once that happens the robo sign will then form the transaction and submit it to the relevant blockchain so yeah that's sort of like architectural map and then if for some reason someone propos a transaction that

fails a risk policy then salt will take you know a bunch of different actions to let people know what's going on so it's going to look and behave very much like a centralized custodian but it's actually using decentralized um under the hood and if salt goes dark or we go Rogue or something it's pretty simple you've got all your key shards you just go use the um PM package and go transfer your assets somewhere else so we have no control over your assets and if we're asked to freeze or lock your assets we can't control of it we can shut off your access to Soul but you can still use theong DK to move your assist all right um and use case two

which is very cool use case I think um it's it's called Progressive on boarding now if you launch a a DF and um this is been looked at by a number of games actually at the moment um but essentially you launch a d app especially a d app for um where you can have groups of people from an organization wanting to use the D app um you have a bit of a problem and that is if you just go off and get like a wallet as a service product and custody their nfts or whatever you're generating for the tokens well how long do you have to do that what if they don't log in again like you know how long's your um custody period so and you got to keep paying your

wallet as a service provider and that can be quite expensive so that's sort of kind of a problem um but if you the F day one when someone jumps on your de app and they don't know too much about it and then you're like hey here's some key material and Seed phrases and we need more more backups and they're just like still have to use don't use it so you sort of have a bit of a problem as to how do you solve this problem when you're a d and um this technology solves it really well because it's called Progressive on boarding so day one when someone logs into your D you create a DEA and you as the D provider have two Kish to underlying signers to it to the key shards and when they log in you

attach one to their um you know metamask as they logged in so um so you have as as a d provider you have custody of the assets um because you have two key shards and um you know you'd set a two of three signing scheme you never set three of three because there's no point in having dmpc if you're going to go three or three um you set two of three and they use the D and then the thing is the goal is after maybe six months you don't want to be customing their um nfts or whatever it is anymore it's cost also but of course also could be regulatory especially in the US um it's now getting harder and harder custody and key material and custody digital assets on

behalf of other um projects um there's more and more regulations coming your way around that um and if if you're not if it's like self- sovereignty and you're only providing Services then it's a much lighter touch regulation so that's another reason why um Progressive on boarding is great so what what happens is after say 90 days they log in and you actually force them to take over one of these and how you do that is when you created your DEA you set a fairly low rotation threshold which means that you can just rotate one of your EAS out and force them to provide another Ela and rotate it in so after 90 days they've been using a doubt they probably

quite like it they'll probably go through that little bit of pain point take a minute or two to do that um and then after 180 days uh you know they're probably really like you D now they've got lost assets in it everyone's using it great then you give them the last key Shard and you force them to take it so now after six months you progressively onboarded them and um you know they've got full sovereignty over their assets and for everyone else who dropped off and this is a big problem with game studios um a lot of players come in for a few days and then drop off if everyone else who dropped off you're not paying a really expensive wallet as a service provider for some unknown length of time to keep their um uh account open because this is an open protocol if they log in

in eight months time well you know it doesn't really matter you can just serve them up their assets not you haven't paid anything for it so so it works well for that and yeah there's just some links H yeah I will just in a sec I'll just finish um some links into U the project that uh um developing the underlying wallet technology that I've been talking about um their docs are great you can reach their teams um very easily with their website and there are the SDK links so uh any questions one sure yes yeah yeah

yeah no no yeah so you literally rotate yours out you force the user to supply another EA and you rotate them on in it and then your key is now essentially can't be used because you rotated it it out yeah yeah and that's sort of progressive on boarding yes why yeah sure really really good question and one of the reasons um we were super excited to use it actually uh it's naely cross chain because your underlying signers form the transaction and they only use a Smart contract to like communicate with each

other but essentially they actually form the transaction on their own hardware and so once they form the transaction they can then push it to any RPC node they like so they can push it to a polygon node an ethereum node Etc as long as it's a validly formed transaction for that um Network and most evm chains have very similar if not identical transaction um payloads then yeah you can just push it to anyone you want yes once IC mechanism for Sol to my application does every um transaction needs designed by multiple people in order to be executed or can I also Define maybe a

certain highay like some smart contact functions or trans can execute everything Els to be yes really good question um yeah so at the moment um initially for us um so the like the dmpc underlying protocol you can take and configure that how you want um do whatever you want um but for salt as a as a project looking for um a custody solution uh we're targeting treasury management at first so essentially one person can can propose and then if the like let's say um they propose a small

amount and let's say their policies on the wallet say that only one person needs to um approve that then the robo signer will go oh that's okay I've this person's proposed it and that's all we need so it will then just go and sign it and push it to the blockchain if and then if it's like a high delegation then it Force more people to sign it um so yeah that's essentially how it works with our implementation of it certain some some possibilities for exploits in this case maybe execute a lot of very small transtion like who has the responsibility to prevent those exploits

do s or does uh with with salt and the robo which is connecting into salt so so you can set a policy that says you can only spend a certain amount of e over 24 hours okay so if you're doing lot of transactions you're going to hit your daily limit and then the robo sign will realize that it won't sign off transaction this is Amazon e container which is in the Project's own AWS instance not ours and then um the Sal application is yeah

just a a hosted no JS yeah that we host y so you're saying if if you have an organizational and someone rotate someone else off it yeah that's correct yeah it reconfigures itself yeah

okay yes I'll just see bring that up uh yeah I'll see what you mean so you're saying yeah the old key shards how are they essentially um like invalidated is that what you mean are they invalid uh yeah that's a good question um I'll have to take that one on and ask the um the guys um and and let you know on that one yeah y I know um in the academic paper it does account for that

um they do some paper cryptography but I'm not a cryptographer so I won't I won't try and pretend I know how that one works but I do know it does handle that situation on a cryptographic level so a yeah it does it through craphy yeah yeah yeah and um there's no technical limitation in using other signing schemes for other um chains like Salo um Cosmos and stuff like that yeah okay any other

questions right thank you [Music] guys welcome to the mutable office