Crate sodot_mpc

Source
Expand description

§Sodot MPC

The Sodot MPC provides a secure and efficient implementation of threshold cryptography using multi-party computation (MPC). This SDK enables distributed key generation and signing for various cryptographic schemes without requiring a trusted dealer.

§Key Features

  • Threshold Key Generation: Generate cryptographic keys across multiple parties
  • Distributed Signing: Sign messages collaboratively without exposing private keys
  • Key Refresh: Update secret shares while maintaining the same public key
  • Multiple Schemes: Support for ECDSA, Ed25519, BIP340, and SR25519
  • Secure MPC: All operations use secure multi-party computation protocols

§Basic Usage

use sodot_mpc::{KeygenId, KeygenPrivateKey, RoomUUID};

// Create types for MPC operations
let keygen_id = KeygenId::new("2WpjFqPh8TqQKqZKZXgW8a".to_string());
println!("Party ID: {:?}", keygen_id);

// Create a private key from bytes
let key_bytes = [1u8; 32]; // Example 32-byte array
let private_key = KeygenPrivateKey::new(key_bytes);
println!("Private key created: {:?}", private_key);

// Create a room UUID
let room_uuid = RoomUUID::new("550e8400-e29b-41d4-a716-446655440000".to_string());
println!("Room UUID: {:?}", room_uuid);

§Error Handling

All operations return Result types with SodotError providing detailed error information for all threshold cryptography operations.

Modules§

bip340
Threshold BIP-340 (Schnorr) cryptographic operations and key management.
ecdsa
ECDSA threshold cryptography implementation.
ed25519
Ed25519 threshold cryptography implementation.
error 🔒
ffi 🔒
schemes 🔒

Structs§

Bip340
A threshold BIP-340 (Schnorr signature) implementation.
Ecdsa
A threshold ECDSA implementation that allows distributed key generation and signing.
Ed25519
A threshold Ed25519 implementation that allows distributed key generation and signing.
ExtendedPrivateKey
An extended private key base type
ExtendedPublicKey
An extended public key base type
KeygenId
A base58 string representing the ID of a party in the key generation protocol.
KeygenPrivateKey
A 32-byte private key used for initializing the key generation protocol.
PublicKey
A public key base type
RoomUUID
A hex string representing a room UUID for MPC operations.
SecretShare
A secret share base type
SodotError
Represents all possible errors that can occur when using the Sodot SDK.

Type Aliases§

Result
A specialized Result type for Sodot SDK operations that defaults to SodotError for the error type.