0.4.1 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
MIT - MIT LicenseAn MPC framework that unifies and simplifies the way of developing and working with multiparty protocols (e.g. threshold signing, random beacons, etc.).
MPC protocol execution typically looks like this:
// protocol to be executed, takes MPC engine `M`, index of party `i`,
// and number of participants `n`
async fn keygen<M>(mpc: M, i: u16, n: u16) -> Result<KeyShare>
where
M: round_based::Mpc<Msg = KeygenMsg>
{
// ...
}
// establishes network connection(s) to other parties so they may communicate
async fn connect() ->
impl futures::Stream<Item = Result<round_based::Incoming<KeygenMsg>>>
+ futures::Sink<round_based::Outgoing<KeygenMsg>, Error = Error>
+ Unpin
{
// ...
}
let delivery = connect().await;
// constructs an MPC engine, which, primarily, is used to communicate with
// other parties
let mpc = round_based::mpc::connected(delivery);
// execute the protocol
let keyshare = keygen(mpc, i, n).await?;In order to run an MPC protocol, transport layer needs to be defined. All you have to do is to provide a channel which implements a stream and a sink for receiving and sending messages.
async fn connect() ->
impl futures::Stream<Item = Result<round_based::Incoming<Msg>>>
+ futures::Sink<round_based::Outgoing<Msg>, Error = Error>
+ Unpin
{
// ...
}
let delivery = connect().await;
let party = round_based::mpc::connected(delivery);
// run the protocolIn order to guarantee the protocol security, it may require:
echo_broadcast support out-of-box that enforces broadcast
reliability by adding an extra communication round per each round that requires
reliable broadcast. We plan to write a book guiding through MPC protocol development process, but while it's not done, you may refer to random beacon example and our well-documented API.
sim enables protocol execution simulation, see sim module
sim-async enables protocol execution simulation with tokio runtime, see sim::async_env
modulestate-machine provides ability to carry out the protocol, defined as async function, via Sync
API, see state_machine moduleecho-broadcast adds echo_broadcast supportderive is needed to use ProtocolMsg proc macroruntime-tokio enables tokio-specific implementation of async runtimeFeel free to reach out to us in Discord!