Code Monkey home page Code Monkey logo

frost's Introduction

ZF FROST (Flexible Round-Optimised Schnorr Threshold signatures)

CI

Crate Crates.io Documentation
Generic FROST implementation [frost-core] crates.io Documentation
Ristretto255 ciphersuite [frost-ristretto255] crates.io Documentation
Ed25519 ciphersuite [frost-ed25519] crates.io Documentation
Ed448 ciphersuite [frost-ed448] crates.io Documentation
P-256 ciphersuite [frost-p256] crates.io Documentation
secp256k1 ciphersuite [frost-secp256k1] crates.io Documentation
Generic Re-randomized FROST [frost-rerandomized] crates.io Documentation

Rust implementations of 'Two-Round Threshold Schnorr Signatures with FROST'.

Unlike signatures in a single-party setting, threshold signatures require cooperation among a threshold number of signers, each holding a share of a common private key. The security of threshold schemes in general assume that an adversary can corrupt strictly fewer than a threshold number of participants.

'Two-Round Threshold Schnorr Signatures with FROST' presents a variant of a Flexible Round-Optimized Schnorr Threshold (FROST) signature scheme originally defined in FROST20. FROST reduces network overhead during threshold signing operations while employing a novel technique to protect against forgery attacks applicable to prior Schnorr-based threshold signature constructions.

Besides FROST itself, this repository also provides:

Getting Started

Refer to the ZF FROST book.

Status โš 

The FROST specification is not yet finalized, though no significant changes are expected at this point. This code base has been partially audited by NCC, see below for details. The APIs and types in the crates contained in this repository follow SemVer guarantees.

NCC Audit

NCC performed an audit of the v0.6.0 release (corresponding to commit 5fa17ed) of the following crates:

  • frost-core
  • frost-ed25519
  • frost-ed448
  • frost-p256
  • frost-secp256k1
  • frost-ristretto255

This includes key generation (both trusted dealer and DKG) and FROST signing. This does not include rerandomized FROST.

The parts of the Ed448-Goldilocks dependency that are used by frost-ed448 were also in scope, namely the elliptic curve operations.

All issues identified in the audit were addressed by us and reviewed by NCC.

Usage

frost-core implements the base traits and types in a generic manner, to enable top-level implementations for different ciphersuites / curves without having to implement all of FROST from scratch. End-users should not use frost-core if they want to sign and verify signatures, they should use the crate specific to their ciphersuite/curve parameters that uses frost-core as a dependency.

frost's People

Contributors

chelseakomlo avatar conradoplg avatar dconnolly avatar dependabot-preview[bot] avatar dependabot[bot] avatar dufkan avatar dvc94ch avatar hdevalence avatar jackgavigan avatar mimoo avatar mpguerra avatar natalieesk avatar oxarbitrage avatar pacu avatar rex4539 avatar stackoverflowexcept1on avatar str4d avatar teor2345 avatar upbqdn avatar wangcundashang avatar zancas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frost's Issues

Frost Work

All things related to frost merged into one epic for tracking purposes

Refactor into common traits (frost-core)

Generic to groups where we define a cofactor (1 or other) and the order of the prime order group, so that we can share common logic across multiple impls / parameter sets.

Rename `frost::keys::{Secret, Public}`to indicate signing participants' shares, not full keys.

These are the signing pariticipant's secret share and corresponding public key, as opposed to the "full signature" signing key and verifying key. We have another type called SecretShare that has more metadata, hence not being named such, but we probably should rename them for clarity. This is somewhat low priority while the frost-core API remains unstable (by SemVer standards).

`frost-secp256k1`: implement FROST on Secp256k1 curve

  • Duplicate frost-ristretto255 framework
  • Pull in RustCrypto/secp256k1, not the C one
  • Implement concrete FrostSecp256k1 implementation of Ciphersuite
  • Pull test vectors from draft-irtf-cfrg-frost
  • Release frost-secp256k1

Construct a test case where t-1 participants collude, 1 remains honest

Ideas:

  • can't extract honest participant's secret share
  • can't deduce group secret signing key
  • can't forge signature (EUF-CMA)
  • can't forge colliding signature (SUF-CMA)
  • can't forge/malleate signature to verify under !the group verification key (key substitution)

Show that any/all of these can be achieved with t colluding participants, then show that it fails with t-1 colluding participants.

Rename participant indexes to participant identifiers or IDs

We now have an Identifier type that wraps a Scalar field element, for polynomial id's, that is much harder to confused than an index into any data structure that may also have an index, like an array.

  • Update all usage of participant ID's to be Identifier in frost-core
  • Check the public API of frost-core to make sure all those are using Identifier
  • Check all known consumers of public frost-core API to upgrade them to use Identifier where needed
  • If any API changes are made, publish releases of those crates

FROST Extensions

This Epic will track any extensions in functionality not currently included in the IETF draft

Tasks

  • Implement message serialization
  • Implement DKG
  • Implement ability for any signing participant to act as an aggregator
  • Share redistribution- allow t signers to add/remove new members and ratchet forward the secret for forward secrecy

feature: Share redistribution - allow t signers to add new members and repair a user share

Motivation

We want to be able to:

  • Repair a user share (recompute it if it's lost)
  • Add new signers - Just "recover" the share of the new user (e.g. using its identifier)

Design

  • Implement the Enrolment scheme from https://eprint.iacr.org/2017/1155.pdf
    (or the Reduced Enrolment scheme; evaluate which one is better)
  • Like the rest of the FROST implementation, communication is up to the caller, so we just want to provide functions to repair and add signers
  • Write a test, e.g. simulating the communication using a HashMap

Preliminary design of functions to be implemented:


- helpers: Set of identifiers (signers that will help recover)
- requester: The identifier of the signer that lost their share


# For every single helper i in helpers:

# i: the identifier of the signer helping
# helpers: as above
# share_i: i's secret share
# zeta_i: Lagrange coefficient (?)
# - Note: may be able to be computed inside the function, check
# Output: i_deltas: random values that sum up to zeta_i * share _i
compute_random_values(i, helpers, share_i, zeta_i) -> deltas_i

# Communication round:
# Helper i sends deltas_i[j] to helper j

# j: the identifier of the signer helping
# helpers: as above
# deltas_j: values received by j in the communication round
# Output: sigma_j
compute_sum_of_random_values(j, helpers, deltas_j) -> sigma_j

# Communication round
# Helper j sends sigma_j to signer r

# sigmas: all sigma_j received from each helper j
# Output: share_r: r's secret share
recover_share(sigmas) -> share_r

Specifications

See https://github.com/chelseakomlo/talks/blob/master/2019-combinatorial-schemes/A_Survey_and_Refinement_of_Repairable_Threshold_Schemes.pdf

feat: add P-256 support

We want to support all curves defined in the spec.

  • Create frost-p256 library crate
  • Pull in p256 crate: https://docs.rs/p256/latest/p256/
  • Pull in the sha2 crate
  • Pull in frost-core
  • Implement Ciphersuite and all dependent types and methods for a P256Sha256 type
  • Pull in test vectors from spec/spec repo in json form
  • Port/adapt code from frost-ristretto255 to parse and produce instances of types for P256Sha256 types
  • Test against test vectors (
    fn check_sign_with_test_vectors() {
    )
  • Test that secret sharing and reconstruction works (
    fn check_share_generation_ristretto255_sha512() {
    )
  • Test signing from a fresh keygen by dealer (
    fn check_sign_with_dealer() {
    )
    - [ ] Create frost-p256 crate on crates.io
    - [ ] Publish?

Publish as part of #79 when frost-core is updated, etc

Refactor into `round1`, `round2` modules

Allows us to namespace types by their round, allowing us to enforce things like "only commitments generated in Round 1 are used to check signature shares in Round 2"

`frost-core`: update for spec version 5

v5: https://www.ietf.org/archive/id/draft-irtf-cfrg-frost-05.html

From the spec changelog:

  • Update test vectors to include version string
    • Rename THRESHOLD_LIMIT to MIN_SIGNERS (this will be automatically done when updating test vectors; the code doesn't read that field so no further changes are needed)
  • Use non-contiguous signers for the test vectors
  • Add a function to generate nonces (#182)
    - [ ] Add MUST that all participants have the same view of VSS commitment
  • Use THRESHOLD_LIMIT instead of t and MAX_SIGNERS instead of n
    - [x] Remove wire format section (#156)
  • Update group commitment derivation to have a single scalarmul
  • Use RandomNonzeroScalar for single-party Schnorr example (this should not be needed if we use nonce_generate instead)

Draft a ZIP document for using FROST in the re-randomized SpendAuth setting in Zcash

We implemented FROST for redjubjub (and later ported to redpallas inside the zebra/zebra-chain repo) long ago, and while all that code needs to be updated to match the spec now, the goal was to slot that into the SpendAuth signature for Zcash Sapling and now Orchard.

There are notes for a re-randomized FROST signatures (at least in the Zcash setting) security proof that need to be completed to support the properties we need to preserve for Zcash and for FROST, but we should get started on a ZIP that defines the Jubjub and Pallas ciphersuites for Zcash usage, just like they are specified in the IETF spec, and how we think the re-randomization should work (pending verification by the security proof), and how this fits into the Sapling and Orchard key derivation trees.

We can draft that ZIP here and when we feel it is ready for Zcash consideration, move it the ZIPs repo and link to any final state of it from here.

We should also of course in frost-redjubjub and frost-redpallas include examples of how the re-randomization is done, and in Zebra code likely, call frost-redjubjub / frost-redpallas as part of keygen and signing operations, at least as an example/test.

frost-core: Implement the generic DKG

Implement the distributed key generation in frost-core, generic over the ciphersuite.

  • Implement generic DKG
  • Release minor version update for frost-core

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.