Why Nostr? What is Njump?
2025-04-09 08:07:52

pippellia on Nostr: no one in this podcast mentioned exactly how a 2-of-3 Shamir secret sharing works, ...

no one in this podcast mentioned exactly how a 2-of-3 Shamir secret sharing works, which is a shame because it's super simple. Here is how:

First, the secret S is a number, or can be represented as such. Second, when you generate the shares for the secret S, you come up with a random line that pass throughout the point (0,S).

For example the line (a is random):
y = a*x + S

Then, you take three more points that are not the original point (0,S), for example:

P1 = (1, a+S)
P2 = (2,2a+S)
P3 = (3,3a+S)

(check this points are on the line)

How many lines go through 2 points? That's easy, only one. This means that with only two of these points, we can find the line, and then the secret.

For example, If we have the first two points P1 and P2, we can do:

2*P1 - P2 = (2-2, 2a+2S -2a -S)
= (0,S)

ta daaaa!
We've got the secret back. This is the basic for a 2-of-3 SSS.

To increase the second number, just generate more points at the shares creation.

To increase the number, you have to use polynomials of higher degrees, for example a parabola (3-of-whatever), a cubical (4-of-whatever), and so on.

https://fountain.fm/episode/gWYJ5PgxwzdnBjuNuzyc
Author Public Key
npub176p7sup477k5738qhxx0hk2n0cty2k5je5uvalzvkvwmw4tltmeqw7vgup