This implementation combines Shamir's Secret Sharing (SSS) with Elliptic Curve Diffie-Hellman (ECDH) to distribute a private key across multiple participants, allowing them to collaboratively compute the shared secret without any participant knowing the full private key. The key idea here is that the Lagrange interpolation on the shares'
This POC is partly based on the research paper: Threshold Diffie — Hellman Protocol (2021) done by D.N. Kolegov and Yu.R. Khalniyazova. A translation can be found here.
-
Private Key Splitting: The secret (private key) is divided into several shares using Shamir’s Secret Sharing scheme. Each share corresponds to a point on a polynomial, and at least
shares are required to reconstruct the secret. -
ECDH Key Exchange: Elliptic Curve Diffie-Hellman is used to establish a shared secret between two parties, Alice and Bob, without revealing their private keys.
-
Private Key Sharing:
The private key is split into multiple shares using a polynomial of degree
. Each share corresponds to a pair
, where: Here,
are random coefficients, and the secret is the constant term of the polynomial. -
Lagrange Interpolation:
To combine the shares, Lagrange interpolation is used. Each share's contribution is scaled by its corresponding Lagrange coefficient:
Part
of secret is reconstructed by multiplying share 's -value with its Lagrange coefficient: -
ECDH Operation:
In an ECDH exchange, Alice has a private key
and public key Bob has a private key
and public key . They can compute a shared secret using:
The shared secret is the point
on the elliptic curve. -
Threshold-Based ECDH:
Alice splits her private key
into shares with threshold and performs ECDH with Bob using his public key . Since:
-
Shared secret
-
Alice private key
From
and we have: -
-
Conclusion
In this implementation, each agent holds a share of the private key and computes a partial ECDH operation using their share.
The Lagrange coefficient
is applied to their share, and they compute: Where is Bob's public key and is the share of Alice's private key. The final shared secret is obtained by summing all partial results:
When applying Shamir's Secret Sharing (SSS) to a private key in elliptic curve cryptography (ECC), we perform the secret sharing over the finite field defined by
Reason:
The private key in ECC is an integer in the range
Therefore, when applying Shamir's Secret Sharing to a private key, the shares should be elements of the finite field