Jumboji Requirements:

Problem 1, public key set PSI

  1. Take two sets of (baby jubjub ECDSA) signatures A, B with |A| = n, |B| = m, n != m necessarily.
  2. Define the set of public keys that with signatures in A as A_pk and B as B_pk.
  3. A_pk and B_pk are subsets of a fixed set T, which is the total set of "meaningful" public keys. Currently |T| = 201, interested in |T| for size 25,000
  4. Within either set A or B, all the signatures are from different public keys (thus |A_pk| = n, |B_pk| = m)
  5. Determine the intersection of A_pk and B_pk

Problem 2, public key set PSI + signature verify
Same setup as before, but question is:

  1. Determine the intersection of A_pk and B_pk while verifying both were correctly derived from A and B.
  2. In other words, verify the users actually have valid signatures when finding public key overlap

Primer on levelled BFV

Levelled BFV is different from Fully homomorphic BFV because the parameters are fixed beforehand and circuit can only perform multiplications uptill a certain depth.

It is always convenient to think of a BFV ciphertext as a vector of plaintext slots. There can be (depending on security parameter and depth of circuit) many thousands of slots. Each slot contains a plaintext and plaintext has a space modulus some prime

p. x,-,+ between two ciphertexts applies the same operation slot-wise. For example,
Enc(a0b0c0d0e0f0g0h0)×Enc(a1b1c1d1e1f1g1h1)=Enc(a0a1modpb0b1modpc0c1modpd0d1modpe0e1modpf0f1modpg0g1modph0h1modp)

Apart from x,+,-, BFV ciphertexts have one extra trick: rotations.

For rotations, one must view vector of slots as a 2x(length_of_vector/2) matrix.

Enc(a0b0c0d0e0f0g0h0)

One can rotate each row right/left by arbitrary no. of slots. For example, rotating the above ciphertext to left by 1 transforms it to:

Enc(b0c0d0a0f0g0h0e0)

One can swap the rows as well. For example, swapping the rows transforms the ciphertext t0:

Enc(e0f0g0h0a0b0c0d0)

Keys

Public Key
Anyone can encrypt a message using

pk so that only the one with access to corresponding secret key
sk
can decrypt the output.

Rilearization key
Relinerization keys are special keys in levelled HE. They are needed to reduce the degree of ciphertext after mutliplication.

A fresh ciphertext

ct is usually referred to as a degree 1 polynomial
ct=(c0,c1)
. The reason it is called degree 1 is because the decryption structure of fresh ciphertext is
c0+c1s
with
s
, the secret, as the variable.

Multiplication of two degree 1 ciphertexts results in a degree 2 ciphertext. For example

ct0×ct1=ct0ct1=(c0,c1,c2). The decryption structure of
ct0ct1
equals
c0+c1s+c2s2
. Unless we reduce degree of output ciphertext after multiplication, the degree will grow exponentially with respect to depth of the circuit (i.e. no. of multiplications)

The procedure to convert a degree 3 ciphertext to degree 2 ciphertext is referred to as relinearization. It calculates

c2s2 homomorphically. To do so, we require relinerization key.

Galois key

We wouldn't need rotations for PSI, so understanding of galois keys isn't necessary.

Galois keys are required to rotate ciphertexts/ swap rows. The reason they are called "Galois" keys is because ciphertext rotations are derived from galois theorem.

Multi-party BFV

Multi-party BFV differs from BFV in only the key generation and decryption procedure. In BFV since the secret key is held by a single client, the client can generate all the necessary keys and decryt the ciphertext. In MP-BFV the ideal secret key is sharded among multiple parties. Key generation and decryption are multi-party protocols.

Collective public key generation
A single round protocol that outputs the collective public key. Anyone can encrpt their private input using the public key to produce a BFV ciphertext. It is important to note that no one can decrypt the ciphertext unless all parties collectivly decrypt it.

Collective relirization key generation
A two round protocol that outputs relinearization key.

Collective decryption
A single round protocol that decrypts a given BFV ciphertext.

For more inforamtion on steps of each protocol I will direct you to this document.

PSI using MP-BFV

Let there be two parties

P1,
P2
, and a public set of public keys of size
N
. Denote
pkx
as the
xth
public key in set
N
. Let
Pi
denote their bit vector
Bi
as a vector of bits
0,1N
where
Bi[x]=1
if and only if
Pi
has valid signature from public key
pkx
. Otherwise
Bi[x]=0
.

  1. P1
    and
    P2
    run collective public key generation protocol to generate
    pk
    .
  2. P1
    and
    P2
    run collective relinerization key generation protocol to generate a single relinerization key.
  3. P1
    encrypts its bit vector
    B1
    using
    pk
    to output
    ct1
    .
    P1
    sends
    ct1
    to
    P2
    .
  4. P2
    encrypts its bit vector
    B2
    using
    pk
    to output
    ct2
    .
    P2
    sends
    ct2
    to
    P1
    .
  5. Both
    P1
    and
    P2
    have access to
    ct1
    and
    ct2
    . Both of them individually multiply
    ct1
    and
    ct2
    to output
    ct1ct2
    . Note that since each party set 1 only at slots that are "active" for them, the output ciphertext
    ct1ct2
    encrypts a vector where any slot equals 1 when the slot is "active" for both
    P1
    and
    P2
    .
  6. P1
    generates their share to collecticely decrypt
    ct1ct2
    and sends it to
    P2
    .
  7. P2
    generates their share to collectively decrypt
    ct1ct2
    and sends it to
    P1
    .
  8. With both
    P1
    and
    P2
    having access to shares necessary to decrypt
    ct1ct2
    . They can independently decrypt the ciphertext and learn the public keys that are in common.

Note:

P2 can abort after learning
P1
's share to decrypt the ciphertext and prevent
P1
from learning the PSI output. This is a general problem in any multi-party protocol.

Note: the protocol can be easily extended to many parties at the expense of increasing communication linearly with no. of parties during key generation protocols.

For the protocol to work correctly, we will also require zero knoledge proofs for various operations. To be specific, we will require:

  1. Proofs to ensure that each party performs collective key generation correctly.
  2. Proofs to ensure that each party performs collective relinerization key generation correctly.
  3. Proofs to ensure that each party performs collective decryption correctly.
  4. Proof to ensure that each party encrypts correctly formed bit vector B_i using pk.

We're wroking on 1, 2, 3. But will require some help with 4.

Questions for jumboji team

  1. Is the set of public key publicly accessible? I am thinking of assigning each public key a fixed slot. To do so, we will need some source of truth.
  2. To check bit vector is correctly constructed we will require to verify ECDSA signatures in circuit. How expensive is verifying a single ECDSA signature in circuit?

Prototype

https://github.com/Janmajayamall/MP-PSI

The prototype implements MP-PSI for 2-parties with set

N=215 (i.e. can accomodate
215
public keys) but without zero knowledge proofs.