# MPCStats

- Speakers: [Kevin Chia](https://streameth.org/speakers/kevin-chia), [Teeramet (Jern) Kunpittaya](https://streameth.org/speakers/teeramet-jern-kunpittaya)
- Channel: [Devcon 7 SEA](https://streameth.org/devcon_7_sea)
- Date: 2024-11-12
- Duration: 08:29
- Watch: https://streameth.org/watch/6733041280d989c5b7bfec34

## Description

MPCStats is a framework allowing data consumers to query statistical computation from either one or multiple data providers while preserving privacy to those raw data. We support standard statistical operations, including nested and filter ones. Data providers do not leak their data and data consumers can be convinced the computation is done correctly.

## About the speakers

### Kevin Chia

I'm a software engineer working on privacy-preserving statistics at Privacy & Scaling Exploration (PSE). I've been working on projects about blockchain and applied zkp. I'm interested in learning new things and turn them into code which can be useful by others.

### Teeramet (Jern) Kunpittaya

Hi, Im Jern, a theoretical CS undergrad alumni from Columbia University. I love understanding knowledge/research fundamentally, trying to bridge them into application. Im currently a research engineer at PSE, tinkering at the intersection of zkp, mpc and fhe. Besides programmable cryptography, I'm very very passionate about education and how to empower people, hence core-contributing to EthPadThai, a Thailand grassroot web3 community.


## Transcript

Hello everyone. So we're MPC's stats team at BSC. So today we'll introduce our project, and it's currently worked on by Jern and I and Kazumune. So the goal of our project is to build a framework that allows users to query statistical computation across different data providers. We'll guarantee the data privacy and also the correctness of the result. We've implemented common statistical operations using MP-SPEEDS, which is a well-known MPC framework. We've supported 12 statistical operations, and also some common table join and array concatenation and filtering. So users can define computation like this. And we also integrated TLS notary so that the inputs to MPC are authenticated from some well-known websites so that we can prevent garbage in, garbage out situation. All right, thank you, Kevin. So basically, right now, we are talking about MPC, right? So intuitive approach for MPC is that having all parties, data providers, data consumers, to join as a competition parties, right? The bad things, I mean, the good thing for us, let's say, is that it's free verifiability because everyone is in the same, like, competition set, right? So they know, like, what competition is done, right? I request mean, I know that this guy just compute mean for me, right? The bad thing is that the data providers, consumers, everyone need to be online at the same time. And it's really hard, right, for many numbers of data providers, especially when the number of data providers grows, the computations grow skyrocket so badly. So how to solve that, right? We use another approach called client interface, which basically means that the data providers and data consumers are not in the computation parties. So there's three phases. The first phase is that data providers secretly share the data through some delivery links. They can log in, share data, and log out. And then another set of computation parties compute data, and once it's ready, data consumers just log in to get it out. So this is good because now the data provider and consumer doesn't need to be online at the same time, which makes sense. And it also doesn't grow with the number of data provider because the cost of the MPC computation is actually from the number of the parties in the computation parties. The bad thing is that the data providers and consumer now need to trust the parties, right? It depends on our setup. If it's malicious, we need to trust at least one of the parties is right. And again, because we are not joining in the NPC computation party itself, we have no idea what is the function that they calculate is actually the one we want. But again, the trust assumption is the same. If you trust that at least one of the malicious setting of the computation party is honest, we can be sure that they just run the computation that we want, like mean or median or anything we want. So use case, we are thinking about cross-department data sharing government, verifiable salary data, any survey research for policy planning. And yeah, many more, let us know. So demo time. So this is really up and running. We're still under maintenance, final optimization, because it's pretty big. So we will notify soon. But it's pretty interesting to explore ETH balance inequality at DEF CON. So what it means, you guys can use your Binance to share it privately. We won't know your Binance balance, but then we will be able to calculate the interesting stats we will show later. But you guys should join this group first. So we will notify by today, tomorrow, once the Docker file is smaller so that it can make sense to run in this internet, in DevCon. So the caveat, right, because we want to be upfront, so we will only allow you to share privately the free in-your-spot balance of Binance. And again, the parties could still learn the number of digits, although this comes from the limitation over here. It's not itself that the parties still know the number of digits of your finance balance but again we won't know actually the number and again this is the trust assumption that we trust that our three party doesn't collude right and please please join this telegram group we will get a bit soon and anyone who join will get a chance to win an NFT and win a lottery as an actual cash so yeah so this is just a quick go through it will already be in our readme, in our demo. So, get Binance API key, just go, yeah, Binance API key. Everyone knows how to do that. Get the API key and secret key. Make sure it's read only. And then, yes, so notarize this. This is only our script that you need to run. You just get clone and each address is just address for receiving the price. This is not the address for the Binance. This is just to send the price if you want one. And yeah, this is the website. So we are having max ETH balance of DEFCON, mean, median, number and Gini coefficient to make sure of the inequality. So yeah, join us. Thank you so much. Thank you, Kevin, John. Any questions? Oh, that's too far. Okay, you got it. Hey, great talk. It's not clear to me. Are you guys trying to collect aggregate statistics from multiple parties? And if that's the case and that's the use case, it's not clear to me, are you guys trying to collect aggregate statistics from multiple parties, and if that's the case and that's the use case, did you explore something like a Brio-like system, using function secret sharing? I don't think MP Speed supports that, so I'm kind of curious. It should be much, much more efficient. Yeah, thank you so much for the suggestion. Yeah, I think we've looked through some of it, but this limitation mostly is through the number of data providers. So, right now, again, like FHG, multi-key, functional encryption, secret string, yeah, we looked through some of them, and we're thinking of using some, but again, the limitation right now is that the state-of-the-art MPC of a huge number of provider, it still matters. And we think again, because we make sure that we don't want the competition to just grow indefinitely with the number of data providers, so we still use this. But thank you so much. Yeah, so just look at function secret sharing. I think it would really, really boost your results. Thank you. I appreciate function secret sharing. Note. Do we have any other questions? Oh, there's one. Hi, I was trying to scan the TG QR code that you showed just now, and it says link expired for me. Is it just t.me slash NPC stats as a link? Yes, yes. Okay. Sorry about this. So t.me slash NPC stats. Any other question? Can I ask a question? I know that the federated learning is similar to preserving privacy and then the medical hospitals, they're having a lot of confidential data of the patients, so they use federated learning. I just wonder what you're presenting, how different it is from federated learning. Yeah, so basically federated learning is like you train offline, right? Like data is still there, and then you send the update on the gradient descent or anything to your machine learning app in the air, right? So basically you train everything up there. But now, MPC, it means that you gather data from different parties and compute at the same time. So for federated learning, it can just actually, it depends on what types of things you use, but it can also use MPC itself So but yeah when it comes to fit running people still consider like not too many parties or at once But when we are thinking about stats, we are thinking about like population So we wish to make it more scalable into a number of data providers itself But yes, I think a lot of federated learning techniques to use MPC But we just want to make sure that MPC framework that really scalable to a huge number of data providers. Yes. Okay. Thank you
