# MPC Tooling or How to create MPC apps

- Speakers: [Rasul Ibragimov](https://streameth.org/speakers/rasul-ibragimov)
- Channel: [Devcon 7 SEA](https://streameth.org/devcon_7_sea)
- Date: 2024-11-12
- Duration: 08:09
- Watch: https://streameth.org/watch/6732f7f280d989c5b7abc08b

## Description

Let's get into the state of the art of MPC development: we'll discuss different MPC schemes, current MPC tooling & how you can create MPC apps today.
We'll cover the tech stack from a frontend level (e.g. MPC compilers) to a backend - and of course how we can combine them.

## About the speakers

### Rasul Ibragimov

Software Engineer working in MPC research team of PSE
RLN, zkEmail and zkEVM teams before


## Transcript

Hi everyone, my name is Rasul. I work in MPC research team of privacy and scaling explorations. And today I want to talk about MPC tooling or how we can create MPC apps. So what exactly I'm going to go over is like first short introduction, what is MPC? Then I'm going to talk about applications of MPC and then I'm going to talk I'm going to cover tools we work on in our team that allow people to create MPC apps and then short example interesting example of using these tools. So what is MPC? MPC is an interactive protocol that allows parties to jointly compute a function or their inputs while keeping those inputs private. So let's imagine that we have a public function f that takes two parameters, x and y. And let's say party one provides x parameter, party two provides y parameter, and they will be able, parties will be able to compute the output of this function while keeping their individual inputs private. So there are two kinds of MPCs. First one is app-specific and second one is general purpose MPC. So app-specific protocols, MPC protocols are designed to represent one specific function. So let's say threshold signatures, Shamir secret sharing and PSI and many others. And general purpose are designed to represent any function including the all the app specific protocols as well. So there are many applications of MPC. I'm going to mention a few examples. So it's like privacy preserving, preserving machine learning, cost narcs, MPC stats is another great project that PSTM works on, and etc. So first tool I want to talk about is called Circum MPC. Circum MPC is basically a project, a project is a fork of Circum, it's a famous ZK DSL, but it compiles to a universal MPC format called Bristol Fashion Circuit, that can describe Boolean and arithmetic circuit. So why we chose Sercom is because many zk slash cryptography devs already know Sercom and it will be easier for them to create circuits in Sercom. And there's also a big number of circuits written in Sercom already. For example, SercomLibML. And they can be reused without changing the code. And that's actually what we did in PSE as well. We just took circumlibml, Kathy's library, and we were able to run MPC circuits, ML, sorry, in MPC. Another tool I want to talk about is called Summon. Summon is a language for collaboratively summoning computations. And it's another tool that my teammate mostly works on, Andrew Morris, and summon is TypeScript like DSL, similar to Circum NPC, with a goal for user-friendliness. It can be used from or in TypeScript, and therefore it allows to build everything end-to-end in TypeScript. So if you know Cursive Team, they already use a summon tool as well in their apps. And the last tool I want to cover is called CircumMPSpeeds. So first of all, MPSpeeds itself is a big, big framework that people can use to create NPC apps. But it might be a bit hard for beginners to start with it. So what we do, so Circum MPC speeds is basically a transpiler from Bristol format that generated by someone compiler by Circum MPC, and a transpiler from Bristol format to .mpc representation that is required to run the circuit in MPC with MPSpeed's backend. And this project shows an example of running circum-libml machine learning circuits in MPSpeed. And you can find benchmarks and every information about this in the repo. And yeah, as I said, the same tool can be used to transpile circuits generated by someone as well, not only by circum NPC and The last thing I want to talk about is an example of using these tools specifically someone It's a matching game for friends and lovers That Barry Whitehead was talking about last year on Def Connect Istanbul. It's called two PCs for lovers So basically you can play with your friends or with your lover and you can choose love. But if you choose love but the result is friendship, only you will know about your feelings. Even if your friend knows advanced cryptography. And you can try it here. Yep. That's it. Thanks for coming. You can find me by my username, Kairisu. Yep. Thank you, Rizu. Any questions? Oh, there's one. I probably need some help. No. Do you want to try? Yeah, let's go. I'll leave my mic here. There? Sorry. Sorry, Georgi. That was a good direction, so. Okay. I have a question. Did you explore using MPC for building interoperability on bridges? No, actually. No, I don't think so. I don't think so, no. Do you have an idea? Like, for example? Opinion? Yeah, I mean, building interoperability protocols with MPC. No, we weren't doing this. We mostly were focusing with... I work mostly on Circum NPC. So we were focusing on privacy-preserving machine learning. Like, mostly. And, yeah. Not on that case yet. Yeah, sure. I mean, we are just exploring it and getting into it. So I wanted to see more opinions and build our surround that. Okay, thanks. Sorry if I didn't answer it. We see a question over there. Oh, this is a mic. Sorry, I didn't know this was a mic. Siracom usually targets an R1CS backend, and so I'm assuming all of these other tools also. And my question is, do you pay a price for that? Are there other MPC arithmetizations that you work with? Or is there something inherently related to the Seracom toolchain that you find useful here? Sorry, your question is, do we have? So my question is that, sorry. Oh, okay, sorry. I was not here when the DICE was introduced. But my question is that SIRCOM is typically targeting an R1CS backend, and so I'm assuming all these frameworks and toolings are doing the same, but there are some pretty clever other arithmetizations, and I'm wondering if MPC is solely in this domain, or you can make use of other things like Plonk or other repetitions? Yeah, I think it's like, as I mentioned, we like, it's a fork of Sercom, and we don't target R1CS, instead we target Bristol format. Bristol format is a universal MPC format that can describe arithmetic and Boolean circuit, and yeah, it's just like a super simple format, and from this format you universal MPC format that can describe arithmetic and Boolean circuit and Yeah, it's just like a super simple format and from this format You can already I don't know also transpile it to whatever back-end you want So for example MPC library is like another library that PC works on you can target this library You can speak target MP speeds library. Yeah, etc Let's give a big applause to resume
