You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/dkg_verification.md
+56-16Lines changed: 56 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
### Purpose and Scope
6
6
7
-
This specification provides a detailed framework for zero-knowledge (ZK) verification circuits within a Distributed Key Generation (DKG) protocol. It emphasizes precise cryptographic formulations to ensure the correctness and security of each verification step.
7
+
This specification provides a framework for zero-knowledge (ZK) verification circuits within a Distributed Key Generation (DKG) protocol. It emphasizes cryptographic formulations to ensure the correctness and security of each verification step.
8
8
9
9
### Overview of Distributed Key Generation (DKG)
10
10
@@ -22,9 +22,7 @@ The protocol ensures that:
22
22
- The secret is generated according to Shamir's Secret Sharing scheme.
23
23
- Any deviation — whether intentional or accidental — can be detected, and the malicious participant can be identified. Zero-knowledge proofs play a crucial role in enabling this detection without revealing any sensitive information exchanged during the process.
24
24
25
-
## 2. DKG Process Overview
26
-
27
-
### 2.0 High-Level Overview of Provable Distributed Key Generation (PDKG)
25
+
## 2.0 High-Level Overview of Provable Distributed Key Generation (PDKG)
28
26
29
27
1.**Initialization (Public Setup Phase):**
30
28
One participant initializes the session by publishing the setup on a shared, publicly accessible platform (e.g., a blockchain smart contract, shared database, or bulletin board).
@@ -86,7 +84,7 @@ Where:
86
84
-\(a_{i,j} \in \mathbb{F}_q\): Random coefficients
87
85
-\(f_i(x)\): Secret polynomial of \(P_i\)
88
86
89
-
The secret share of participant \(P_i\) is \(s_i = f_i(0) = a_{i,0}\).
87
+
The secret sub share of participant \(P_j\) is \(s_{i,j} = f_i(j)\).
90
88
91
89
We define a verification vector \(\text{V}_i\) as:
@@ -101,7 +99,7 @@ Published to a public board and signed with \(\text{AuthKey}_i\).
101
99
Each \(P_i\) computes:
102
100
\[s_{i,j} = f_i(j)\]
103
101
104
-
Sends to \(P_j\) along with \(\text{V}_i\), all signed with \(\text{AuthKey}_i\). The verification vector \(\text{V}_i\) allows \(P_j\) to verify that the received share \(s_{i,j}\) is consistent with the polynomial committed to by \(P_i\).
102
+
Sends to \(P_j\) along with \(\text{V}_i\), all signed with \(\text{AuthKey}_i\). The verification vector \(\text{V}_i\) allows \(P_j\) to verify that the received share \(s_{i,j}\) is consistent with the polynomial committed to by \(P_i\) (\(P_i\) can take the \(C_i\) from the public board).
105
103
106
104
### 2.4 Share Verification
107
105
@@ -131,7 +129,21 @@ Upon receiving \(s_{i,j}\) and \(\text{V}_i\) from \(P_i\), participant \(P_j\)
131
129
132
130
If a participant submits a share that cannot be verified or if there is insufficient evidence to validate its correctness, and malicious intent is suspected, then participant \(P_j\) should initiate a **challenge** against \(P_i\) on the public board.
133
131
134
-
The challenge must include an expiration timestamp. The response to the challenge should be **encrypted using ECDH** (Elliptic Curve Diffie-Hellman) with the `AuthKey`s of both participants. Here, we assume `AuthKey_i` and `AuthPK_i` are the private and public keys, respectively, of an ECDH key pair for participant \(i\). The shared secret is derived using \(P_i\)'s private key and \(P_j\)'s public key (or vice versa), and this shared secret is used to encrypt the response. ECDH is suitable here as it allows two parties to establish a shared secret over an insecure channel using their public keys.
132
+
The challenge must include an expiration timestamp. The response to the challenge must be **encrypted using a deterministic ECDH scheme** based on the sender’s published verification vector.
133
+
134
+
Specifically:
135
+
136
+
- The verification vector \(\mathbf{V}_i\) (published by \(P_i\)) is **sorted deterministically**, for example, lexicographically by public key bytes.
137
+
- The **last element** of this sorted vector is used for key agreement:
138
+
-\(P_i\) uses the **private key** from their own last element.
139
+
-\(P_j\) uses the **public key** from the corresponding last element of \(P_i\)'s vector.
- This shared secret is passed through a key derivation function (e.g., HKDF) to obtain a symmetric key \(K_{\text{enc}}\).
145
+
146
+
This encryption scheme ensures that only the intended recipient (with access to the corresponding private key) can decrypt the response, while preserving deterministic behavior and cryptographic soundness necessary for verifiability and zero-knowledge applications.
135
147
136
148
If the challenge expires without a valid response, or if the response is invalid, the protocol can demonstrate misbehavior by \(P_i\), which may result in penalties (e.g., slashing). If the protocol fails, all participants can verify the failure based on the data recorded on the public board.
137
149
@@ -140,8 +152,8 @@ The use of encryption and zero-knowledge proofs guarantees that sensitive inform
140
152
### 2.5 Partial Key Generation
141
153
142
154
Each \(P_i\) computes their partial secret key \(S_i\) by summing the valid shares received from all other participants:
143
-
\[S_i = \sum_{k=1}^{n} s_{k,i}\]
144
-
where \(s_{k,i}\) is the share sent from \(P_k\) to \(P_i\).
155
+
\[S_i = \sum_{j=1}^{n} s_{j,i}\]
156
+
where \(s_{j,i}\) is the share sent from \(P_j\) to \(P_i\).
145
157
146
158
### 2.6 Finalization
147
159
@@ -211,19 +223,47 @@ Once all valid signatures are collected, any participant (or a subset thereof) c
211
223
212
224
### Circuit 3: Malicious Encryption Detection
213
225
214
-
-**Objective**: Verify that encrypted shares sent from \(P_i\) to \(P_j\) decrypt correctly and correspond to valid shares as per \(P_i\)'s committed polynomial.
226
+
-**Objective**:
227
+
Verify that an encrypted share sent from \(P_i\) to \(P_j\) can be correctly decrypted using a shared key derived via ECDH and that the resulting plaintext corresponds to a valid share consistent with \(P_i\)'s committed polynomial.
215
228
216
229
-**Verification Steps**:
217
-
1.**Key Derivation (ECDH)**:
218
-
The shared secret \(K_{i,j}\) between \(P_i\) and \(P_j\) is derived using Elliptic Curve Diffie-Hellman. \(P_i\) uses their private ECDH key \(\text{AuthKey}_i\) and \(P_j\)'s public ECDH key \(\text{AuthPK}_j\) to compute \(K_{i,j}\). Similarly, \(P_j\) uses their private key \(\text{AuthKey}_j\) and \(P_i\)'s public key \(\text{AuthPK}_i\) to compute the same shared secret.
230
+
231
+
1.**Deterministic Key Derivation via ECDH**:
232
+
- The vector \(\mathbf{V}_i\) is **sorted deterministically** (e.g., lexicographically by public key bytes).
233
+
- The **last element** of the sorted verification vector is used for key agreement:
234
+
- Participant \(P_i\) uses the **private key** from their own last element.
235
+
- Participant \(P_j\) uses the **public key** from the corresponding last element of \(P_i\)'s vector.
- The result is passed through a key derivation function (e.g., HKDF) to produce a symmetric key \(K_{\text{enc}}\) for encryption with a cipher like ChaCha20-Poly1305.
241
+
242
+
- This shared secret is used to derive a symmetric encryption key (e.g., via HKDF), which is then used with a cipher like ChaCha20 to encrypt:
243
+
- The generation id
244
+
- The share \(s_{i,j}\)
245
+
- The \(\text{HASH}(n, t, \text{generation\_id}, \mathbf{V}_i)\)
246
+
-\(\text{AuthPK}_i\)
247
+
-\(\text{SIGN(AuthPK, HASH)}\)
248
+
219
249
2.**Decryption and Share Extraction**:
220
-
The ciphertext containing the share \(s_{i,j}\) is decrypted using the derived shared secret \(K_{i,j}\) and the agreed-upon decryption algorithm.
-\(P_j\) uses the derived key to decrypt the ciphertext and extract the share \(s_{i,j}\) and accompanying data.
221
256
222
257
3.**Share Validation**:
223
-
Apply the same validation logic as in **Circuit 1** to accept or reject the decrypted share. This includes checking commitment consistency (using \(C_i\) and \(V_i\)) and verifying that the decrypted share \(s_{i,j}\) satisfies the expected polynomial evaluation: \(\text{PK}(s_{i,j}) \stackrel{?}{=} p_i(j)\).
258
+
- The circuit first proves that the correct decryption key was derived from the initial secrets using the specified ECDH protocol and verification vector.
259
+
- Then, two possible outcomes are evaluated:
260
+
1. If decryption fails (e.g., due to incorrect key derivation, incomplete or malformed ciphertext, or tampering), this constitutes a verifiable failure of proper encryption.
261
+
2. If decryption succeeds but the decrypted share is inconsistent with the committed polynomial (e.g., does not satisfy the homomorphic evaluation check), the logic from **Circuit 1** is applied to prove inconsistency or misbehavior in the share itself.
262
+
263
+
-**Expected Output**:
264
+
The circuit succeeds if the decrypted share can be verified as correct and consistent with the sender’s public commitments. Otherwise, it produces a verifiable contradiction, proving either encryption-level tampering or an invalid share.
265
+
224
266
225
-
-**Expected Output**:
226
-
The circuit fails if the decrypted share is invalid (doesn't match the committed polynomial) or inconsistent with the public commitments made by \(P_i\).
0 commit comments