Why threshold ECDSA is trickier than it looks
This post is based on CGGMP24 (IACR 2021/060), an $n$-of-$n$ threshold ECDSA scheme1. The idea for threshold ECDSA is that each party $\mathbf{P}_1, \mathbf{P}_2, \dots, \mathbf{P}_n$ owns a secret key share, and they can collaboratively come up with an ECDSA signature, without leaking their secret, as long as the threshold is reached.
We will use an elliptic curve parameterized by $(\mathbb{G}, G, q)$ (the curve group, a generator and the curve order) for ECDSA. Let $m$ be the message2, $x$ be the private key and $k$ be a random nonce in $\mathbb{F}_q$. The signature, $(r, s)$, is given by
$$ \left\{\begin{aligned} & R = k \cdot G \\ & s = k^{-1} \cdot (m + r \cdot x)\ \text{mod}\ q, \end{aligned}\right. $$where $r$ is the $x$-coordinate of $R$.
Now, given that party $i$ (namely, $\mathbf{P}_i$) has a private key share $x_i$ and generates a nonce share $k_i$, such that
$$ x = \sum_i x_i \quad \text{and} \quad k = \sum_i k_i. $$CGGMP uses the inverse nonce technique, i.e., replace $k$ by $k^{-1}$:
$$ \left\{\begin{aligned} & R = k^{-1} \cdot G \\ & s = (k \cdot m + r \cdot k \cdot x)\ \text{mod}\ q. \end{aligned}\right. $$Problem: How do we compute $k^{-1} \cdot G$? We will introduce another random value, $\gamma$ with $\gamma = \sum_j \gamma_j$ and $\mathbf{P}_i$ has its share $\gamma_i$. Rewrite $R = (k \cdot \gamma)^{-1} \cdot (\gamma \cdot G)$.
Eventually, the relations are
$$ \left\{\begin{aligned} & R = ({\color{#ff7b72}k \cdot \gamma})^{-1} \cdot (\gamma \cdot G) \\ & s = (k \cdot m + r \cdot {\color{#ff7b72}k \cdot x})\ \text{mod}\ q. \end{aligned}\right. $$Even if the parties are semi-honest, in that they will faithfully follow the protocol while learning from the transcript, $k \cdot \gamma$ and $k \cdot x$ are still non-trivial to compute. Here we introduce the Multiplicative-to-Additive (MtA) protocol.
The MtA protocol
Alice owns $a$ and Bob owns $b$ with $a, b \in [0, q)$, where $q \approx 2^\ell$. Suppose that they want to collaboratively compute $a \cdot b \ \text{mod} \ q$ without learning the other party's share.
What is $q$? In our case, $q$ is the curve order of ECDSA. We use secp256k13 and thus $\ell = 256$.
CGGMP uses Paillier cryptosystem for MtA. Alice owns the key, and denote the modulus by $N$. Denote also $\textsf{Paillier}.\textsf{Encrypt}_N(x, \rho) := (1 + N)^x \cdot \rho^N \ \text{mod}\ N^2 \in \mathbb{Z}_{N^2}^*$ be the ciphertext of message $x \in \mathbb{Z}_N$ and nonce $\rho \in \mathbb{Z}_N^*$.
With the MtA protocol below, Alice and Bob own $\alpha$ and $\beta$ with $a \cdot b \equiv \alpha - \beta \ (\text{mod}\ q)$.
In most literature, one will use $a \cdot b = \alpha + \beta$ to show the multiplicative to additive conversion. We will use $\alpha - \beta$ to prevent underflowing values from Paillier.
Meaning of $c'$ in Bob's calculation $c' = \textsf{Paillier}.\textsf{Encrypt}_{N}(a \cdot b + \beta, r^b \cdot r')$. Made possible by the homomorphic properties of Paillier cryptosystem. Concretely,
- Alice computes $c := (1 + N)^a \cdot r^N\ \text{mod}\ N^2$.
- Bob computes $c' := c^b \cdot [(1 + N)^\beta \cdot {r'}^N]\ \text{mod}\ N^2$.
Finally, Alice obtains her share $\alpha = (a \cdot b + \beta) \ \text{mod}\ q$, and Bob has $\beta$.
[!NOTE] A note on the sizes of $N$ and $\ell'$ Note that the modulus $N$ should be significantly larger than $q$ (so as not to overflow). Additionally, $\ell' := 5 \cdot \ell$ is chosen to ensure $\beta$ is large enough that Alice cannot learn $b$ from $\alpha$. In Fireblocks' implementation as well as suggested in appendix C.1 of the CGGMP paper, $\ell = 256$4, $\ell' = 1280$5 and $N$ is of 2048 bits6.
In a multi-party scenario, where the parties $\mathbf{P}_1, \mathbf{P}_2, \dots, \mathbf{P}_n$ want to compute
$$ a \cdot b = \sum_j a_j \cdot \sum_j b_j, $$where $\mathbf{P}_i$ has $a_i$ and $b_i$. They will need $\mathcal{O}(n^2)$ MtAs to compute $a \cdot b$:
For each distinct $i, j \in \{1, ..., n\}$, $\mathbf{P}_i$ and $\mathbf{P}_j$ will go through MtA to compute $a_i \cdot b_j$. After that $\mathbf{P}_i$ and $\mathbf{P}_j$ will respectively have $\alpha_{ij}$ and $\beta_{ji}$ with $a_i \cdot b_j = \alpha_{ij} - \beta_{ji}$.
When $\mathbf{P}_i$ completes the $2n-2$ MtAs, it computes $\delta_i$ given by
$$ \delta_i := a_i \cdot b_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij}), $$then finally broadcasts $\delta_i$. After that, one can get $a \cdot b\ \text{mod}\ q$ by computing $\sum_j \delta_j\ \text{mod}\ q$.
Below is an example with three parties, $\color{#f07178}\mathbf{P}_1$, $\color{#c3e88d}\mathbf{P}_2$ and $\color{#82aaff}\mathbf{P}_3$, on what each of them has after the MtA, and how they could obtain $a \cdot b$ collaboratively:
| $\color{#f07178}a_1$ | $\color{#c3e88d}a_2$ | $\color{#82aaff}a_3$ | |
|---|---|---|---|
| $\color{#f07178}b_1$ | $\color{#f07178}a_1 \cdot b_1$ | ${\color{#c3e88d}\alpha_{21}} - {\color{#f07178}\beta_{12}}$ | ${\color{#82aaff}\alpha_{31}} - {\color{#f07178}\beta_{13}}$ |
| $\color{#c3e88d}b_2$ | ${\color{#f07178}\alpha_{12}} - {\color{#c3e88d}\beta_{21}}$ | $\color{#c3e88d}a_2 \cdot b_2$ | ${\color{#82aaff}\alpha_{32}} - {\color{#c3e88d}\beta_{23}}$ |
| $\color{#82aaff}b_3$ | ${\color{#f07178}\alpha_{13}} - {\color{#82aaff}\beta_{31}}$ | ${\color{#c3e88d}\alpha_{23}} - {\color{#82aaff}\beta_{32}}$ | $\color{#82aaff}a_3 \cdot b_3$ |
- $\mathbf{P}_1$ computes $\delta_1 := a_1 \cdot b_1 + \alpha_{12} + \alpha_{13} - \beta_{12} - \beta_{13}$,
- $\mathbf{P}_2$ computes $\delta_2 := a_2 \cdot b_2 + \alpha_{21} + \alpha_{23} - \beta_{21} - \beta_{23}$, and
- $\mathbf{P}_3$ computes $\delta_3 := a_3 \cdot b_3 + \alpha_{31} + \alpha_{32} - \beta_{31} - \beta_{32}$.
After all, $a \cdot b \equiv (a_1 + a_2 + a_3) \cdot (b_1 + b_2 + b_3) \equiv \delta_1 + \delta_2 + \delta_3\ (\text{mod}\ q)$.
For CGGMP, the party $\mathbf{P}_i$ initiates two MtAs with $\mathbf{P}_j$ to compute $k_i \cdot \gamma_j$ and $k_i \cdot x_j$. From the two MtAs, $\mathbf{P}_i$ gets $\alpha_{ij}$ and $\hat\alpha_{ij}$, and $\mathbf{P}_j$ gets $\beta_{ji}$ and $\hat\beta_{ji}$ such that
$$ \left\{\begin{aligned} & \alpha_{ij} - \beta_{ji} = k_i \cdot \gamma_j \\ & \hat\alpha_{ij} - \hat\beta_{ji} = k_i \cdot x_j. \end{aligned}\right. $$Then $\mathbf{P}_i$ computes
$$ \left\{\begin{aligned} & \delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q \\ & \chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q. \end{aligned}\right. $$CGGMP, the semi-honest protocol
This is what $\mathbf{P}_i$ does in the semi-honest setting:
$\textsf{CGGMP}.\textsf{KeyGenV1}$- Generate $x_i \in \mathbb{F}_q$, compute $X_i := x_i \cdot G$.
- Generate a Paillier key $N_i$ and keep the private key.
- Broadcast $(X_i, N_i)$.
The public key is $X := \sum_j X_j$.
$\textsf{CGGMP}.\textsf{SignV1}$- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$ and $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- Broadcast $({\color{#ffb454}\Gamma_i}, K_i)$.
- Round 2. For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$ and $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$.
- Send $(D_{ji}, \hat D_{ji})$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\delta_i}$.
- Round 4.
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \sum_j \Gamma_j$ and denote its x-coordinate by $r$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
After the five rounds, an observer could compute the signature $(r, s)$ for message $m$:
$$ \left\{\begin{aligned} & R = \left(\sum_j \delta_j\right)^{-1} \cdot \sum_j \Gamma_j \\ & s = \sum_j \sigma_j \ \text{mod} \ q \end{aligned}\right. $$The parties are no longer semi-honest
Some parties are now malicious and they no longer faithfully follow the protocol. To make sure the parties are following the protocol as intended, CGGMP requires the parties to provide commitments and/or zero-knowledge proofs for things that could go wrong.
CGGMP addresses the few issues that would lead to either unattributable denial-of-service or key leaks. We assume that $\mathbf{P}_i$ is one of the malicious parties below.
Issue 1: In round 1, $\mathbf{P}_i$ waits for $\Gamma_j$ ($j \neq i$) from everyone, then adaptively computes and broadcasts $\Gamma_i$ to their liking. Impact: $\mathbf{P}_i$ could send $\Gamma_i := -\sum_{j \neq i} \Gamma_j$ and make $\Gamma = O$ (i.e., the additive identity). This would make $R = O$ which the verifier should always reject.
CGGMP addresses this issue by making $\mathbf{P}_i$ broadcast $B_i$ (an ElGamal commitment of $\gamma_i$) in round 1, and defer $\Gamma_i$ to round 2. $\mathbf{P}_i$ also sends a ZKP in round 2, $\psi_i$ to prove $\Gamma_i$ is consistent with $B_i$.
What is $\Pi^\textsf{elog}$? $\Pi^\textsf{elog}$ is the zero-knowledge proof showing the relation
$$ R_\textsf{elog} = \{(\underbrace{X, H}_\text{dlog}, \underbrace{B, Y}_\text{ElGamal}; x, \alpha) \ | \ X = x \cdot H \wedge B = (\alpha \cdot G, x \cdot G + \alpha \cdot Y) \}. $$Intuitively, it proves that $X = {\color{#ffb454}x} \cdot H$ and $B = \textsf{ElGamal}.\textsf{Encrypt}({\color{#ffb454}x}, \alpha)$ share the same ${\color{#ffb454}x}$.
There are two functions associated with $\Pi^\textsf{elog}$ (and the future ZKPs), - $\Pi^\textsf{elog}.\textsf{Prove}((X, H, B, Y), (x, \alpha))$ which generates a zero-knowledge proof $\psi$, and - $\Pi^\textsf{elog}.\textsf{Verify}((X, H, B, Y), \psi)$ which verifies the generated proof.
$\mathbf{P}_i$ uses $\Pi^\textsf{elog}$ to generate $\psi_i$ in CGGMP, to convince the other parties that $\Gamma_i$ uses the same $\gamma_i$ as $B_i$ without revealing it.
- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$, $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Sample $Y_i \in \mathbb{G}$ and $b_i \in \mathbb{F}_q$.
- Compute $B_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(\gamma_i, b_i)$.
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- Broadcast $($${\color{#ffb454}\Gamma_i},$$ K_i,$$Y_i, B_i$$)$.
- Round 2.
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $\psi_i := \Pi^\textsf{elog}.\textsf{Prove}((\Gamma_i, G, B_i, Y_i), (\gamma_i, b_i))$.
- For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$ and $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$.
- Send $($${\color{#ffb454}\Gamma_i},$ $D_{ji}, \hat D_{ji}$$, \psi_i$$)$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$, verify that $\Pi^\textsf{elog}.\textsf{Verify}((\Gamma_j, G, B_j, Y_j), \psi_j) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\delta_i}$.
- Round 4.
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \sum_j \Gamma_j$ and denote its x-coordinate by $r$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
Issue 2a: In round 2, the $\gamma_i$ used to compute $D_{ji}$ might be different from the one that is used to compute $\Gamma_i$. Impact: A malicious party can fail the signing process and the culprit couldn't be identified.
CGGMP addresses this issue by introducing the ZKP, $\Pi^\textsf{aff-g}$, to show that $D_{ji}$ is correctly computed using the same $\gamma_i$ as $\Gamma_i$. To make this happen, $\textsf{CGGMP}.\textsf{KeyGen}$ also generates the Pedersen parameters.
What is $\Pi^\textsf{aff-g}$? $\Pi^\textsf{aff-g}$ is another zero-knowledge proof showing the relation
$$ \begin{aligned} R_\textsf{aff-g} = \{(\textsf{PUB}, D, K, F, X; x, y, r, \rho) \ | & \ D = K^x \cdot (1 + N_0)^y \cdot r^{N_0} \ \text{mod}\ N_0^2 \\ & \quad \wedge F = (1 + N_1)^y \cdot \rho^{N_1}\ \text{mod} \ N_1^2 \\ & \quad \wedge X = x \cdot G \}. \end{aligned} $$Here $\textsf{PUB} = (N_0, N_1, \hat N, s, t)$, where $N_0$ and $N_1$ respectively are the Paillier moduli for the verifier and the prover, and $(\hat N, s, t)$ are the Pedersen parameters with $s, t \in \mathbb{Z}_{\hat N}^*$ and $s \in \langle t \rangle$. The Pedersen parameters will be generated by the verifier to make sure that the provers could not forge a proof.
The goal of the proof is to show that if $K = \textsf{Paillier}.\textsf{Encrypt}_{N_0}(u, s')$, then $D = \textsf{Paillier}.\textsf{Encrypt}_{N_0}({\color{#f07178}x} \cdot u + {\color{#82aaff}y}, s'^{\color{#f07178}x} \cdot r)$, and that the $\color{#f07178}x$ and $\color{#82aaff}y$ used are the same as those in $X = {\color{#f07178}x} \cdot G$ and $F = \textsf{Paillier}.\textsf{Encrypt}_{N_1}({\color{#82aaff}y}, \rho)$. Note that the prover does not know the plaintext for $K$, as $K$ is computed by the verifier.
This shows that the prover knows $x$ and $y$ and correctly uses them to compute $D$.
- Generate $x_i \in \mathbb{F}_q$, compute $X_i := x_i \cdot G$.
- Generate a Paillier key $N_i$ and keep the private key.
- Generate Pedersen parameters $(\hat N_i, s_i, t_i)$:
- Generate the modulus $\hat N_i$ which is a product of two primes.
- Sample $t_i \in \mathbb{Z}_{\hat N_i}^*$ and $\lambda_i \in \mathbb{Z}_{\phi(\hat N_i)}$.
- Compute $s_i := t_i^{\lambda_i}\ \text{mod}\ \hat N_i$.
- Broadcast $(X_i, N_i, $ $\hat N_i, s_i, t_i$ $)$.
The public key is $X := \sum_j X_j$.
$\textsf{CGGMP}.\textsf{SignV3}$- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$, $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Sample $Y_i \in \mathbb{G}$ and $b_i \in \mathbb{F}_q$.
- Compute $B_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(\gamma_i, b_i)$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- Broadcast $(K_i, Y_i, B_i)$.
- Round 2.
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $\psi_i := \Pi^\textsf{elog}.\textsf{Prove}((\Gamma_i, G, B_i, Y_i), (\gamma_i, b_i))$.
- For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$, $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$ and $r_{ij} \in \mathbb{Z}_{N_i}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$ and $F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\beta_{ij}, r_{ij})$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$.
- Compute $\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, D_{ji}, K_j, F_{ji}, \Gamma_i), (\gamma_i, \beta_{ij}, s_{ij}, r_{ij}))$.
- Send $({\color{#ffb454}\Gamma_i}, D_{ji}, \hat D_{ji}, $$F_{ji},$ $\psi_i, $$\psi_{ji}$$)$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$,
- Verify that $\Pi^\textsf{elog}.\textsf{Verify}((\Gamma_j, G, B_j, Y_j), \psi_j) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, D_{ij}, K_i, F_{ij}, \Gamma_j), \psi_{ij}) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\delta_i}$.
- For each $j \neq i$,
- Round 4.
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \sum_j \Gamma_j$ and denote its x-coordinate by $r$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
Issue 2b: In round 2, the $x_i$ used to compute $\hat D_{ji}$ might be different from $\mathbf{P}_i$'s secret key share. Impact: Similar to issue 2a.
Similar to issue 2a, CGGMP introduces $\hat\psi_{ji}$ to show that $\hat D_{ji}$ is computed from $K_j, x_i$ and $\hat \beta_{ij}$.
$\textsf{CGGMP}.\textsf{SignV4}$- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$, $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Sample $Y_i \in \mathbb{G}$ and $b_i \in \mathbb{F}_q$.
- Compute $B_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(\gamma_i, b_i)$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- Broadcast $(K_i, Y_i, B_i)$.
- Round 2.
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $\psi_i := \Pi^\textsf{elog}.\textsf{Prove}((\Gamma_i, G, B_i, Y_i), (\gamma_i, b_i))$.
- For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$, $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$ and $r_{ij}, $$\hat r_{ij}$$ \in \mathbb{Z}_{N_i}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$ and $F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\beta_{ij}, r_{ij})$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$ and $\hat F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\hat \beta_{ij}, \hat r_{ij})$.
- Compute $\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, D_{ji}, K_j, F_{ji}, \Gamma_i), (\gamma_i, \beta_{ij}, s_{ij}, r_{ij}))$.
- Compute $\hat\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, \hat D_{ji}, K_j, \hat F_{ji}, X_i), (x_i, \hat\beta_{ij}, \hat s_{ij}, \hat r_{ij}))$.
- Send $({\color{#ffb454}\Gamma_i}, D_{ji}, \hat D_{ji}, F_{ji}, $$\hat F_{ji},$ $\psi_i, \psi_{ji}, $$\hat\psi_{ji}$$)$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$,
- Verify that $\Pi^\textsf{elog}.\textsf{Verify}((\Gamma_j, G, B_j, Y_j), \psi_j) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, D_{ij}, K_i, F_{ij}, \Gamma_j), \psi_{ij}) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, \hat D_{ij}, K_i, \hat F_{ij}, X_j), \hat\psi_{ij}) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\delta_i}$.
- For each $j \neq i$,
- Round 4.
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \sum_j \Gamma_j$ and denote its x-coordinate by $r$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
Issue 3a: In round 2, $\gamma_i, x_i, \beta_{ij}$ and $\hat\beta_{ij}$ are unbounded. Impact: A malicious $\mathbf{P}_i$ could bias $k$ toward small values by forcing an abort whenever another party's $k_j$ is large.
Below is an example to create a biased $k$. $\mathbf{P}_i$ sets $k_i := 0, \gamma_i \in [0, 2^\ell)$ and $\beta_{ij} := N_j - \gamma_i \cdot 2^{240}$ for all $j \neq i$. Then $k_j \in [0, 2^{240})$ if and only if
$$ \begin{aligned} \gamma_i \cdot k_j + \beta_{ij} = \gamma_i \cdot k_j + (N_j - 2^{240} \cdot \gamma_i) = N_j + \gamma_i \cdot (k_j - 2^{240}) \in [0, N_j). \end{aligned} $$Thus $\alpha_{ji} := \textsf{Paillier}.\textsf{Decrypt}(D_{ji}) = \gamma_i \cdot k_j + \beta_{ij}\ \text{mod}\ N_j$ overflows if $k_j \geq 2^{240}$. With that, the protocol would fail somewhere and a signature would not be produced. This would imply a signature could be produced if and only if $k_j \in [0, 2^{240})$ for all $j \neq i$, and now $k := \sum k_i$ is biased toward small values7.
CGGMP extends $\Pi^\textsf{aff-g}$ to include range proofs, in addition to the original checks. That said, it also requires that $x \in [0, 2^{\ell + \epsilon})$ and $y \in [0, 2^{\ell' + \epsilon})$. It is suggested from the paper that $\ell = 256$, $\ell' = 1280$, $\epsilon = 512$, and $\text{log}_2 N \approx 2048$. Assuming that $c \in [0, 2^{\ell + \epsilon})$, we have
$$ 0 \leq 0 \cdot 0 + 0 \leq x \cdot c + y < 2^{\ell + \epsilon} \cdot 2^{\ell + \epsilon} + 2^{\ell' + \epsilon} < 2^{\ell' + \epsilon} + 2^{\ell' + \epsilon} = 2 \cdot 2^{\ell' + \epsilon} < N. $$Since $x \cdot c + y$ would always fall in $[0, N)$, $\textsf{Paillier}.\textsf{Decrypt}$ always yields correct results.
Issue 3b: In round 1, $k_i$ used to compute $K_i$ is unbounded. Impact: $\mathbf{P}_i$ can leak the key share of $\mathbf{P}_j$ ($j \neq i$) in one go.
By setting $k_i := 2^{\ell' + \epsilon}$, they could receive $\hat \alpha_{ij} := x_j \cdot k_i + \hat \beta_{ji} = 2^{\ell' + \epsilon} \cdot x_j + \hat\beta_{ji}$. Since $\hat\beta_{ji} \in [0, 2^{\ell' + \epsilon})$, $\mathbf{P}_i$ retrieves $\mathbf{P}_j$'s key share $x_j$ with $x_j = \lfloor \hat \alpha_{ij} / 2^{\ell' + \epsilon} \rfloor$.
CGGMP introduces a range proof $\psi_{ji}^0$ to make sure that $k_i \in [0, 2^{\ell + \epsilon})$.
What is $\Pi^\textsf{enc-elg}$? $\Pi^\textsf{enc-elg}$ is the zero-knowledge proof showing the relation
$$ \begin{aligned} R_\textsf{enc-elg} = \{(\textsf{PUB}, C, X, A; x, \rho, a) \ | \ & C = (1 + N_0)^x \cdot \rho^{N_0}\ \text{mod}\ N_0^2 \\ & \quad \wedge A = (a \cdot G, x \cdot G + a \cdot X) \\ & \quad \wedge x \in [0, 2^{\ell + \epsilon})\}. \end{aligned} $$This proves that $A = \textsf{ElGamal}.\textsf{Encrypt}({\color{#ffb454}x}, a)$ and $C = \textsf{Paillier}.\textsf{Encrypt}({\color{#ffb454}x}, \rho)$ have the same ${\color{#ffb454}x} \in [0, 2^{\ell + \epsilon})$.
- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$, $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Sample $Y_i \in \mathbb{G}$ and $a_i,$ $b_i \in \mathbb{F}_q$.
- Compute $A_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(k_i, a_i)$ and $B_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(\gamma_i, b_i)$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- For each $j \neq i$, compute $\psi_{ji}^0 := \Pi^\textsf{enc-elg}.\textsf{Prove}((\textsf{PUB}, K_i, Y_i, A_i), (k_i, \rho_i, a_i))$.
- Broadcast $(K_i, Y_i, $ $A_i,$ $B_i)$ and send $\psi_{ji}^0$ to each $\mathbf{P}_j$.
- Round 2.
- For each $j \neq i$, verify that $\Pi^\textsf{enc-elg}.\textsf{Verify}((\textsf{PUB}, K_j, Y_j, A_j), \psi_{ij}^0) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $\psi_i := \Pi^\textsf{elog}.\textsf{Prove}((\Gamma_i, G, B_i, Y_i), (\gamma_i, b_i))$.
- For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$, $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$ and $r_{ij}, \hat r_{ij} \in \mathbb{Z}_{N_i}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$ and $F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\beta_{ij}, r_{ij})$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$ and $\hat F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\hat \beta_{ij}, \hat r_{ij})$.
- Compute $\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, D_{ji}, K_j, F_{ji}, \Gamma_i), (\gamma_i, \beta_{ij}, s_{ij}, r_{ij}))$.
- Compute $\hat\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, \hat D_{ji}, K_j, \hat F_{ji}, X_i), (x_i, \hat\beta_{ij}, \hat s_{ij}, \hat r_{ij}))$.
- Send $({\color{#ffb454}\Gamma_i}, D_{ji}, \hat D_{ji}, F_{ji}, \hat F_{ji}, \psi_i, \psi_{ji}, \hat\psi_{ji})$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$,
- Verify that $\Pi^\textsf{elog}.\textsf{Verify}((\Gamma_j, G, B_j, Y_j), \psi_j) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, D_{ij}, K_i, F_{ij}, \Gamma_j), \psi_{ij}) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, \hat D_{ij}, K_i, \hat F_{ij}, X_j), \hat\psi_{ij}) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\delta_i}$.
- For each $j \neq i$,
- Round 4.
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \sum_j \Gamma_j$ and denote its x-coordinate by $r$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
Issue 4: In round 4, $\mathbf{P}_i$ could silently send a different $\sigma_i$, failing the signature. Impact: Similar to issue 2a.
The party $\mathbf{P}_i$ sends $\Delta_i := k_i \cdot \Gamma$ and $S_i := \chi_i \cdot \Gamma$, along with the ZKP $\psi_i'$ to show that the $k_i$ used to compute $\Delta_i$ is legitimate, in round 3. It also performs additional checks in round 4 to make sure the pre-signature materials generated (i.e., $\delta = k \cdot \gamma$ and $\chi = k \cdot x$) are valid before they are broadcast.
$\textsf{CGGMP}.\textsf{SignV6}$- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$, $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Sample $Y_i \in \mathbb{G}$ and $a_i, b_i \in \mathbb{F}_q$.
- Compute $A_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(k_i, a_i)$ and $B_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(\gamma_i, b_i)$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- For each $j \neq i$, compute $\psi_{ji}^0 := \Pi^\textsf{enc-elg}.\textsf{Prove}((\textsf{PUB}, K_i, Y_i, A_i), (k_i, \rho_i, a_i))$.
- Broadcast $(K_i, Y_i, A_i, B_i)$ and send $\psi_{ji}^0$ to each $\mathbf{P}_j$.
- Round 2.
- For each $j \neq i$, verify that $\Pi^\textsf{enc-elg}.\textsf{Verify}((\textsf{PUB}, K_j, Y_j, A_j), \psi_{ij}^0) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $\psi_i := \Pi^\textsf{elog}.\textsf{Prove}((\Gamma_i, G, B_i, Y_i), (\gamma_i, b_i))$.
- For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$, $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$ and $r_{ij}, \hat r_{ij} \in \mathbb{Z}_{N_i}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$ and $F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\beta_{ij}, r_{ij})$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$ and $\hat F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\hat \beta_{ij}, \hat r_{ij})$.
- Compute $\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, D_{ji}, K_j, F_{ji}, \Gamma_i), (\gamma_i, \beta_{ij}, s_{ij}, r_{ij}))$.
- Compute $\hat\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, \hat D_{ji}, K_j, \hat F_{ji}, X_i), (x_i, \hat\beta_{ij}, \hat s_{ij}, \hat r_{ij}))$.
- Send $({\color{#ffb454}\Gamma_i}, D_{ji}, \hat D_{ji}, F_{ji}, \hat F_{ji}, \psi_i, \psi_{ji}, \hat\psi_{ji})$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$,
- Verify that $\Pi^\textsf{elog}.\textsf{Verify}((\Gamma_j, G, B_j, Y_j), \psi_j) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, D_{ij}, K_i, F_{ij}, \Gamma_j), \psi_{ij}) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, \hat D_{ij}, K_i, \hat F_{ij}, X_j), \hat\psi_{ij}) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\Gamma := \sum_j \Gamma_j$, $\Delta_i := k_i \cdot \Gamma$ and $S_i := \chi_i \cdot \Gamma$.
- Compute $\psi_i' := \Pi^\textsf{elog}.\textsf{Prove}((\Delta_i, \Gamma, A_i, Y_i), (k_i, a_i))$.
- Broadcast $({\color{#ffb454}\delta_i}, $ $\Delta_i, S_i, \psi_i'$ $)$.
- For each $j \neq i$,
- Round 4.
- Compute $\delta := \sum_j \delta_j$.
- For each $j \neq i$, verify $\Pi^\textsf{elog}.\textsf{Verify}((\Delta_j, \Gamma, A_j, Y_j), \psi_j') \stackrel{?}{=} 1$.
- Verify that $\delta \cdot G \stackrel{?}{=} \sum_j \Delta_j$ and $\delta \cdot X \stackrel{?}{=} \sum_j S_j$.
- If all of the checks above are passing,
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \Gamma$ and denote its x-coordinate by $r$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
What are the checks on the third point in round 4? The correctness is shown below: - $\sum_j \Delta_j = \sum_j k_j \cdot \Gamma = k \cdot (\gamma \cdot G) = (k \cdot \gamma) \cdot G = \delta \cdot G$, and - $\sum_j S_j = \sum_j \chi_j \cdot \Gamma = (k \cdot x) \cdot (\gamma \cdot G) = (k \cdot \gamma) \cdot (x \cdot G) = \delta \cdot X$.
[!WARNING] Non-identifiable aborts in $\delta \cdot G \stackrel{?}{=} \sum_j \Delta_j$ and $\delta \cdot X \stackrel{?}{=} \sum_j S_j$. Note that the checks there are not attributed by any external party. CGGMP has a protocol to identify the culprit. For more details, please read Figure 9 of the CGGMP24 paper. We omit it here for brevity.
Issue 5: The correctness of the final $\sigma_i$ is not checked. Impact: Similar to issue 2a.
CGGMP introduces an additional check after round 4 to check whether each $\mathbf{P}_j$ sent its $\sigma_j$ correctly.
$\textsf{CGGMP}.\textsf{SignV7}$- Round 1.
- Sample $k_i, \gamma_i \in \mathbb{F}_q$, $\rho_i \in \mathbb{Z}_{N_i}^*$.
- Sample $Y_i \in \mathbb{G}$ and $a_i, b_i \in \mathbb{F}_q$.
- Compute $A_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(k_i, a_i)$ and $B_i := \textsf{ElGamal}.\textsf{Encrypt}_{Y_i}(\gamma_i, b_i)$.
- Compute $K_i := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(k_i, \rho_i)$.
- For each $j \neq i$, compute $\psi_{ji}^0 := \Pi^\textsf{enc-elg}.\textsf{Prove}((\textsf{PUB}, K_i, Y_i, A_i), (k_i, \rho_i, a_i))$.
- Broadcast $(K_i, Y_i, A_i, B_i)$ and send $\psi_{ji}^0$ to each $\mathbf{P}_j$.
- Round 2.
- For each $j \neq i$, verify that $\Pi^\textsf{enc-elg}.\textsf{Verify}((\textsf{PUB}, K_j, Y_j, A_j), \psi_{ij}^0) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- Compute $\Gamma_i := \gamma_i \cdot G$.
- Compute $\psi_i := \Pi^\textsf{elog}.\textsf{Prove}((\Gamma_i, G, B_i, Y_i), (\gamma_i, b_i))$.
- For each $j \neq i$:
- Sample $\beta_{ij}, \hat\beta_{ij} \in [0, 2^{\ell'})$, $s_{ij}, \hat s_{ij} \in \mathbb{Z}_{N_j}^*$ and $r_{ij}, \hat r_{ij} \in \mathbb{Z}_{N_i}^*$.
- Compute $D_{ji} := {K_j}^{\gamma_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\beta_{ij}, s_{ij}) \ \text{mod}\ N_j^2$ and $F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\beta_{ij}, r_{ij})$.
- Compute $\hat{D}_{ji} := K_j^{x_i} \cdot \textsf{Paillier}.\textsf{Encrypt}_{N_j}(\hat\beta_{ij}, \hat s_{ij}) \ \text{mod}\ N_j^2$ and $\hat F_{ji} := \textsf{Paillier}.\textsf{Encrypt}_{N_i}(\hat \beta_{ij}, \hat r_{ij})$.
- Compute $\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, D_{ji}, K_j, F_{ji}, \Gamma_i), (\gamma_i, \beta_{ij}, s_{ij}, r_{ij}))$.
- Compute $\hat\psi_{ji} := \Pi^\textsf{aff-g}.\textsf{Prove}((\textsf{PUB}, \hat D_{ji}, K_j, \hat F_{ji}, X_i), (x_i, \hat\beta_{ij}, \hat s_{ij}, \hat r_{ij}))$.
- Send $({\color{#ffb454}\Gamma_i}, D_{ji}, \hat D_{ji}, F_{ji}, \hat F_{ji}, \psi_i, \psi_{ji}, \hat\psi_{ji})$ to $\mathbf{P}_j$.
- Round 3.
- For each $j \neq i$,
- Verify that $\Pi^\textsf{elog}.\textsf{Verify}((\Gamma_j, G, B_j, Y_j), \psi_j) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, D_{ij}, K_i, F_{ij}, \Gamma_j), \psi_{ij}) \stackrel{?}{=} 1$.
- Verify that $\Pi^\textsf{aff-g}.\textsf{Verify}((\textsf{PUB}, \hat D_{ij}, K_i, \hat F_{ij}, X_j), \hat\psi_{ij}) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- For each $j \neq i$, compute $\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(D_{ij})$ and $\hat\alpha_{ij} := \textsf{Paillier}.\textsf{Decrypt}_{N_i}(\hat D_{ij})$.
- Compute $\delta_i := [k_i \cdot \gamma_i + \sum_{j \neq i} (\alpha_{ij} - \beta_{ij})]\ \text{mod}\ q$.
- Compute $\chi_i := [k_i \cdot x_i + \sum_{j \neq i} (\hat\alpha_{ij} - \hat\beta_{ij})]\ \text{mod}\ q$.
- Compute $\Gamma := \sum_j \Gamma_j$, $\Delta_i := k_i \cdot \Gamma$ and $S_i := \chi_i \cdot \Gamma$.
- Compute $\psi_i' := \Pi^\textsf{elog}.\textsf{Prove}((\Delta_i, \Gamma, A_i, Y_i), (k_i, a_i))$.
- Broadcast $({\color{#ffb454}\delta_i}, \Delta_i, S_i, \psi_i')$.
- For each $j \neq i$,
- Round 4.
- Compute $\delta := \sum_j \delta_j$.
- For each $j \neq i$, verify $\Pi^\textsf{elog}.\textsf{Verify}((\Delta_j, \Gamma, A_j, Y_j), \psi_j') \stackrel{?}{=} 1$.
- Verify that $\delta \cdot G \stackrel{?}{=} \sum_j \Delta_j$ and $\delta \cdot X \stackrel{?}{=} \sum_j S_j$.
- If all of the checks above are passing,
- Compute $R := \left(\sum_j \delta_j\right)^{-1} \cdot \Gamma$ and denote its x-coordinate by $r$.
- Compute $\sigma_i := (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
- Broadcast ${\color{#ffb454}\sigma_i}$.
- Round 5.
- For each $j \neq i$, verify that $\sigma_j \cdot \Gamma \stackrel{?}{=} m \cdot \Delta_j + r \cdot S_j$.
- Compute $\sigma := \sum_j \sigma_j$.
- Output: $(r, \sigma)$ is a signature for $m$.
Correctness of round 5. $m \cdot \Delta_j + r \cdot S_j = m \cdot (k_j \cdot \Gamma) + r \cdot (\chi_j \cdot \Gamma) = (k_j \cdot m + r \cdot \chi_j) \cdot \Gamma = \sigma_j \cdot \Gamma$.
Securing auxiliary parameters
Difference with the CGGMP protocol The below are the differences between $\textsf{CGGMP}.\textsf{SignV7}$ and the actual CGGMP protocol: 1. CGGMP also computes $G_i := \textsf{Paillier}.\textsf{Encrypt}(\gamma_i, \nu_i)$ and $\psi_{ji}^1 := \Pi^\textsf{enc-elg}((\textsf{PUB}, G_i, Y_i, B_i), (\gamma_i, \nu_i, b_i))$ in round 1, then checks the ZKP in round 2. 2. CGGMP uses the nonce $\gamma$ instead of $k^{-1}$ (the inverse nonce technique). To achieve this, they set $R := \Gamma$ and compute $\sigma_i := \delta^{-1} \cdot (k_i \cdot m + r \cdot \chi_i)\ \text{mod}\ q$.
Now that we have the signing protocol in place, we have to validate the auxiliary parameters (i.e., the Paillier keys and Pedersen parameters). If the parameters are improperly validated, the corresponding ZKPs are simply voided. To be exact:
The "good" Ring-Pedersen parameters
Ring-Pedersen parameters $(\hat N_j, s_j, t_j)$ should satisfy $s_j, t_j \in \mathbb{Z}_{\hat N_j}^*$ and $s_j \in \langle t_j \rangle$ (i.e., there exists $\lambda_j$ such that $s_j = t_j^{\lambda_j}\ \text{mod}\ \hat N_j$).
In the related ZKPs (e.g., $\Pi^\textsf{aff-g}$ and $\Pi^\textsf{enc-elg}$), they often compute $A = s_j^{\color{#ff7b72}x} \cdot t_j^{\color{#ff7b72}y}\ \text{mod}\ \hat N_j$ and publish $A$ as part of the proof. Here $x$ is usually the secret, and $y$ is the blinding factor which is used to hide $x$ from being exposed. If $s_j$ is not generated from $t_j$, it is possible that $x$ could be recovered from $A$.
The "good" Paillier moduli
A Paillier modulus should be a product of two distinct primes. Also, the prime factors should not be small. Having small factors ($\approx 2^{16}$) would lead to leakage of private key shares. An example is the 6ix1een attack.
The new keygen protocol
Below is the largely revamped $\textsf{KeyGenV3}$.
What are the three zero-knowledge proofs $\Pi^\textsf{prm}$, $\Pi^\textsf{mod}$ and $\Pi^\textsf{fac}$? They are the zero-knowledge proof showing the relations
$$ \begin{aligned} & R_\textsf{prm} = \{ (N, s, t; \lambda) \ | \ s = t^\lambda \ \text{mod}\ N \wedge t \in \mathbb{Z}_N^* \wedge \lambda \in \mathbb{Z} \}, \\ & R_\textsf{mod} = \{ (N; p, q) \ | \ p, q\ \text{are distinct primes} \wedge p, q \equiv 3\ (\text{mod}\ 4) \wedge N = p \cdot q \}, \\ & R_\textsf{fac} = \{ (\hat N_0, s_0, t_0, N; p, q) \ | \ N = p \cdot q \wedge p, q \in [0, 2^{\ell + \epsilon} \cdot \sqrt{N}) \}. \end{aligned} $$ Here $(\hat N_0, s_0, t_0)$ are the verifier's Pedersen parameters.
- Round 1.
- Generate $x_i \in \mathbb{F}_q$, compute $X_i := x_i \cdot G$.
- Generate Pedersen parameters $(\hat N_i, s_i, t_i)$:
- Generate the modulus $\hat N_i$ which is a product of two primes.
- Sample $t_i \in \mathbb{Z}_{\hat N_i}^*$ and $\lambda_i \in \mathbb{Z}_{\phi(\hat N_i)}$.
- Compute $s_i := t_i^{\lambda_i}\ \text{mod}\ \hat N_i$.
- Compute $\psi_i := \Pi^\textsf{prm}.\textsf{Prove}((\hat N_i, s_i, t_i), \lambda_i)$.
- Generate a Paillier key $N_i$ (with prime factors $p_i$ and $q_i$) and keep the private key.
- Broadcast $(X_i, N_i, \hat N_i, s_i, t_i, \psi_i)$.
- Round 2.
- For each $j \neq i$,
- Check that $N_j, \hat N_j > 2^{2047}$.
- Verify that $\Pi^\textsf{prm}.\textsf{Verify}((\hat N_j, s_j, t_j), \psi_j) \stackrel{?}{=} 1$.
- If all of the checks above are passing,
- Compute $\psi_i' := \Pi^\textsf{mod}.\textsf{Prove}(N_i, (p_i, q_i))$.
- For each $j \neq i$, compute $\psi_{ij} := \Pi^\textsf{fac}.\textsf{Prove}((\hat N_j, s_j, t_j, N_i), (p_i, q_i))$.
- Send $(\psi_i', \psi_{ij})$ to $\mathbf{P}_j$.
- For each $j \neq i$,
- Round 3.
- For each $j \neq i$, verify that $\Pi^\textsf{mod}.\textsf{Verify}(N_j, \psi_j') = \Pi^\textsf{fac}.\textsf{Verify}(N_j, \psi_{ji}) = 1$.
$\textsf{CGGMP}.\textsf{KeyGenV3}$ is very different from the actual CGGMP protocol! This is largely different from the actual $\textsf{KeyGen}$ protocol in CGGMP. The Paillier moduli and Pedersen parameters are handled by the additional $\textsf{AuxiliaryInfoAndKeyRefresh}$ protocol, which performs many more validations. The above includes some checks that I think they are more critical. For more details, please refer to figures 6 and 7 in the CGGMP paper.
The auxiliary zero-knowledge proofs
Now we have introduced the protocol, but the crux would be the zero-knowledge proofs. CGGMP24 uses over 10 different ZKP protocols (and we introduced six). We will cover some of them below. For more details, please refer to section 5 and the appendix A in the CGGMP24 paper.
$\Pi^\textsf{fac}$, the small-factor proof
The zero-knowledge proof $\Pi^\textsf{fac}$ proves that $N$ is a product of two integers $p$ and $q$, where $p, q$ are "small" enough.
$$ R_\textsf{fac} = \{ (\hat N_0, s_0, t_0, N; p, q) \ | \ N = p \cdot q \wedge p, q \in [0, 2^{\ell + \epsilon} \cdot \sqrt{N}) \}. $$Recall that CGGMP uses 2048-bit Paillier moduli $N$, $\ell = 256$ and $\epsilon = 512$. By showing a factor is small, it shows that the other factor is "large enough":
$$ q = \frac{N}{p} > \frac{N}{2^{\ell + \epsilon} \cdot \sqrt{N}} \approx \frac{2^{2048}}{2^{256 + 512 + 1024}} = 2^{256}. $$ $\Pi^\textsf{fac}.\textsf{Proof}((\hat N_0, s_0, t_0, N), (p, q))$- Sample $\alpha, \beta \in [0, 2^{\ell + \epsilon} \cdot \sqrt{N})$, $\mu, \nu \in [0, 2^{\ell} \cdot \hat N_0)$, $r \in [0, 2^{\ell + \epsilon} \cdot N \cdot \hat N_0)$ and $x, y \in [0, 2^{\ell + \epsilon} \cdot \hat N_0)$.
- Compute $P := s_0^p \cdot t_0^\mu\ \text{mod}\ \hat N_0, Q := s_0^q \cdot t_0^\nu\ \text{mod}\ \hat N_0$.
- Compute $A := s_0^\alpha \cdot t_0^x\ \text{mod}\ \hat N_0, B := s_0^\beta \cdot t_0^y\ \text{mod}\ \hat N_0$.
- Compute $T := Q^\alpha \cdot t_0^r\ \text{mod}\ \hat N_0$.
- Compute $e := \mathcal{H}(\hat N_0, s_0, t_0, N, P, Q, A, B, T)$ (the Fiat-Shamir challenge, and $\mathcal{H}$ is a cryptographic hash function with range $[0, 2^{256})$).
- Compute $z_1 := \alpha + e \cdot p$ and $z_2 := \beta + e \cdot q$.
- Compute $w_1 := x + e \cdot \mu$ and $w_2 := y + e \cdot \nu$.
- Compute $v := r - e \cdot \nu \cdot p$.
The proof is given by $\psi := (P, Q, A, B, T, z_1, z_2, w_1, w_2, v)$.
$\Pi^\textsf{fac}.\textsf{Verify}((\hat N_0, s_0, t_0, N), \psi)$- Compute $R := s_0^N\ \text{mod}\ \hat{N_0}$.
- Compute $e := \mathcal{H}(\hat N_0, s_0, t_0, N, P, Q, A, B, T)$.
- Verify that
- $s_0^{z_1} \cdot t_0^{w_1} \stackrel{?}{=} A \cdot P^e\ \text{mod}\ \hat N_0$,
- $s_0^{z_2} \cdot t_0^{w_2} \stackrel{?}{=} B \cdot Q^e\ \text{mod}\ \hat N_0$,
- $Q^{z_1} \cdot t_0^v \stackrel{?}{=} T \cdot R^e\ \text{mod}\ \hat N_0$, and
- $z_1, z_2 \in [0, 2^{\ell + \epsilon} \cdot \sqrt{N})$.
Previously we mentioned that how important $\Pi^\textsf{prm}$ is, now we show a concrete example without the proof:
We could set $s_0 \in \mathbb{Z}_{\hat N_0}^*$ to be a primitive root of $\hat N_0$ and $t_0 = 1$. By picking $\hat N_0$ such that $\phi(\hat N_0)$ has small factors, we could easily compute the discrete logarithms (i.e., we could easily find $x$ such that $a^x = b\ (\text{mod}\ \hat N_0)$).
Hence the verifier could easily find $p$ from $P \equiv s_0^p\ (\text{mod}\ \hat N_0)$ and $q$ from $Q$.
If we are sure that $N$ does not have small factors (ideally at least $2^{256}$), the 6ix1een attack will be eliminated. However, with $\Pi^\textsf{fac}$ alone, we could not achieve that because one could set $p$ and $q$ to be composite numbers that consist of small prime factors. To resolve that, we will also need $\Pi^\textsf{mod}$.
$\Pi^\textsf{mod}$, the Paillier-Blum modulus proof
The zero-knowledge proof $\Pi^\textsf{mod}$ is used to make sure $N = p \cdot q$, and here $p \neq q$ and $p, q$ are both primes. $\Pi^\textsf{mod}$ also requires $p, q \equiv 3\ (\text{mod}\ 4)$ because it is much more efficient to prove. Also $t$ is usually $80$.
$\Pi^\textsf{mod}.\textsf{Prove}(N, (p, q))$- Sample $w \in \mathbb{Z}_N^*$ such that $\textsf{Jacobi}(w) = -1$.
- Compute $e_i = \mathcal{H}(N, w, i)$ for $i = 1, 2, ..., t$ (the range of $\mathcal{H}$ is $\mathbb{Z}_N^*$).
- Compute $d := N^{-1}\ \text{mod}\ \phi({N})$.
- For each $i = 1, 2, ..., t$,
- Find $a_i, b_i \in \{0, 1\}$ such that $e_i' := (-1)^{a_i} \cdot w^{b_i} \cdot e_i\ \text{mod}\ N$ has a fourth-root.
- Set $x_i := \sqrt[4]{e_i'}\ \text{mod}\ N$ and $z_i := e_i^d\ \text{mod}\ N$.
The proof is given by $\psi := (w, (a_i, b_i, x_i, z_i)_{i \in \{1, 2, ..., t\}})$.
$\Pi^\textsf{mod}.\textsf{Verify}(N, \psi)$- Compute $e_i = \mathcal{H}(N, w, i)$ for $i = 1, 2, ..., t$.
- Verify that
- $N$ is an odd composite number and $\text{GCD}(w, N) \stackrel{?}{=} 1$,
- $a_i, b_i \in \{0, 1\}$ and $x_i^4 \stackrel{?}{\equiv} (-1)^{a_i} \cdot w^{b_i} \cdot e_i \ (\text{mod}\ N)$ for all $i = 1, 2, ..., t$, and
- $z_i^N \stackrel{?}{\equiv} e_i \ (\text{mod}\ N)$ for all $i = 1, 2, ..., t$.
It effectively rejects $N$ that
-
has more than two prime factors by the $x_i$ check.
-
is not squarefree by the $z_i$ check. If $N$ is not squarefree (i.e., $N = p^2 \cdot r$ for some factor $p$), then $\text{GCD}(N, \phi(N))$ is a multiple of $p$. Thus the prover could not compute $d$, which makes it hard to compute the $z_i$.
$\Pi^\textsf{enc-elg}$, the range proof with El-Gamal commitment
Recall that $\Pi^\textsf{enc-elg}$ proves the relationship
$$ \begin{aligned} R_\textsf{enc-elg} = \{(\textsf{PUB}, C, X, A; x, \rho, a) \ | \ & C = (1 + N_0)^x \cdot \rho^{N_0}\ \text{mod}\ N_0^2 \\ & \quad \wedge A = (a \cdot G, x \cdot G + a \cdot X) \\ & \quad \wedge x \in [0, 2^{\ell + \epsilon})\}, \end{aligned} $$which needs $C = \textsf{Paillier}.\textsf{Encrypt}(x, \rho)$ and $A = \textsf{ElGamal}.\textsf{Encrypt}(x, a)$ to share the same $x$.
$\Pi^\textsf{enc-elg}.\textsf{Prove}((\textsf{PUB}, C, X, (A_1, A_2)), (x, \rho, a))$- Sample $\alpha \in [0, 2^{\ell + \epsilon})$, $\mu \in [0, 2^\ell \cdot \hat N)$, $r \in \mathbb{Z}_{N_0}^*$, $\beta \in \mathbb{F}_q$ and $\gamma \in [0, 2^{\ell + \epsilon} \cdot \hat N)$.
- Compute $S := s^x \cdot t^\mu\ \text{mod}\ \hat N$ and $T := s^\alpha \cdot t^\gamma\ \text{mod}\ \hat N$.
- Compute $D := (1 + N_0)^\alpha \cdot r^{N_0}\ \text{mod}\ N_0^2$.
- Compute $Y := \alpha \cdot G + \beta \cdot X$ and $Z := \beta \cdot G$.
- Compute $e := \mathcal{H}(\textsf{PUB}, C, X, A_1, A_2, S, T, D, Y, Z)$ (the range of $\mathcal{H}$ is $\mathbb{F}_q$).
- Compute $z_1 := \alpha + e \cdot x$ and $z_3 := \gamma + e \cdot \mu$.
- Compute $z_2 := r \cdot \rho^e\ \text{mod}\ N_0$.
- Compute $w := \beta + e \cdot a \ \text{mod}\ q$.
The proof is given by $\psi := (S, T, D, Y, Z, z_1, z_2, z_3, w)$.
$\Pi^\textsf{enc-elg}.\textsf{Verify}((\textsf{PUB}, C, X, (A_1, A_2)), \psi)$- Compute $e := \mathcal{H}(\textsf{PUB}, C, X, A_1, A_2, S, T, D, Y, Z)$.
- Verify that
- $C, D \in \mathbb{Z}_{N_0^2}^*$,
- $(1 + N_0)^{z_1} \cdot z_2^{N_0} \stackrel{?}{\equiv} D \cdot C^e\ (\text{mod}\ N_0^2)$,
- $w \cdot X + z_1 \cdot G \stackrel{?}{=} Y + e \cdot A_2$,
- $w \cdot G \stackrel{?}{=} Z + e \cdot A_1$,
- $s^{z_1} \cdot t^{z_3} \stackrel{?}{\equiv} T \cdot S^e \ (\text{mod}\ \hat N)$, and
- $z_1 \in [0, 2^{\ell + \epsilon})$.
Conclusion
This blogpost summarizes how a threshold ECDSA protocol, CGGMP24, is implemented. It involves a handful of zero-knowledge proofs which are central to ensuring the correctness of the auxiliary parameters, thus the protocol.
Threshold ECDSA is powerful that no one holds the private key, thus an attacker must compromise a threshold number of parties simultaneously. However, it is easy to make mistakes while implementing - and a single bug in the zero-knowledge proofs (e.g., a missing check somewhere) would be disastrous.
-
As the paper mentions, CGGMP can be converted into a $t$-of-$n$ scheme with $t < n$. ↩
-
It is usually the hash of the message, but here we'll be calling it the message for simplicity. ↩
-
https://std.neuromancer.sk/secg/secp256k1/ ↩
-
cmp_ecdsa_signing_service.cpp#L114passessizeof(elliptic_curve256_scalar_t)(32 bytes) to be the secret size ofmta::answer_mta_request. ↩ -
mta.cpp#L713passessecret_size * BETA_HIDING_FACTORbytes of randomness forbeta. HereBETA_HIDING_FACTOR = 5. ↩ -
cmp_setup_service.cpp#L22defines thePAILLIER_KEY_SIZEto be 2048 bits. ↩ -
The probability that $k_j \in [0, 2^{240})$ for all $j \neq i$ is around $1 / 2^{16 \cdot (n-1)}$ if there are $n$ parties, so this would be feasible if there are fewer parties. ↩