kartikeya sharma
AI Verification · Applied Cryptography · AI Safety

A Bitcoin Key That Never Exists

Friday, November 20, 2026

CryptographyBitcoinThreshold Cryptography

Last week we started talking about Shamir secret sharing. So let's do a quick review of that, and then what we'll cover is answering a few questions, such as: what happens if the dealer is not honest, what happens if the dealer sends fake shares to parties, and also, how do we prevent the dealer from actually computing the secret?

Shamir secret sharing, quickly

Last week we said we have this person called a dealer, who holds a secret value, and they are the owner of this secret value. They also compute a polynomial of degree t − 1. Let's call the secret S.

f(x) = S + a1x + a2x2 + … + at−1xt−1 mod p

The secret is this polynomial evaluated at zero, so the y-intercept. From this polynomial, the dealer distributes individual shares to people via a private channel. Each party gets a share, which is the function evaluated at their index. So this person gets f(1), this one gets the function evaluated at x = 2, which is f(2), and this one gets f(3). Imagine this equation as a graph. Everyone has gotten individual points on this graph. And we know from last time that you need t points to reconstruct a polynomial of degree t − 1.

The first question I'll ask is, why do we need to keep this private? Why does the dealer need to send f(1) privately to P1 and f(2) privately to P2? What if they just publicly broadcast: here's f(1), here's f(2), here's f(3), and any party can just come and pick what they want? It's not a complicated answer. If I broadcast all of these shares publicly, then anyone can just get together. They just need t of these points to reconstruct this polynomial, and then they can find f(0). So this is why the shares must be shared privately.

How do they come together and reconstruct? We spoke about how they can reconstruct via Lagrange interpolation. You sum up all of the shares of the parties who came together, multiplied by the Lagrange coefficient evaluated at 0, because we're trying to find f(0). So t parties have to come together, and then they're able to reconstruct. This scheme is secure against up to t − 1 malicious parties. If t − 1 people decide to hack something, they will fail, because you need t people.

How is this secure? The way we prove this is we design a simulator. A simulator is someone who doesn't have access to anything, and they're just trying to fake it. In their attempt to fake the answers, if the answers look the same as the real answers, then we say that it's secure. Even in the regular case, the dealer computes random points. So you have t − 1 random values that are coming from this field, mod p. And now you can think of this as: what is the next value? This next value can be literally anything. And it's because this value can be anything that the secret could be S, or S′, or S″, and so on. The polynomial could be f(x), or f′(x), or f″(x), where f′ and f″ are just other polynomials through the same points, not derivatives.

You hold t − 1 shares. How many secrets are still possible?
Toy field: mod 11, threshold t = 3, so the dealer's polynomial is f(x) = S + a1x + a2x2. You are holding the shares of parties 1 and 2. For every candidate secret S, there is exactly one polynomial through (0, S) and your two points.
shares you hold
With two shares, all 11 secrets fit a polynomial, so the shares say nothing about S. The third share rules out all but one. On secp256k1 the same table would have about 2256 rows.

Problem one: we have to trust the dealer

The question is, we have to trust the dealer. You're trusting the dealer that they gave you the correct shares. What's to say that this dealer, instead of giving party two f(2), gives them f(50)? It's very hard for party two to know that, because they don't know what the equation is. They just see one share.

In the past, we've seen one way to fix this, via the proof of knowledge, where with a commitment we ensured that the order in which the prover does all of their steps is preserved. So we do something similar here. We tell the dealer to commit beforehand. This is known as verifiable secret sharing, where again the dealer computes their random coefficients, but they also commit to these values, so now they can't change it later.

A commitment is pretty much something where we can't invert it. Because if we're able to invert the commitment, then we would be back at the same place, where we just invert all of the commitments, and now we can reconstruct the function and get the secret. So here, again, we rely on the discrete log assumption. The dealer raises a generator to each coefficient, mod p. This is the same as our regular y = gx mod p. By the way, it will be a little different for Bitcoin. It will be a scalar multiplication instead of exponentiation.

C0 = ga0,   C1 = ga1,   …,   Ct−1 = gat−1 mod p    (a0 = S)

How do I, as a party, verify that I got the correct share from these commitments? Because obviously I can't invert this equation and check. We know that each party's share is the function evaluated at their index. Instead of x, I just wrote i. And there's also a0, which is going to be the secret.

f(i) = a0 + a1i + a2i2 + … + at−1it−1

And now what I can do is raise g to the power of this full equation, evaluated at my index. Someone caught that I first wrote plus on the second row, and it should be multiply. You're very right. When you add in the exponent, you multiply in the base. Now, ga0 is the same as C0, and ga1 is the same as C1, and so on and so forth. So we can rewrite this as C0 times C1i, times C2i2, and so on up to Ct−1it−1, mod p.

gf(i) = ga0 · (ga1)i · (ga2)i2 · … = C0 · C1i · C2i2 · … · Ct−1it−1 mod p

All of this is public now. We have these values, and we also know our own index. So pretty much what this verification means is, skipping all of these intermediate steps, we're just checking if gf(i), which each party can compute on their own from the commitments, is equal to gsi, where si is the share they received. And that basically tells them if the dealer gave everyone valid shares. This is Feldman VSS.

Party 2 sees only one point. Can it still tell its share is fake?
Toy group: p = 2039, q = 1019, g = 4. The dealer picks a degree-2 polynomial mod q (t = 3), publishes C0, C1, C2, and sends each of five parties its share privately. Each party checks gsi against C0·C1i·C2i2 on its own.
public commitments C0, C1, C2

But what is the problem here? I can tell you that a0 equals our secret. The commitments are actually public. So the problem here is that our secret key is exposed via commitment. That might not be a big problem, because to go from this commitment to the secret key, you have to break DLP. But based on this, there was another popular scheme that was invented, called Pedersen VSS. Instead of having one generator, you have two generators, and you're trying to use that second generator as a blinding factor. But we won't talk about that much, because Bitcoin uses this one. It uses Feldman VSS.

Problem two: the dealer still knows the secret

The problem is this dealer still has the secret. They still calculated the S value, which is f(0). We're just double checking that they're giving us the shares properly, but they're still making the equations. They still have the secret. They're the ones who made the secret. So what we want to do is make sure that this dealer is not the one in control of the secret. And in order to do that, we need to make sure that the dealer is not the one making the equation, because whoever makes the degree t − 1 equation calculates the secret.

So what we do is something called distributed key generation, where everyone is the dealer now. Everyone calculates their own equation, their own polynomial. Party one calculates a polynomial we can call f1(x), and then party three has f3(x) and party nine has f9(x).

f1(x) = a1,0 + a1,1x + a1,2x2 + … + a1,t−1xt−1 mod p

They also have their own commitments, similar to how the dealer published their commitments. So commitments for party one would be C1,0, C1,1, and so on. One participant summed it up: each participant works as an independent dealer, with the same protocol. Yes, exactly the same, but now everyone is the dealer. All of this is broadcast, and this type of verification happens.

But what is being distributed? I think that's the main question. Party one is going to get every other party's share that is evaluated at one, so f3(1) and f9(1). Party three will get f1(3), f9(3); party nine, f1(9), f3(9). So everyone's getting their own shares, corresponding to their index.

The public key, and the private key nobody has

How do you combine this into a public and private key? Let's say this large F is the combined large polynomial of everyone's individual polynomials. If we evaluate this at zero, it's going to be f1(0) plus f3(0) plus f9(0), which is the same as a1,0 plus a3,0 plus a9,0.

F(0) = f1(0) + f3(0) + f9(0) = a1,0 + a3,0 + a9,0

What we can do is multiply both sides by the generator, because in this elliptic curve world we have a generator. If I multiply a1,0 times G, I get the first commitment of the first party. And these commitments are public. So that will just be C1,0 plus C3,0 plus C9,0, and that's the public key. Why is that the public key? Because each C is equal to x·G, where x is that party's secret coefficient. So when we add everyone's commitment here, it's like a multisig at this point. We're just adding everyone's C value.

PK = G·F(0) = C1,0 + C3,0 + C9,0 = Σl Cl,0

So here's the interesting thing. The private key doesn't exist anywhere. We have these shares, and in the actual protocol, they won't actually calculate the private key. You can verify without actually knowing the private key.

After distributed key generation, who holds the private key?
Parties 1, 3 and 9, threshold t = 2, same toy group (p = 2039, q = 1019, g = 4, so multiplication of commitments here plays the role of adding points). Every party is a dealer of its own degree-1 polynomial. Rows are dealers, columns are the parties receiving.
public key PK = C1,0·C3,0·C9,0 mod p
Thought experiment only: pick t = 2 parties to pool their final shares with Lagrange interpolation
reconstructed F(0), and gF(0)–
No single dealer's secret al,0 is the private key, and no party ever receives F(0).
Each party's final share is the sum of the column it received. Any two of those shares interpolate to the same F(0), and gF(0) matches the public key that was built only from public commitments. In a real wallet the parties never pool their shares; they sign with them, which is what FROST does.

This part is also confusing, because now you have many dealers, and everyone has their own equation. But if you think of it as one dealer, just imagine you have one dealer. Whatever one dealer is doing, everyone is doing that simultaneously.

We covered the basic Shamir secret sharing. And we talked about how we verify that they are giving the correct shares to everyone. Then we talked about how we ensure that the dealer is not the one calculating the secret, and the answer to that is everyone becomes a dealer.

← Back to all articles