#threshold-signature #schnorr-signature #signature-scheme #frost

bin+lib wtfrost

Weighted Threshold implementation of FROST, a Schnorr aggregated threshold signature scheme

5 releases (3 major breaking)

4.0.0 Apr 3, 2023
3.0.0 Feb 27, 2023
2.0.0 Feb 15, 2023
1.0.1 Feb 13, 2023
1.0.0 Feb 9, 2023

#2563 in Cryptography

Apache-2.0

68KB
1.5K SLoC

WTFROST

ci crates.io

FROST is a system for making Flexible Round Optimized Schnorr Threshold signatures. It allows a group of N parties, each of whom controls a single key, to make a valid Schnorr signature, as long as T (the threshold) of them complete the protocol honestly. While there are many other threshold signature schemes, FROST has several features which make it particularly useful in a cryptocurrency context.

First, it is optimized for a small number of rounds in the common case where there are no byzantine actors present. Since the protocol allows detection any bad actors in the system, it makes sense to optimize for the case where there are none. Such byzantine actors can be sanctioned in a way that severely disincentivezes attempts to subvert the protocol.

Second, in contrast to typical multisig protocols, FROST produces a single aggregate signature which is indistinguisable from a standard Schnorr signature. Crucially, this signature can be verified the same way as any Schnorr signature. And since the signature is aggregated, it does not take any more space on chain than any other standard signature, and linearly less than traditional multisig signatures.

Variants

This crate provides a vanilla implementation of FROST in the v1 module, where each Party controls a single key. v1 also contains code which wraps a number of parties into a single Signer object. This allows FROST to function not only as a threshold scheme, but also a weighted threshold scheme. Each Signer is given a set of key_ids, and acts as all of the wrapped parties in the protocol. So in PoS style systems, where different actors will have power proportional to the size of their stakes, each v1::Signer will be able to vote proportionally to the number of keys it controls.

This crate also contains a version of FROST optimized for the weighted threshold scenario in the v2 module. We call this WTF, or Weighted Threshold FROST. Like vanilla FROST, WTF keeps a single polynomial and nonce for each Party, but allows each Party to control multiple keys. This allows for order-of-magnitude reductions in data size and number of messages for the distributed key generation (DKG) and signing parts of the protocol.

p256k1

This crate uses the Bitcoin secp256k1 curve. But since the C libsecp256k1 library only provides high level interfaces for operations used by Bitcoin, it was necessary to directly expose the scalars and curve points to allow arbitrary mathematical operations outside of sign/verify. So we provide a wrapper crate around libsecp256k1 which wraps the internal interfaces to scalars and points. We call this crate p256k1, to denote that it is not only the same curve as secp256k1, but also exposes the curve directly.

Documentation

How to download the WTF paper using CLI

  • List recent CI runs and grab the latest run ID
    gh run list -R Trust-Machines/frost
    
  • Download the wtf.pdf artifact
    gh run download 4246650808 -R Trust-Machines/frost -n wtf.pdf
    

Dependencies

~8–12MB
~187K SLoC