frost-haskell
CopyrightVergara Technologies 2025
LicenseMIT
Maintainercontact@vergara.tech
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Frost.Sign

Description

This module contains the functions needed to perform a FROST signature ceremony with multiple participants. Any participant can act as the coordinator and signal the other participants to begin the ceremony by using generateCommits. The generated SigningCommitments need to be shared with the coordinator and each participant keeps their SigningNonces for the rest of the process.

The coordinator creates the SigningPackage using generateSigningPackage and distributes it to all participants. Participants should validate that the message in the SigningPackage is the message they intend to sign. The message should be validated by each participant.

Each participant signs the SigningPackage using sign and their respective key shard and then returns the SignatureShare to the coordinator.

The coordinator combines each participant's SignatureShare with the aggregate function to produce the full FROST Signature.

For more details, see the FROST book.

Synopsis

Documentation

generateCommits #

Arguments

:: KeyPackage

The private key shard for the participant

-> Maybe SigningPkgR1 

Generates the SigningNonces and SigningCommitments for the first round of signing

generateSigningPackage #

Arguments

:: Text

The message to sign

-> [SignPayload]

A list of the participants' commitments and their corresponding Identifiers

-> PublicKeyPackage

The public key package created by the key generation ceremony

-> Maybe SigningPkgR2 

Generates the signing package required to create SignatureShares on the next round

getMessage #

Arguments

:: SigningPackage

The signing package created by the coordinator

-> Maybe ByteString 

Extracts the message used in the SigningPkgR2

sign #

Arguments

:: SigningPackage

The signing package created by the coordinator

-> SigningNonces

The signing nonces created by the participant during the first round

-> KeyPackage

The participant's secret key shard

-> Randomizer

The randomizer used by the coordinator to create the signing package

-> Maybe SignatureShare 

Signs the SigningPackage provided by the coordinator with the participant's key shard

aggregate #

Arguments

:: SigningPackage

The signing package created by the coordinator

-> [AggregatePayload]

The list of SignatureShares and their corresponding Identifiers

-> PublicKeyPackage

The public key package created by the key generation ceremony

-> Randomizer

The randomizer used by the coordinator to create the signing package

-> Maybe Signature 

Aggregates the participants' SignatureShares into a full FROST signature

verify #

Arguments

:: PublicKeyPackage

The public key package created by the key generation ceremony

-> ByteString

The message that was signed

-> Signature

The FROST signature to validate

-> Randomizer

The randomizer used by the coordinator to create the signing package

-> Bool 

Verify a FROST signature