Path: blob/main/frontier/09-commitments-sigma-protocols/break/pedersen-unbounded-adversary.ipynb
483 views
Break: Opening Pedersen Commitments Two Ways
Module 09 | Breaking Weak Parameters
A computationally unbounded adversary can open a Pedersen commitment to any value, because perfect hiding and perfect binding cannot coexist.
Why This Matters
In 09b, we learned that Pedersen commitments are perfectly hiding: even an all-powerful adversary learns nothing about the committed value from seeing the commitment. We also learned the price: binding is only computational, it relies on the hardness of the discrete logarithm problem.
But what does "only computational binding" actually mean in practice? It means:
A polynomial-time adversary cannot find two valid openings for the same commitment (assuming DLP is hard).
A computationally unbounded adversary, one who can solve the DLP, can open any commitment to any value.
In this notebook, we play the role of the unbounded adversary. We will:
Commit to a value
Open the same commitment to (and any other value we choose)
Understand why this is a feature, not a bug: the hiding-binding tradeoff is fundamental.
Setup: Pedersen Parameters
We work in a prime-order subgroup of with:
Safe prime
Generators and of the order- subgroup
The commitment to message with randomness is:
The critical assumption for binding: nobody knows .
For this attack, we will deliberately set up the parameters so that we do know . This simulates a computationally unbounded adversary who can solve the DLP.
Step 1: Commit to
The honest committer creates with a random blinding factor .
Step 2: The Algebra of the Attack
We want to open to a different message . We need to find such that:
Since , we need:
Rearranging:
Since , this becomes:
Working in exponents mod :
This requires computing , which is easy since is prime. But it requires knowing , which only an unbounded adversary can compute.
Step 3: Open to Any Value
The attack is not limited to . Once we know , we can open the commitment to any message whatsoever. Let's demonstrate with several target values.
Step 4: Why This Requires Solving the DLP
The formula requires knowing . In a proper Pedersen setup, and are generated so that nobody knows . Common approaches:
"Nothing-up-my-sleeve" generation: Derive from a hash: . Nobody can compute from such a derivation.
Trusted setup ceremony: Multiple parties contribute randomness; as long as one is honest, remains unknown.
An efficient adversary who cannot solve the DLP is stuck: the formula exists but is unusable.
The Insight: Hiding vs. Binding is Fundamental
A deep theorem in cryptography states:
No commitment scheme can be both perfectly hiding AND perfectly binding.
Intuition:
Perfect hiding means every commitment is consistent with every message (for some ). This means alternative openings exist.
Perfect binding means exactly one valid opening exists for each . But then carries information about (ruling out perfect hiding).
| Scheme | Hiding | Binding | Tradeoff |
|---|---|---|---|
| Hash commitment | Computational | Perfect | Unbounded adversary could learn |
| Pedersen | Perfect | Computational | Unbounded adversary could open to any |
Pedersen commitments choose perfect hiding because in protocols like zero-knowledge proofs and confidential transactions, privacy (hiding) is the primary goal. The binding guarantee is "good enough" as long as the DLP is hard, and for 256-bit prime-order groups, it is.
Exercises
Exercise 1: Multiple Alternative Openings
Using the parameters from the main demonstration (where we know ), commit to with a random , then find valid openings for . Verify each one.
Exercise 2 (Independent)
Show that finding two valid openings and for the same commitment directly reveals .
Given: , derive .
Use the openings from Exercise 1 to recover and verify it matches.
Summary
| Aspect | Detail |
|---|---|
| Property broken | Computational binding of Pedersen commitments |
| Adversary model | Computationally unbounded (can solve DLP) |
| Attack | Know , compute |
| Consequence | Can open any commitment to any value |
| Is this a bug? | No. It is the necessary price for perfect hiding |
| The tradeoff | Perfect hiding + computational binding (Pedersen) vs. computational hiding + perfect binding (hash commitments) |
| In practice | With 256-bit , the DLP is intractable; binding holds against all realistic adversaries |
The hiding-binding tradeoff is one of the deepest results in commitment scheme theory. You cannot have both properties hold unconditionally. Pedersen commitments choose perfect hiding because in zero-knowledge proofs, confidential transactions, and other privacy-preserving applications, the ability to hide committed values from even unbounded adversaries is worth the tradeoff of computational (rather than perfect) binding.