7 releases

0.3.0 Sep 5, 2024
0.2.2 Aug 13, 2024
0.2.1 May 23, 2024
0.1.3 Jan 20, 2024
0.1.0 Nov 28, 2023

#1546 in Cryptography

Download history 110/week @ 2024-08-10 11/week @ 2024-08-17 104/week @ 2024-08-31 21/week @ 2024-09-07 27/week @ 2024-09-14 8/week @ 2024-09-21 24/week @ 2024-09-28 2/week @ 2024-10-05

373 downloads per month

GPL-3.0 license

65KB
1.5K SLoC

    __________  ____  ___________              
   / ____/ __ \/ __ \/ ___/_  __/___  ________ 
  / /_  / /_/ / / / /\__ \ / / / __ \/ ___/ _ \
 / __/ / _, _/ /_/ /___/ // / / /_/ / /  /  __/
/_/   /_/ |_|\____//____//_/  \____/_/   \___/
-------------------------------------------------
Ed25519 Threshold Signature Database

Crates.io License: GPLv3

Introduction

FROSTore is a tool to prevent your Private Key from being compromised and used to sign data without your permission.

FROSTore allows you to use Ed25519 threshold signatures to bring distributed trust to your application. Keys generated by FROSTore are never combined into a single key, and are never stored on any single device. This means that even if a device is compromised, your private key is still safe.

Features

  • Create, store, and manage threshold signatures
  • Sign data with threshold signatures
  • Distributed Key Generation (DKG)
  • Customizable Minimum and Maximum thresholds

Example

A basic example of how to use FROSTore to generate a keypair (using DKG) and sign some data.

use frostore::*;

static TOTAL_PEERS: u16 = 3;
static MIN_THRESHOLD: u16 = 2;
static BOOT_NODES: [&str; 3] = [
    "/ip4/127.0.0.1/tcp/63888/p2p/12D3KooWDThDUUhDC2bi26E8LhHKsvLZq4wi7dNN5zypNVucgbqx",
    "/ip4/127.0.0.1/tcp/58521/p2p/12D3KooWEk8vk2vFp7qTbif7X5kjQGJorFThxu8LheTF22Ef2fRc",
    "/ip4/127.0.0.1/tcp/58560/p2p/12D3KooWDs3SvAP4pfQAdqse9AroqaAsxDuswV6iFkc6aAwJooVu",
];

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create the network client
    let mut swarm = Swarm::builder().build_and_exec()?;

    // Add the boot nodes to the client
    for boot_node in BOOT_NODES.iter() {
        let multiaddr: Multiaddr = boot_node.parse()?;
        eprintln!("Adding peer: {:?}", multiaddr);
        swarm.add_peer(multiaddr)?.await?;
    }
    eprintln!("Finished adding peers");

    // Generate a new keypair on the network
    let pubkey = swarm.generate(MIN_THRESHOLD, TOTAL_PEERS)?.1.await?;
    println!("Generated pubkey: {:?}", pubkey);

    // Sign some data
    let data = b"Hello, World!".to_vec();
    eprintln!("Signing data: {:?}", data);
    let signature = swarm.sign(pubkey, data.clone())?.1.await?;
    println!("Signature: {:?}", signature);

    // Verify the signature
    let valid = pubkey.verify(&data, &signature).is_ok();
    println!("Signature Valid: {}", valid);
    assert!(valid);
    Ok(())
}

We have provided a few more examples to help you get started. You can find them in the /examples/ directory.

For more information on how to use FROSTore, please check our docs.

Research

FROSTore is primarily based on the following research papers:

Dependencies

~18–55MB
~1M SLoC