vivianjeng / proof-of-passport

Proof of passport protocol using zk-SNARKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DALL·E 2023-10-25 11 57 47 - tight AF

Monorepo for the Proof of Passport protocol.

Proof of Passport lets users scan the NFC chip in their government-issued passport and prove the correctness of the signature in a zk-SNARK. This unlocks two interesting use cases:

  • For sybil-resistance, proof of passport can provide a source of unique identity.
  • For identity and privacy, proof of passport allows selective disclosure of private data. For instance, users can disclose their nationality or their date of birth without revealing any other private information.

As a first application, users who can prove they indeed hold a valid passport can verify this proof on-chain to mint a Soulbound Token (SBT).

Subdirectories

  • app: Mobile app
  • circuits: Circom circuits
  • contracts: Solidity contracts
  • common: Common utils

Roadmap

  • ✅ Basic passport verifier circuit
  • ✅ Selective disclosure
  • ✅ Basic react native frontend
  • ✅ Passport verification pipeline, android
  • ✅ Passport verification pipeline, iOS
  • ✅ Contracts
  • ✅ On-chain registry of CSCA pubkeys based on the official ICAO masterlist
  • 🚧 Optimizations
  • 🚧 Reimplementation of the passport NFC specs in javascript

FAQ

Does my passport support Proof of Passport ?

EPassport_logo_grey

If it has this symbol on the front cover, yes.

What exactly is being signed ?

The circuit looks like this:

Most of the data of interest is in the Datagroup 1, which contains the following info:

  • First name
  • Last name
  • Nationality
  • Date of birth
  • Gender
  • Expiration date of passport
  • Passport number

This goes through a bunch of hashes, concatenations with other data, and then is signed. By verifying the signature, we can make sure the personnal information cannot be altered.

What is the signature algorithm ?

Most countries use RSA with sha256 but some of them use other signature algorithms like ECDSA and other hash functions like SHA-512. You can find a summary of the signature algorithm used here

I just read my passport but it says my signature algorithm is not implemented. What do I do ?

Currently we only support the most common one sha256WithRSAEncryption. We will support the others shortly. Feel free to try your hand at implementing one!

What's the ICAO ?

The International Civil Aviation Organization (ICAO) is a specialized agency of the United Nations. Among other things, it establishes the specifications for passports, that have to be followed by all countries. The full passport specs are available here.

Where can I see those public keys ?

You can download the full list of public keys on the ICAO website, in the strange .ldif format. The parsed list is here

What can be proven ?

Here is all that can be proven:

Note that we can't access DG3 and DG4 which are optional fingerprint and iris scan without government authorization.

Even the photo is signed ?!

Yep. Currently we don't use it. If you have an idea of some fun zkml to do with it, let us know!

When I mint a Proof of passport SBT, what prevents someone else to frontrun my transaction ?

The SBT circuit includes a commitment to your address. If someone else tries to mint it, they will mint it to your address.

Project Ideas

  • Integrate Proof of Passport to Gitcoin passport or a similar system to allow better sybil resistance in quadratic funding
  • Combine with other sources of identity to provide quantified levels of uniqueness, totem-style. Examples can be anon aadhaar, Japan's my number cards or Taiwan DID
  • Add Proof of Passport as a Zupass PCD
  • Build a social network/anonymous message board for people from one specific country
  • Create a sybil-resistance tool to protect social networks against spambots
  • Do an airdrop farming protection tool
  • Allow DeFi protocols to check if the nationality of a user is included in a set of forbidden states
  • Gate an adult content website to a specific age
  • Create a petition system or a survey portal
  • Use for proof of location using place of birth and/or address
  • Passport Wallet: use active authentication to build a wallet, a multisig or a recovery module using passport signatures

We will provide bounties for all those applications. Those are not fixed right now, so please contact us if you're interested.

Licensing

Everything we write is MIT licensed. Circom and circomlib are GPL tho.

Contributing

We are actively looking for contributors. Please check the open issues if you don't know were to start! We will provide bounties starting from $100 for any significant progress on these. Please contact us for more details.

Contact us

Contact me @FlorentTavernier on telegram for any feedback.

Thanks to Rémi, Youssef, Aayush, Andy, Vivek, Marcus and Andrew for contributing ideas and helping build this technology, and to EF PSE for supporting this work through grants!

About

Proof of passport protocol using zk-SNARKs


Languages

Language:Kotlin 51.2%Language:TypeScript 19.6%Language:Swift 13.2%Language:Rust 6.5%Language:Solidity 3.4%Language:Circom 1.4%Language:Java 1.4%Language:C 1.1%Language:Shell 0.9%Language:Ruby 0.6%Language:JavaScript 0.3%Language:Objective-C 0.2%Language:Objective-C++ 0.1%Language:Makefile 0.0%