## Definition Multi-Party Computation, or MPC, is a cryptographic technique that allows multiple users or systems to jointly calculate an output, without needing to disclose their inputs to each other. ## Usage MPC is typically used when multiple parties wish to collaborate without having to disclose sensitive data. A prime use of MPC is when we want to generate the signature of a [[Bitcoin]] transaction without wanting to store or disclose the private key used to sign it at any point of the transaction. We split the original private key into multiple shares, and each share is typically stored separately from one another (either logically or physically, depending on the threat model). Assuming you reach the threshold amount required, the provided shares can be used to calculate the valid signature for a transaction. There's also a level of resilience in availability when using MPC - as thresholding is used, all parties do not need to necessarily be present for MPC to be usable. If, for example, you have a 3-of-5 threshold, then you only need any three of the five parties with shares to be present for MPC to work. It doesn't not matter which three, only that you need three in general. ## Example Let's say there's three people: Alice, Bob and Charlie. Alice has a salary of £100,000. Bob has a salary of £70,000. Charlie has a salary of £140,000. They want to calculate the average salary between them, but don't want to disclose their individual salaries to each other. Alice splits their salary into three *shares*, of £30,000 (Aa), £20,000 (Ab) and £50,000 (Ac). Adding those share values results in their original salary of £100,000. They tell Bob a share (Ab), and they tell Charlie a share (Ac). Bob splits their salary into £20,000 (Ba), £30,000 (Bb) and £20,000 (Bc). They tell the value of Ba to Alice, and the value of Bc to Charlie. Finally, Charlie splits theirs into £40,000 (Ca), £50,000 (Cb) and £50,000 (Cc). Alice is told Ca and Bob is told Cb. Now they know a share from each of the others, and still have a share they didn't tell anyone: Alice - Already had Aa (£30,000) - Received Ba from Bob (£20,000) - Received Ca from Charlie (£40,000) Bob - Received Ab from Alice (£20,000) - Already had Bb (£30,000) - Received Cb from Charlie (£50,000) Charlie - Received Ac from Alice (£50,000) - Received Bc from Bob (£50,000) - Already had Cc (£50,000) Kind reminder, that each share does not disclose the original value, only a portion of it. Now, if they combine the value of the shares they have, they end up with: Alice: 30000 + 20000 + 40000 = 90000 Bob: 20000 + 30000 + 50000 = 100000 Charlie: 50000 + 50000 + 20000 = 120000 They tell each other their values at that point, and are now able to calculate the average salary: 90000 + 100000 + 120000 = 310000 310000 / 3 = 103,333.33 (recurring). To validate this, let's calculate the average of their original salaries, which should match: 100000 + 70000 + 140000 = 310000 310000 / 3 = 103,333.33 As a result, they were able to calculate the average salary between the three of them without having to disclose their original salaries.