Demystifying HybridDKG - A Distributed Key Generation Scheme
HybridDKG is one of the latest distributed key generation schemes and can operate in an asynchronous environment, making it the most viable DKG scheme to use over the internet.

Introduction
In a previous post, we discussed important VSS and DKG constructs and presented the Aggregatable DKG. Now that the reader better understands DKG, this article elaborates on a different DKG scheme called HybridDKG, as published in Distributed Key Generation in the Wild.
HybridDKG is a DKG that operates under the asynchronous communication model which is a much more realistic model than the synchronous model that most other DKG schemes rely on. Its underlying VSS, called HybridVSS, is based on AVSS, which is the component of HybridDKG that allows it to operate asynchronously. Since HybridDKG is operating under the asynchronous model, it requires both its VSS and DKG protocols to use consensus mechanisms in order for the nodes to agree on the secrets.
Assumptions
As with every cryptographic contruct, HybridDKG relies on certain assumptions in order to prove its security properties.
Communication model
HybridDKG uses the asynchronous model of communication, in which clocks of nodes may not be accurate (meaning they can be out of sync) and messages can be delayed for arbitrary period of time. In this model, it is assumed that the adversary manages the communication channels and can delay messages as it wishes. HybridDKG assumes that a real-world adversary cannot control communication channels for all the honest nodes and, thus, that the adversary (eventually) delivers all the messages between two uncrashed nodes.
A stricter assumption, named weak synchrony, is used only in order to prove the protocol's liveness. Under the weak synchrony assumption, the time difference between the time a message was sent () and the time it is received doesn't grow indefinitely over time. Weak synchrony is not necessary for the protocol's correctness.
It is also assumed that all communication is authenticated and the adversary is unable to spoof messages.
Faults
HybridDKG can tolerate non-byzantine node crashes, non-byzantine broken communication links and byzantine faults. It groups non-byzantine crashes and non-byzantine single broken communication links under the same fault type. The byzantine adversary is considered static, meaning that it cannot change its choice of nodes as time progresses.
The protocol can tolerate:
- Up to byzantine nodes
- Up to non-byzantine crashed nodes and non-byzantine failed connections at any given instant in time
- maximum number of crashes an adversary is allowed to perform during its lifetime
The number of the participants is:
Adversary
An assumption introduced by the specific polynomial commitment scheme used in this HybridVSS is that the adversary is computationally bounded on the DLP with a security parameter .
Prerequisites
We first list some mathematical properties that will be useful later on:
- To reconstruct a univariate polynomial of degree we need points on that polynomial
- Having a bivariate polynomial of degree , we can generate univariate polynomials by fixing the value of (or ):
- If the bivariate polynomial is symmetric, it holds that
- From the above we can derive that for a symmetric it holds
HybridVSS
In the asynchronous model, each node follows two assumptions: that enough nodes will get their shares and there will be enough nodes participating in reconstruction. In order to remove the need to make assumptions, HybridVSS takes it a step further and provides a mechanism for nodes to keep track of how many other nodes are participating and their states instead of relying on the above assumptions.
We will now define the sharing, reconstruction, and recovery phases of HybridVSS. All the messages described below are tagged with a unique session ID , with being the session's dealer and a unique number.
Sharing
Initialization
The dealer :
- produces a random symmetric bivariate polynomial with the secret encoded in as the constant factor .
- calculates a homomorphic commitment to the polynomial which is a matrix with . can be used by nodes to verify that:
- a given univariate polynomial belongs to by checking:
- a given value corresponds to by checking:
Dealing
then deals to each node a univariate polynomial by sending a message called . This message also delivers . is also sent with all other type of messages between nodes so that any two participants can verify the dealer’s commitment and prevent a malicious dealer from segregating the nodes by sharing different commitments.
Each that receives a , verifies using . This polynomial provides a way for to generate a point that belongs to the polynomial of another node since due to 's symmetry.
Gossip-based validation and consensus
Each that receives a valid message, sends a message called to each node to inform them of the fact that the dealer got in touch. carries as a proof that it was dealt a valid .
After sending to all nodes, enters a listening state, where it listens for two kinds of messages, and .
For every received from a node the receiver :
- verifies against and if verified, it stores the point in a set
- if enough () valid messages with the same commitment are received to convince that enough nodes were reached by the dealer, it uses the points in to interpolate a polynomial
- sends a to all other nodes carrying a point as a proof of the fact that it received enough s
For every received and verified , :
- stores the received point in the same set
- if enough () messages with the same commitment are received to be able to interpolate a polynomial of degree , interpolates
- sends a that carries to each node
- if enough messages () with the same commitment are received for to be convinced that enough nodes know that enough nodes are participating, it calculates its share and stops.
Additional notes
A node terminates the sharing process if it has received messages. Here, the node makes sure that there is a sufficient amount of honest nodes with shares. In other words, it makes sure that the participating honest nodes form a majority in the presence of up to byzantine adversaries and up to ff crashed nodes.
If a node received a from another node, it implies that the other node has sent an echo and it was never received. I.e., a implies an . It is possible for a node to finish the sharing phase by only receiving enough ready messages. In this case, it needs to interpolate in order to calculate its share, since the interpolation in processing didn't happen. This is the reason behind the interpolation step in processing a message.
An important note is that a node will only process the first , and messages it received from a specific node during a session . This is to make sure that:
- nodes' and counters cannot be manipulated by an adversary by repeating messages
- any recovery messages in circulation will not modify the systems state (this will become clear in the recovery subsection below)
Reconstruction
Let's first explain how the shares relate to the secret. The share of is , which means that given shares we can interpolate . We can then evaluate this polynomial to to get the secret .
To reconstruct the secret, each node sends its share to all other nodes using the message . It also listens for messages. For each received from a node , it will first verify against the commitment : and if the point is verified, it will store it. When the node has collected points, it is ready to interpolate and then obtain the secret .
Recovery
We denote ( is the system's security parameter) the maximum number of crashes an adversary is allowed to perform during its lifetime.
During recovery, the previously crashed node will ask the help of other nodes in replaying its previous communication. Each node keeps a record of all outgoing messages along with their intended recipients in a set , and indicates the subset of intended for the node . Additionally, each node maintains two counters and . The former tracks the number of overall (system-wide) help requests and the latter the number of help requests sent by each node .
A crashed node that just recovered will first send a message to all nodes. It will also replay messages in . When a node receives the message it will first make sure that the help limits are not exceeded: and and if these checks pass, it will replay all messages in , thus helping to replay the message history that is relevant to the recovered node.
With the above in mind we can see that, if recovery messages were to be processed, many, if not all, packet counters would count a recovered node twice.
HybridDKG
As with other DKG constructions, HybridDKG makes all nodes HybridVSS dealers. Each node generates a collection of shares from several HybridVSS instances and its final share will be the sum of those shares. Unlike DKGs operating in the synchronous setting, the asynchronous model introduces the requirement of agreement on at least successful HybridVSS instances for a set of honest nodes. An additional complexity of the asynchronous setting is the the need to differentiate between crashed and slow nodes.
HybridDKG introduces a role called leader (), which is responsible for making a proposal of a set of finished HybridVSS instances to be used. Since the leader might be malicious or crash, a leader-change mechanism is introduced. Nodes use timeouts to decide if a leader should be considered crashed.
HybridVSS is extended with a message, which is sent by every node that finishes the HybridVSS sharing phase. It carries all the messages for the session and signatures over them, which helps the leader to provide a validity proof of its proposal.
HybridDKG uses two phases, the optimistic and the pessimistic phase: the former is responsible for the key generation and is where crash recoveries take place; the latter is responsible for executing potential leader-change operations.
Optimistic phase
HybridVSS execution
The optimistic phase starts by each node becoming a dealer of a HybridVSS session for a secret . At the end of a HybridVSS session, each node broadcasts a message. The set includes signed messages for session , is the share of node and is its commitment. All nodes collect and of received messages:
VSS proposal
Once has processed messages, it will broadcast a message, proposing the set of VSS instances that these messages correspond to. This message is HybridDKG specific and not to be confused with the message of HybridVSS. carries which constitutes 's proposal on the set of HybridVSS instances to use. It also carries as a proof that the sessions referred by are valid.
Leader-change condition
Any node, apart from , that processed messages will start a local timer that stops after . If a node's timer stops before the node has reached the end of the protocol, the node assumes that the leader has either crashed or is malicious and requests a leader change. A leader-change request is performed by broadcasting a message. We defer explaining the leader-change logic until we finish the optimistic phase.
Gossip-based validation and consensus
All nodes, apart from , will start listening for , and messages. Again, these messages are HybridDKG specific and not to be confused with their synonymous HybridVSS. Conceptually though, these messages serve the same purposes as in HybridVSS.
An message is send upon receipt of a valid . The purpose of is to inform the receiver that the sender was reached by with a valid proposal. carries the proposed set .
A message is send by nodes that have received enough () messages for the same set or enough () messages for the same set . At this point, the node knows that the protocol can finish successfully, since it knows enough participating nodes and the message informs the receivers of that fact. The node will also update its set to , since at this point the set is agreed, and keep the relevant signed or messages as a proof. This update of the set serves as a note upon which VSS instances were agreed and is used during a leader change (more on that at the section explaining the pessimistic phase).
Shares construction
Finally, when a node receives enough () messages, it can finish the sharing protocol by calculating its share: and its commitment matrix, generated by the commitment matrices of each HybridVSS instance:
Pessimistic phase
A node enters this phase when it becomes unsatisfied with the current leader. The reasons for this dissatisfaction can be due to a time out or the receipt of an invalid message from the leader.
A predefined cyclic permutation of nodes is assumed to be agreed upfront. For simplicity, we will assume that leaders are sorted in a simple ascending order.
When entering this phase, the node will broadcast a message, called , informing other nodes that it proposes a leader change. The messages carries the proposed leader to which the nodes want to change. A dissatisfied node proposes the node that is next (in the ordering) of its current leader.
Two things need to be agreed between nodes: if the leader change is happening and, if so, which node will be the new leader.
A node that receives messages will be convinced that a leader change is happening and will broadcast a proposing the smallest proposed leader it received. If the node receives messages proposing the same leader, it will accept that leader since consensus on the leader is reached. Then, if the node is not the next leader, it will restart its counter and enter the optimistic mode.
In the case the node is the next leader, it will use the previously stored set as the VSS set to use. It will broadcast a message with this set and the accompanying signed packets (, or ) as a proof and then enter the optimistic mode.
Crash recovery
For recovery of a crashed node, the exact same approach with HybridVSS is used.
Reconstruction
Reconstruction of a HybridDKG secret is performed the same way as in HybridVSS. Each node broadcasts its share and collects shares from other nodes. When a node has collected enough shares, it will interpolate the corresponding polynomial and evaluate it at to calculate the secret.
Performance
HybridVSS
Assuming no crashes and thus no recovery messages: The size of HybridVSS messages is dominated by the size of the commitment which has group elements and thus the protocol's bit complexity is . An improvement exists that reduces the bit complexity down to by using a collision-resistant hash function (AVSS, Sec. 3.4). In the following calculations, we assume that this improvement is used. The message complexity is .
Taking into account the recovery messages, the message complexity becomes and the the bit complexity were .
HybridDKG
With up to VSS instances being able to complete and with no pessimistic phases taking place we have message complexity and bit complexity.
Counting in pessimistic phases, we have at most leader changing operations. Each leader change operation has message and bit complexity. Thus the overall overhead of the pessimistic phase is message and bit complexity.
Adding the pessimistic overhead to HybridDKG complexities, we end up with message and bit complexities.
Written by George Gkitsas, previously a zero-knowledge cryptography researcher & protocol developer at Heliax, the team building the Anoma Protocol.
If you're interested in zero-knowledge cryptography and cutting-edge cryptographic protocols engineering positions in Rust, check out the open positions at Heliax.