Cointime

Download App
iOS & Android

Zero-knowledge proofs of identity using electronic passports

From ethresearch by turboblitz

Many applications need to verify their user’s identity online, whether it is nationality, age, or simply uniqueness. Today, this is hard. They are stuck between shady heuristics like tracking IP addresses and technologies like Worldcoin that need to deploy their infrastructure widely.

Fortunately, UN countries in association with the International Civil Aviation Organization have built a great tool for us to piggyback on: electronic passports. They are issued by more than 172 countries and include an NFC chip with a signature of the person’s information, including name, date of birth, nationality and gender. Issuing countries make their public keys accessible in online registries, enabling the verification of signatures.

A circuit for passport verification

For someone to prove their identity using a passport, they will have to do two things. First, read the content of their passport’s chip. This can be done easily with any NFC-enabled phone. Then, show a verifier that their passport has been correctly signed. Instead of sending all of their personal data for the verification to happen, they can generate a zero-knowledge proof that redacts some of their inputs.

Our circuit will have to checks two things:

  • The disclosed attributes have been signed correctly
  • The corresponding public key is part of the public key registry of UN countries

A simple circuit compliant with the electronic passport specs would look something like this:

B1_4A2ZxC.png2483×1669 96.6 KB

Here is roughly what happens:

  • Each datagroup stored in the passport contains some of the person’s information. The datagroups we are most interested in are the first one (nationality, age, etc) and the second one (photo). The circuit takes them as inputs along with the signing public key.
  • Datagroups are hashed, concatenated and hashed again.
  • The final result is formatted, hashed and signed by the country authority. We can use the public key to check this signature.

This makes the following attributes disclosable: name, passport number, nationality, issuing state, date of birth, gender, expiry date, photo.Some countries also provide additional data like place of birth, address, phone number, profession and a person to notify. Biometrics like fingerprint and iris are sometimes included but can’t be retrieved, as they require a special access key.

In practice, we want our circuit to have a few other features:

  • Instead of passing the country’s public key directly, we want the user to prove that the public key that signed their passport is part of the registry published by the ICAO. This can be done by passing a merkle proof of inclusion and having only the merkle root as a public input.
  • To allow for selective disclosure of any attribute, we pass a bitmap as a public input that will redact some of the attributes.
  • We want specific modules for age disclosure and nationality list inclusion. A range check can guarantee someone is above a certain age without disclosing the precise age, and an inclusion check can be done over a set of countries to prove someone is or is not a citizen of any country in a list.
  • For applications like minting an SBT or voting, we want to check that the passport is not expired. This can be done by passing the current date and doing a range check over the date in the circuit. We can then check that the current date is correct using the block timestamp in a smart contract or server-side in offchain verification.
  • For applications that need sybil-resistance, we want to store a nullifier that prevents using the same passport twice. The simplest approach involves storing a hash of the government’s signature, though this does not render the individual anonymous from the government’s perspective. There are other approaches, see here 1 for a discussion of the tradeoffs.

A map of a more complete circuit can be found here 3.

One of the challenges is the number of signature algorithms used. Most countries use common ones like RSA with SHA256, but the ICAO specifications are quite permissive and some countries chose to use hash functions like SHA512 or unusual padding formats. We currently support the most common one and we are working on adding support for more.

Applications

Applications roughly fall into three categories: proof of humanity, selective disclosure and authentication.

Proof of humanity can be used in general for sybil resistance. This includes voting, fair airdrops, quadratic funding and helping social media fight bots. If passports can’t be construed as a general solution today, they can be integrated into wider systems like Gitcoin Passport or Zupass.

Selective disclosure has applications like privacy preserving age check. Some countries restrict buying alcohol, drugs or entering casinos for minors, and zk could help bringing better privacy to those controls.

Another example of selective disclosure is proving one is not a citizen of any country in a set of forbidden countries. This could help creating an intermediate level of compliance between KYC-gated traditional finance and fully permissionless DeFi.

Using passport signatures for authentication, one can build a ERC-4337 recovery module that asks for a proof from a specific passport as one of the conditions for recovery. Some passports also support Active Authentication, meaning they have their own private key and the ability to sign data. This would make them suitable for direct transaction signing, either for small transactions or in a multisig setup with other signers.

Limitations

The most obvious limitations of using passport signatures are the following:

  • The passport does not do any kind of biometric check when the chip is read. Therefore there is no straightforward way to know if the passport has not been borrowed or stolen.
  • Most of the world population does not have a passport. Even in the US, only around 50% of the population owns a passport.
  • Issuing authorities can create an arbitrary number of passports and cheat in systems that require passports for sybil resistance.
  • Passports can be lost or revoked. Some countries allow citizen to keep their previous passport when they are issued a new one. Some people have dual citizenship. All those cases are hard to mitigate, as the signatures stay valid.

Those limitations are all quite fundamental to the way passports work today. They can be addressed by aggregating attestations from multiple sources, which will be covered in a future post.

Current state

Proof of Passport is fully open source 12, from mobile app to circuits. If you are interested in contributing, please check open issues 1.

While performance would have been a bottleneck a few years ago, work from teams like Polygon ID, arkworks and mopro have made client-side proving on smartphones quite fast. Generating a proof with the current circuit takes ~4 seconds on a recent iPhone.

We are currently focused on shipping the mobile app for the first integrations. It allows users to mint an Soulbound Token disclosing only specific attributes they chose, or none at all other than the validity of their passport. Contact us to try out the beta release.

Thanks to Rémi 2Andy 1Aayush 1Youssef 2 and Vivek 1 for contributing ideas and helping build this technology!

Comments

All Comments

Recommended for you

  • Cointime July 27th News Express

    1. As of July 25, BlackRock IBIT held more than 338,000 bitcoins, an increase of more than 1,092 bitcoins from the previous day.

  • Polymarket adds new Olympics category

    Predicting market Polymarket adds "Olympics" category, including:Currently, among the countries predicted to win the most gold medals at the Paris Olympics, the United States accounts for 79% and China accounts for 20%. The amount of the prediction market project has reached 1.2 million US dollars; among the countries predicted to win the most medals, the United States accounts for 94% and China accounts for 6%. The amount of the prediction market project has reached 1.3 million US dollars.

  • Robert Kennedy Jr.'s four Bitcoin policies, including that BTC-USD transactions do not need to be reported or taxed to the IRS

    US presidential candidate Robert Kennedy praised the role that Bitcoin could play in improving the US economy at the Bitcoin 2024 conference. He proposed a comprehensive reform of US monetary policy and added that BTC could restore the US economy to its pre-Nixon era. He promised to issue four executive orders related to Bitcoin if elected:

  • Hong Kong Legislative Council Member Tam Yue-heng: Accelerate the issuance and trading of stablecoins that match the characteristics of the linked exchange rate system

    Tan Yueheng, a member of the National Committee of the Chinese People's Political Consultative Conference and the Legislative Council, published an article entitled "Consolidating the Status of Financial Center and Sharing the Dividend of Deepening Reform". In it, he pointed out that in the field of digital finance, the SAR government must continue to develop digital finance and qualified virtual products, explore new beneficial financial formats, and promote the new productive forces of the financial industry. Hong Kong must promote the participation of financial technology companies in the stable coin sandbox mechanism, accelerate the issuance and trading of stable coins with the characteristics of matching linked exchange rate system, expand the testing scope and landing scenarios of digital RMB as a cross-border payment tool, and focus on developing products that are linked to virtual assets and underlying real assets, transforming art, real estate, equity, and carbon emissions into digital tokens through blockchain technology.

  • Hong Kong’s virtual asset ETF market has established a mature structure including exchanges, market makers, primary and secondary custodians, etc.

    Wang Long, Chairman of the Greater Bay Area Financial Professionals Association, pointed out in an article published in Ta Kung Pao entitled "Web3.0 Promotes Diversification of Financial Products" that although Hong Kong's ETF market is still in its development stage compared to the United States, it has established a mature architecture, including exchanges, market makers, primary and secondary custodians, etc. The Hong Kong Securities and Futures Commission has approved six virtual asset spot ETFs and 14 virtual asset spot ETFs, including Hong Kong dollars, US dollars, and renminbi categories, for trading on platforms holding the Hong Kong Securities and Futures Commission license. Nowadays, more and more global investors are paying attention to how to invest in virtual assets, and both the United States and Hong Kong, China have approved the listing of ETF funds for virtual assets, and the investment scale is rapidly increasing.

  • Bloomberg ETF Analyst: XRP ETF may be the next exchange-traded fund product to be launched

    Bloomberg ETF analyst James Seyffart forwarded market news on X platform, stating that during the Bitcoin 2024 conference, Discover Crypto CEO Joshua Jake was interviewed and he said that XRP ETF could be the next possible exchange-traded fund product to launch.

  • Hong Kong's financial industry may study launching stablecoin trading desks and institutional custody services

    Hong Kong Monetary Authority recently announced the list of participants in the stablecoin issuer sandbox, including JD Coin Chain, Circle Coin Innovation, Standard Chartered Bank, Anni Group, Hong Kong Telecom and other institutions. Research reports released by Zeng Shengjun, a researcher at the Greater Bay Area Financial Research Institute of the Shenzhen Branch of Bank of China, and Guan Zhenqiu, a researcher at the Hong Kong Financial Research Institute of Bank of China, analyzed that the Hong Kong dollar stablecoin can improve the efficiency and inclusiveness of the Hong Kong financial system. Its stability, free convertibility, high security, high open source and cross-border mobility can provide support for a wider range of financial innovations.

  • Bitcoin scaling network Mezo completes $7.5 million in financing, led by Ledger Cathay Fund

    Bitcoin scaling network Mezo has completed a $7.5 million financing round, with Ledger Cathay Fund leading the investment and Mantle EcoFund ecosystem projects from ArkStream Capital, Aquarius Fund, Flowdesk, GSR, Origin Protocol, and Bybit participating. This round of financing brings its total funding to $30 million.The new funds will be used for Mezo's plan to expand the adoption of its network, including integrating more products into its network, such as its Bitcoin staking platform Acre.

  • ABCDE: Why We Invest in aPriori

    aPriori is an MEV (Maximal Extractable Value) liquid staking platform on Monad. Its innovative design significantly reduces latency, maximizing compatibility with Monad’s high performance. The team members are from the high-frequency trading field, with experience in top companies like Jump Crypto, Flow Traders, and Coinbase. With the team’s background in top high-frequency trading crypto institutions, aPriori is building the infrastructure that helps Monad realize its potential as a high-throughput network ready for mass adoption.

  • APRO Oracle and Lnfi Network Launch Groundbreaking Price Oracle Service on Lightning Network

    We are thrilled to announce that APRO Oracle is joining forces with Lnfi Network to introduce the first-ever price oracle service based on the latest mainnet version of Taproot Assets. This collaboration aims to provide weighted prices from major exchanges like Binance directly to the Lightning Network, ensuring a new level of efficiency and reliability in decentralized finance.