zk-passport / proof-of-passport

Proof of passport protocol using zk-SNARKs
https://proofofpassport.com
245 stars 32 forks source link

Add nationality set inclusion check to circuit #56

Open 0xturboblitz opened 5 months ago

0xturboblitz commented 5 months ago

Some actors from traditional finance can't enter decentralised finance because of the lack of enforceable regulation. For instance, legislation prevents them from dealing with users from certain countries, but they have no way of checking reliably the nationality of users and heuristics such as IP address are not reliable enough.

Proof of passport could allow users to prove they are not citizens of a given subset of countries without revealing their nationality.

This would involve writing a disclosure circuit that extract the nationality and does an (non-)inclusion check over a group of countries.

Depending on the size and complexity of the circuit, this could be integrated in the main disclose.circom or be a separate disclosure circuit.

I think you would do it by passing the root of a sparse merkle tree representing a list of countries as a public input and do a inclusion check or a non-inclusion check in the circuit.

This system could be reused for https://github.com/zk-passport/proof-of-passport/issues/120

rajeshkumarrobert commented 3 weeks ago

@0xturboblitz I like to work on this, I'm a beginner in circom and I hope I can complete this

0xturboblitz commented 3 weeks ago

Hi @rajeshkumarrobert, go for it and feel free to dm if you have questions