7 minute read

UCL Course COMP0143 Cryptocurrencies: Prerequisite Cryptography Part IV


Scenario: Sealed-Bid AuctionsPermalink

Process

  • Bidding Stage: Bidders submit their sealed bids.

  • Opening Stage: All bids are opened and the highest one wins.

Protection against Cheating

  • Bidding Stage: A sealed bid ci should not leak any information about the bid bi.

  • Opening Stage: A bidder should not be able to open its bid to another one bibi.


DefinitionPermalink

Commitment Scheme is an interactive protocol between a sender S and a receiver R.

ComponentsPermalink

  • Commit

    Sender S sends a commitment c:=Commit(m,r) to receiver R
    where m is the message and r is a randomness.

  • Reveal

    Sender S reveals c by sending m and r to receiver R
    who accepts if c=Commit(m,r).

Security GoalPermalink

  • Hiding

    Receiver R should not be able to obtain any information about m from c.

  • Binding

    Sender S should not be able to reveal c to any other message mm.

Adversary TypesPermalink

  • Hiding-Adversary A (role as Receiver R)

    who aims to learn information about m from c:=Commit(m,r).

  • Binding-Adversary A (role as Sender S)

    who aims to find (m,r) and (m,r) that meets Commit(m,r)=Commit(m,r) and mm.


Pedersen CommitmentPermalink

ProtocolPermalink

Let <G,q,g> be a cyclic group where |G|=q
and g is the generator in which the Discrete Logarithm Problem is computationally hard.

Let h be a randomly chosen generator of G with gh
and assume the discrete logarithm x such that h=gx is unknown.

  • Commit

    Sender S chooses mZq and picks r$Zq.

    Sender S sends commitment c:=gmhr to receiver R.

  • Reveal

    Sender S reveals c by sending m and r to receiver R who accepts if c=gmhr.

Hiding Security of Pedersen CommitmentPermalink

The Hiding of Pedersen Commitment provides Perfect Security.

Proof

Assume adversary A is even information-theoretic (knows x=logghh=gx).

Then, the commitment c:=gmhr=gm(gx)r=gm+xr.

The value a=m+xr is uniformly distributed in Zq since r$Zq.

Then, for any given message mZq, there exists an unique rZq meets a=m+xr.

Then, for any message m with m=m or mm, there exists r meets c=gmhr.

Therefore, adversary A cannot distinguish which message is hidden in c.

Binding Security of of Pedersen CommitmentPermalink

The Binding of Pedersen Commitment provides Computational Security

Proof

By Contradiction and Reduction

Assume Pedersen commitment scheme does not provide computationally secure binding
when the Discrete Logarithm Problem is computationally hard.

Let A be a PPT adversary which breaks the binding property.

Let B be a PPT adversary against Discrete Logarithm Problem that simulates Pedersen Commitment for A.

  • A requests a new commitment from B

    such that B chooses mZq, picks r$Zq, and returns c=gmhr to A.

  • A requests to de-commit c from B

    such that B sends (m,r) to B.

  • According to the assumption of A’s capability,

    A can return (m,r) and (m,r) to B and break binding successfully,

    which means that c=gmhr=gmhr=c,

    which means that  m+xrm+xr (mod p)  when h=gx,

    which means that  x(mm)(rr)1 (mod p) ,

    which means B can get x to break DLP (Given h and g to get x when h=gx).

Note: the Pedersen Commitment cannot provides perfectly secure binding since DLP is only computationally hard.


CRHF-based Commitment SchemesPermalink

Let H be a Collision Resistant Hash Function (CRHF)
in the Random Oracle Model (ROM) accepting arbitrary size inputs.

  • Commit

    Sender S chooses m{0,1} and picks r${0,1}n.

    Sender S sends commitment c:=H(m || r) to receiver R.

    Note: n should be large enough to defend brute force attacks.

  • Reveal

    Sender S reveals c by sending m and r to receiver R who accepts if c=H(m || r).

The hiding of CRHF-based Commitment provide
Computational Security since an adversary queries H(r) only with negligible probability.

The binding of CRHF-based Commitment provide
Computational Security since H is collision-resistant.

Merkle trees allow to commit efficiently to large sets of values and are very often used in practice (e.g., Blockchain).


Application: Coin Flip ProtocolPermalink

Alice and Bob want to agree remotely on a random bit b
which needs a function with joint inputs from Alice and Bob,
such that neither Alice and Bob can bias/control the result of b.

Let bA be the function result of Alice, and bB be the function result of Bob.

We say that the Coin Flip protocol is correct if bA=bB.

Strawman Implementation in Coin Flip Protocol

Alice chooses bA${0,1} and Bob bB${0,1}, then both compute b=bAbB.

However, this Coin Flip Protocol is insecure:

  1. Bob waits until it receive bA

  2. Bob then picks a wanted result b and replies bB=bAb to Alice

  3. Both Alice and Bob will output b

Commitment-based Implementation in Coin Flip Protocol

Process

  1. Alice chooses bA${0,1} and r${0,1}n

  2. Alice sends the commitment c:=Commit(bA,r) to Bob

  3. Bob chooses bB${0,1}

  4. Bob sends the bB to Alice

  5. Alice reveals c by sending pair (bA,r) to Bob, then computes b=bAbB

  6. Bob accepts if c=Commit(bA,r) (reject otherwise), then computes b=bAbB

Security

  • If the receiver is dishonest (Bob is the adversary B)

    and if B can distinguish bA=0 and bA=1

    then, B can break the hiding security of commitment scheme.

  • If the sender is dishonest (Alice is the adversary A)

    and if A can prepare c and valid pair (bA,r) for both bA=0 and bA=1

    then, A can break the binding security of commitment scheme.

Problem

When the sender (Alice) receives the reply from the receiver (Bob), Alice can compute b=bAbB.

If b is not the result Alice wants, Alice can choose not to reveal c to Bob, then Alice can abort the protocol as she wants.

The possible solution is to use Secret Sharing Schemes.


Application: Sealed-Bid AuctionsPermalink

  • Bidding Stage

    Each bidder Bi chooses a bid bi, picks a randomness ri, and publishes ci=Commit(bi,ri).

    Since commitment schemes are hiding, ci does not leak any information about bi.

  • Opening Stage

    Bidder Bi reveals ci by receiving bi and ri.

    Since commitment schemes are binding, Bi cannot change its bid to bibi after ci has been published.

  • Evaluation Stage

    The highest bid b=max(bi) wins.