-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Hi there!
I'm building a circuit to prove membership in some list of addresses for PSE's e2e-zk-ecdsa project, and I think I need public key validation inside the circuit. This is because we want to prove membership in arbitrary address sets, including ones where some addresses may have no transactions or signed messages which means the public key can't be recovered. This means we can't do public key validation on the set outside the circuit as you reccomend, so it has to be done in the circuit.
I don't think circom-ecdsa has public key validation yet, so I was planning on implementing it and I hoped you guys could validate my approach.
According to Johnson et al, you just need to make sure that:
-
$\mathcal{Q} \neq \mathcal{O}$ (where$\mathcal{Q}$ is the public key, and$\mathcal{O}$ is the point at infinity). - The coordinates of
$\mathcal{Q}$ are in the field -
$\mathcal{Q}$ is on the curve $n\mathcal{Q} = \mathcal{O}$
I think Secp256k1PointOnCurve solves 2 and 3, and Secp256k1ScalarMult partially solves 4, but I'm not sure how to represent (0,0) but I can't quite tell.
I was also considering writing an ecrecover circuit, but I realised that passing a public key as input to ECDSAVerifyNoPubkeyCheck basically does the same thing from the verifier's point of view, at least for set membership.
I'd be curious if you pick any holes in this. Thanks!