지금 프로젝트를 보호하세요
최대 규모의 웹3 보안 제공업체로 프로젝트를 강화하세요.
CertiK 보안 전문가가 귀하의 요청을 검토 후 곧 연락드리겠습니다.

Threshold Cryptography IV: Multiplicative-to-Additive (MtA) Protocol and Paillier Encryption Scheme

기술 블로그 ·기술적 분석 ·
Threshold Cryptography IV: Multiplicative-to-Additive (MtA) Protocol and Paillier Encryption Scheme

In our recent post, Threshold Cryptography III, we discussed how the challenge of constructing a threshold variant of ECDSA was addressed in the GG18 [3] through the use of the Multiplicative-to-Additive (MtA) protocol. This MtA protocol is employed in the initial 3 rounds of the 9-round threshold ECDSA protocol implemented in Binance tss-lib [1].

In this post, we provide a detailed examination of the MtA protocol, which utilizes the additively homomorphic properties of the Paillier encryption scheme to facilitate the exchange of encrypted secret shares among the participating parties.

Paillier Encryption Scheme

The Paillier additive homomorphic encryption scheme is employed in the MtA protocol to encrypt and decrypt exchanged secret shares. It supports additive homomorphism over a large modulus (typically of 2048 bits in size), which is substantially larger than the scalar field of the Secp256k1 elliptic curve. Homomorphic encryption is a term that simply means we are able to perform the operations on the encrypted message without requiring decryption, thereby preserving the confidentiality of the original message during computation.

Paillier Key Generation

Generate two large primes PP, QQ (called safe primes, for example, of 1024 bits), where P=2p+1P=2p+1, Q=2q+1Q=2q+1 and both pp, qq are primes. The Paillier public key is N=PQN=P \cdot Q (i.e., an RSA modulus) and an additional public value Γ=N+1\Gamma = N+1, the private key is the Carmichael function of NN, λ(N)=lcm(P1,Q1)=2pq\lambda(N)=lcm(P-1,Q-1)=2pq, where lcm()lcm() is the function to compute the least common multiple of two integers.

Encryption

Given a message (plaintext) mZNm \in \mathbb{Z}_N, the encryption EN(m)E_N(m) of the message mm is called a ciphertext c=ΓmxNc=\Gamma^m x^N ZN2\in \mathbb{Z}_{N^2}, where xx is a randomly generated integer that is coprime with NN.

Decryption

Given a ciphertext cc in the multiplicative group ZN2\mathbb{Z}_{N^2}^* (elements in ZN2\mathbb{Z}_{N^2} that has inverse), the decryption DN2(c)D_{N^2}(c) of cc is L(cλ(N))L(Γλ(N))\frac{L(c^{\lambda(N)})}{L(\Gamma^{\lambda(N)})} mod NN, where LL is a function defined as L(u)=u1NL(u) = \frac{u-1}{N} over uZN2u \in \mathbb{Z}_{N^2} such that u=1u=1 mod NN.

Correctness of Encryption and Decryption

Decryption in the Paillier encryption scheme is the inverse of encryption, which means that applying the decryption function DN2D_{N^2} to a ciphertext c=EN(m)c = E_N(m) yields the original message: DN2(EN(m))=m.D_{N^2}(E_N(m))=m. Given the Paillier encryption function:

EN(m)=ΓmxN mod N2=(1+N)mxN mod N2.E_N(m) = \Gamma^m x^N \ \text{mod} \ N^2 = (1+N)^m x^N \ \text{mod} \ N^2.

, using the binomial expansion of (1+N)m(1+N)^m mod N2N^2, and eliminating the terms divisible by N2N^2 gives us (1+N)m(1+N)^m mod N2N^2 =(1+mN+)=(1+mN+\cdots) mod N2N^2 =1+mN=1+mN, the ciphertext becomes c=EN(m)=ΓmxNc =E_N(m) = \Gamma^m x^N mod N2N^2 =(1+mN)xN=(1+mN)x^N mod N2N^2.

For decryption,

L(cλ(N))L(Γλ(N))=(((1+mN)xN)λ(N)1)/N((1+N)λ(N)1)/N,\frac{L(c^{\lambda(N)})}{L(\Gamma^{\lambda(N)})}=\frac{(((1+mN)x^N)^{\lambda(N)}-1)/N}{((1+N)^{\lambda(N)}-1)/N},

applying the binomial expansion on the numerator and the denominator with modulus N2N^2, then the numerator is

((1+mN)xN)λ(N) mod N21N=(1+mλ(N)N)xλ(N)N mod N21N,\frac{((1+mN)x^N)^{\lambda(N)} \ \text{mod} \ N^2 -1}{N} = \frac{(1+m\lambda(N)N)x^{\lambda(N)N} \ \text{mod} \ N^2-1}{N},

and the denominator is

(1+N)λ(N) mod N21N=(1+λ(N)N)1N=λ(N).\frac{(1+N)^{\lambda(N)} \ \text{mod} \ N^2-1}{N} = \frac{(1+\lambda(N)N)-1}{N} = \lambda(N).

By Carmichael's theorems, for any xZNx \in \mathbb{Z}_N^*, it holds that xλ(N)=1x^{\lambda(N)}=1 mod NN. Applying this result within the numerator and leveraging the binomial expansion, we obtain xλ(N)N=1x^{\lambda(N)N}=1 mod N2N^2.

As a result, the exponentiated ciphertext cλ(N)c^{\lambda(N)} simplifies such that the numerator in the decryption function becomes mλ(N)m \lambda(N).

Therefore, the decryption function evaluates as: L(cλ(N))L(Γλ(N))=mλ(N)λ(N)=m mod N,\frac{L(c^{\lambda(N)})}{L(\Gamma^{\lambda(N)})} = \frac{m\lambda(N)}{\lambda(N)}=m \ \text{mod} \ N, which correctly recovers the original message mm.

Additive Homomorphism

The Paillier encryption scheme supports additive homomorphism over the message space ZN\mathbb{Z}_N. Specifically, given any two messages m1,m2ZNm_1, m_2 \in \mathbb{Z}_N, and two ciphertexts c1,c2ZN2c_1, c_2 \in \mathbb{Z}_{N^2}^* such that c1=EN(m1)c_1=E_N(m_1), c2=EN(m2)c_2=E_N(m_2), the Paillier encryption satisfies:

EN(m1+m2 mod N)=EN(m1)EN(m2) mod N2E_N(m_1+m_2 \ \text{mod} \ N) = E_N(m_1) \cdot E_N(m_2) \ \text{mod} \ N^2

where the multiplication \cdot is performed in the multiplicative group ZN2\mathbb{Z}_{N^2}^*. For two messages m1m_1 and m2m_2, the ciphertexts are c1=EN(m1)=Γm1x1Nc_1=E_N(m_1)=\Gamma^{m_1}x_1^N mod N2N^2, c2=EN(m2)=Γm2x2Nc_2=E_N(m_2)=\Gamma^{m_2}x_2^N mod N2N^2. Then $$E_N(m_1) \cdot E_N(m_2) \ \text{mod} \ N^2=\Gamma^{m_1}x_1^N \Gamma^{m_2}x_2^N \ \text{mod} \ N^2=\Gamma^{m_1+m_2}(x_1x_2)^N \ \text{mod} \ N^2,$$ which is EN(m1+m2 mod N)E_N(m_1+m_2 \ \text{mod} \ N).

MtA Protocol

While the 3-round MtA protocol was briefly introduced in the previous post, we now provide a more detailed description in the context of the Paillier cryptosystem, including the associated range proofs over encrypted secret shares. In addition to the previously defined RSA modulus used in the Paillier encryption scheme, each party PiP_i is also instantiated with an auxiliary RSA module N^i\hat{N}_i along with two values h1ih_{1i}, h2ih_{2i} in ZN^i\mathbb{Z}_{\hat{N}_i}^*, which are required for creating range proofs based on commitment schemes.

Assume that each party possesses the Paillier public key and corresponding RSA modulus, with all public parameters securely generated, publicly disclosed, and verified by other parties. The MtA protocol executes between any two parties, typically denoted Alice and Bob. Recall that the goal of MtA protocol is to redistribute the multiplicative shares a,ba, b into additive shares α,β\alpha, \beta such that ab=α+β mod qa \cdot b = \alpha + \beta \ \text{mod} \ q, where qq is the scalar field of the Secp256k1 curve.

The following steps are based on the interactive algorithms defined in GG18 [3], where the sender (Prover) and receiver (Verifier) engage in a sequence of message exchanges. In practical implementations, these interactive protocols are typically converted into non-interactive counterparts using the Fiat–Shamir transformation, thereby removing the need for back-and-forth communication while preserving soundness in the random oracle model.

Round 1

The initiator (i.e., Alice) of MtA(MtAwc) protocol performs the following operations.

  1. Encrypts the secret share aa with its Paillier public key AA using the Paillier encryption scheme.
  2. Creates a range proof of aa to prove she knows a<q3a < q^3.
  3. Sends the encrypted share cA=EA(a)c_A=E_A(a) and the range proof of aa to Bob via p2p.

Refer to GG18 [3], Page 9:

Code 1

The range proof proceeds as follows on Page 28 of GG18 [3]:

Code 2

Round 2

Upon receiving the encrypted share cAc_A and the range proof,

  1. Bob verifies the range proof as in the above algorithm.
  2. If the verification succeeds, Bob then randomly generates βZq5\beta' \in \mathbb{Z}_{q^5}.
  3. Computes cB=(cA)bEA(β)=EA(ab+β)c_B = (c_A)^b \cdot E_A(\beta') = E_A(ab+\beta') (in a different notation) and sets its secret share as β=β\beta = -\beta' mod qq.
  4. Creates a Bob proof for MtA to prove b<q3b < q^3, β<q7\beta' < q^7, or a Bob proof for MtAwc (MtA with check) to prove b<q3b < q^3, β<q7\beta' < q^7 and he also knows bb, as shown in the following algorithm.
  5. Sends encrypted share cBc_B and the Bob proof to Alice via p2p.

Refer to GG18 [3], Page 9:

Code 3

Refer to GG18 [3], Page 31 for range proof in MtA:

Code 4

Refer to GG18 [3], Page 30 for range proof in MtAwc:

Code 5

Round 3

Upon receiving the encrypted share cBc_B and the Bob proof,

  1. Alice verifies the Bob proof as in the above algorithms.
  2. If the verification succeeds, Alice decrypts cBc_B to obtain α\alpha' with its Paillier private key and sets α=α\alpha=\alpha' mod qq as its additive share.

Refer to GG18 [3], Page 9:

Code 6

At the conclusion of the MtA(MtAwc) protocols, Alice and Bob collaboratively converts the multiplicative share aba \cdot b into additive shares α\alpha and β\beta such that:

ab=α+β mod qa \cdot b = \alpha + \beta \ \text{mod} \ q where:

  • αZq\alpha \in \mathbb{Z}_q is known only to Alice;
  • βZq\beta \in \mathbb{Z}_q is known only to Bob;
  • and qq is the scalar field of the Secp256k1 curve.

The resulting additive sharing ensures that neither party learns the value of aba \cdot b directly, preserving the secrecy of their respective inputs.

Conclusion

This post reviewed the MtA(MtAwc) protocols instantiated using the Paillier additively homomorphic encryption scheme, under the assumption that all participants possess securely generated, publicly known, and mutually verified Paillier public keys and RSA modulus. The verification of these parameters is a non-trivial task, requiring a series of zero-knowledge proofs to ensure their correctness and compliance with cryptographic security requirements. The details of these verification procedures will be discussed in the next post.

References

  1. Binance: https://github.com/bnb-chain/tss-lib
  2. Binance: Binance Open-Sources Threshold Signature Scheme Library
  3. Rosario Gennaro, Steven Goldfeder, 2018: Fast Multiparty Threshold ECDSA with Fast Trustless Setup (GG18)
  4. Ran Canetti, Rosario Gennaro, Steven Goldfeder, Nikolaos Makriyannis, Udi Peled, 2021: UC Non-Interactive, Proactive, Threshold ECDSA with Identifiable Aborts (CGGMP21)

관련 블로그

Threshold Cryptography V: Auxiliary Zero-knowledge Proofs

Threshold Cryptography V: Auxiliary Zero-knowledge Proofs

In this post, we analyze the specific ZKP constructions implemented in Binance’s tss-lib [1]. These proofs address previously identified weaknesses in the Multiplicative-to-Additive (MtA) protocol, Paillier encryption parameters, and auxiliary RSA modulus generation. Our discussion is grounded in the improvements formalized by the specifications in CGGMP21 [4], which strengthen the robustness of threshold ECDSA against known attacks.

솔리디티 개발자를 위한 이동 IV: 교차 계약 콜

솔리디티 개발자를 위한 이동 IV: 교차 계약 콜

In this article, we delve into the concept of cross-contract calls and examine the distinctions between Solidity and Move contracts in this area. We will assess the mechanisms and security of executing cross-contract calls in Move, aiding developers in better comprehending how to manage contract interactions within the Move environment.

Numa Incident Analysis

Numa Incident Analysis

On 10 August 2025 Numa protocol was exploited for ~$313k. A malicious actor acquired additional Numa tokens by liquidating victim accounts after manipulating the NumaVault by minting nuBTC. Minting the nuBTC inflated the total synth value and in turn, reduced the collateral value of cNuma according to the Numa VaultManager logic.