Consider a group of D
nodes that together run the DKG. We assign a unique index i ∈ [0, 1, ..., D-1]
to each node (according to the canonical ordering from the Protocol State).
<aside>
💡 We explicitly consider the case where some DKG participants are actively malicious, trying to undermine the DKG protocol. The DKG protocol is designed to handle this as long as the number of malicious participants is below a fixed threshold. Currently, we have fixed that threshold to a protocol constant t = floor((n-1)/2)
</aside>
Hence, we assume (axiom) that the following conditions are satisfied:
t
t+1
honest participantsDKG requires two distinct channels of communication:
t
malicious actors.t+1
honest participants to agree on the final results (otherwise, the upcoming threshold signature/random beacon halts). This is only possible if at least t+1
honest participants are able to read the broadcast messages.t+1
honest participants to read every broadcast message consistently (2 participants must not get a different version of the same message).There are three phases of message exchange (involving 1-to-1 communication as well as posting to and reading from the whiteboard). For details, see Distributed Key Generation API .
After the three phases of message exchange, all nodes locally compute
For D
DKG nodes, we define the vector PublicKeys
as
crypto.PublicKey
)PublicKeys
holds D+1
elements:
PublicKeys[i]
is the public keys share for DKG participant with index i ∈ [0, 1, ..., D-1]
PublicKeys[D]
is the GroupPublicKeyEach node saves its own DKG private key share to a secure location (local disk is fine).
Each node now posts the PublicKeys
it locally computed to the whiteboard.
PublicKeys
vectors might be posted by malicious participants.The DKG smart contract
must now identify the PublicKeys
vector which from the honest participants. We assume that honest participants are strictly larger than t
. Therefore, the DKG smart contract
can simply count which PublicKeys
vector got posted at least t+1
times, which then has to be the one from the honest participants (this is guaranteed by the current value of t
). If such a vector exists, it is unique (with the current t
value).
If no PublicKeys vector has reached a count of t+1
then the DKG has failed and an error needs to be returned.
DKG smart contract
includes the single PublicKeys
vector from the honest participants in the EpochCommitted
system event (see Epoch Preparation Protocol)
The last step completes the DKG
Broadcast messages are implemented in the DKG smart contract. The DKG protocol requires that, for a given phase, whiteboard messages are reliably and consistently delivered to all nodes. Messages may be received in any order within a phase.
A DKG node must be able to guarantee it has received all the messages of a phase to be able to determine that phase has ended. For each epoch, the epoch smart contract determines in advance the point at which each phase ends, defined in terms of a consensus view. These are emitted in the EpochSetup service event as DKGPhase1FinalView
and so on.
The DKG contract does not differentiate between messages based on the DKG phase they are part of. (⚠️ This is a change from a previous specification ⚠️)
Each DKG instance is uniquely identified by a DKG ID, composed of the chain ID of the Flow instance it is running in and the epoch counter of the epoch for which the DKG is being computed (not the current epoch while the DKG is running!). All messages must include this ID to prevent replay attacks from other DKG instances.