This library provides an implementation of multiple common (multiparty) protocols in MPC initially designed to implement the dishonest majority threshold MPC scheme of Rosefield, shelat, and Tyner ([](insert link here)).
Compilation requires a Nightly rust toolchain (version >=1.75.0), as well as the EMP-tool and EMP-OT libraries, that themselves depend on OpenSSL.
EMP-tool can be installed with the following commands, see https://github.com/emp-toolkit/emp-readme for more information.
wget https://raw.githubusercontent.com/emp-toolkit/emp-readme/master/scripts/install.py
python[3] install.py --deps --tool --ot
The EMP-agmpc library has been modified to interoperate with this library and the modified code can be found in dependencies/emp_agmpc
The library can then be built using cargo
cargo build [--release]
The library is designed to mimic the Universal Composability (UC) model where we have a number of functionalities represented by traits, and then protocols that realize those functionalities by implementing the trait. There are a few base concepts:
PartyIdthat identifies a party in a protocol with a correspondingPartyInfofor communication information.FuncIdthat identifies the type of functionality, and is associated with the role that a party takes in a (sub)protocol.SessionIdthat identifies what instance of a protocol is being communicated with.- The
BaseFunctrait that identifies theFuncIdandPartyIdof a functionality instance, and also a static list ofFuncIdfor any dependencies.
Because a substantial amount of an MPC protocol relies on communication most functionalities will either directly require or have a transient dependency on the network.
The network, identified by FuncId::Fnet, is represented by the AsyncNet trait that allows users to (concurrently) send messages to (PartyId, FuncId) pairs.
As such the default implementation (AsyncNetMgr) assumes a unique channel for sending to and receiving from (PartyId, FuncId).
This simplified model allows separate functionalities to utilize the network without contention, but does not handle the case where a functionalities with multiple concurrent SessionIds wishes to multiplex messages on the same channel.
Currently this is left to the implementer of the functionality if required, but may be implemented in a more standard way in the future.
For example, consider a simplified AsyncCom trait that represents the Fcom functionality.
pub trait AsyncCom {
async fn commit_to(self, sid: SessionId, party: PartyId, data: &[u8]) -> Result<(), UnexpectedError>;
async fn expect_from(self, sid: SessionId, party: PartyId) -> Result<(), _>;
async fn decommit_to(self, sid: SessionId, party: PartyId) -> Result<(), _>;
async fn recv_from(self, sid: SessionId, party: PartyId) -> Result<Vec<u8>, CheatDetectedError>;
}
In order for party A to commit to party B with new session id sid, party A calls commit_to and party B calls expect_from with corresponding arguments.
In general this operation is fallible, but the details of this failure are not actionable by the caller such as a network connection being dropped.
Once a pair of parties have completed the commitment for sid, the parties call decommit_to and recv_from respectively.
Unlike the commitment case where failure is unexpected, the party receiving a decommitment may detect that A tried to open the commitment to a new value and will want to report more information about how the cheat manifested.
Imagine we have a protocol FooRand that realizes Frand in the Fcom hybrid model, then it is expected that a FooRandPlayer<FC> would be generic over FC: AsyncCom and implement AsyncRand.
Some functionalities may work over multiple types of objects, such as Fcote that allows for correlated OT extension over an arbitrary ring T by providing async fn send<T: Ring>(...).
Likewise some functionalities AsyncBar<T> would be generic over T: Ring, but a protocol may specialize to only implement over one ring AsyncBar<RR2_128>.
Currently the following functionalities are implemented by the library
FnetwithAsyncNetMgrFcomwithFolkloreComPlayerFrandwithFolkloreRandPlayerFcotewithKosCotePlayerthat builds upon the KOS15 correlated OT protocol implemented in the EMP-OT library to support per-message correlationsFmultwithDklsMultPlayerthat implements the multiparty multiplication scheme of DKLs19FmpcwithWrkMpcPlayerthat utilizes the WRK17 scheme implemented by the EMP-agmpc libraryFabitwithWrkAbitPlayerthat utilizes the WRK17 scheme implemented by the EMP-agmpc libraryFtabitwithRstTabitPlayerFthreshwithRstThreshPlayerandGenericThreshPlayer
We would like to thank LaKyah Tyner for their contributions that are not reflected in the commit history.
Please email rosefield.s (@) northeastern.edu