Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certificate chain verification in circom #37

Closed
0xturboblitz opened this issue Dec 31, 2023 · 4 comments
Closed

Certificate chain verification in circom #37

0xturboblitz opened this issue Dec 31, 2023 · 4 comments
Labels

Comments

@0xturboblitz
Copy link
Member

0xturboblitz commented Dec 31, 2023

The electronic passports trust chain has two levels:

  • top-level certificates (CSCAs) are used to sign intermediate certificates (DSCs)
  • intermediate certificates (DSCs) are used to sign passports

Right now, we get the list of DSCs from the ICAO website and check if passports are signed by any of them. However, we strongly suspect this list is incomplete as countries have no obligation to transmit these intermediate certificates, and the top ones are supposed to be the authoritative source.

We should work on verifying the whole certificate chain, which follows the X.509 format. The MynaWallet team has a circuit in which they are parsing one with fixed indexes, but we should build a more modular chain certificate verifier that supports multiple signature algorithms and parsing any data from certificates. This would also be super useful to projects like zk AppAttest and zk DNS trust chain verification that also require X.509 chain verification.

Some work has been done by Richard and Sachin in halo2.

The endgame for us would be having only the root of a merkle tree containing the CSCAs from the masterlist on chain, then verifying the whole chain in the circuit.

@0xturboblitz 0xturboblitz changed the title Implement X.509 certificate verification in circom Certificate chain verification in circom May 23, 2024
@0xturboblitz 0xturboblitz added help wanted Extra attention is needed medium ODHack labels May 23, 2024
@mdabir1203
Copy link

From what I understood I have two questions :

  • by root of merkle tree means its the hash of all the documents from csca , right ?
  • Can you tell me what is the structure of the merkle tree for CSCA master list ?

@remicolin
Copy link
Member

remicolin commented Jul 26, 2024

update on the issue:

sha256 rsa ✅ -> code
sha1 rsa ✅ -> code
sha256 rsapss 🚧 -> issue (help wanted)

TODO: (help wanted)
sha384 ecdsa (secpr1)

@remicolin remicolin removed their assignment Jul 26, 2024
@zarah-s
Copy link

zarah-s commented Jul 29, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

With my strong background in Rust, Solidity and JavaScript, I can apply my expertise in solving this issue

@HumbertoTM10
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have 4 years working in development environments, have encountered several challenges, requests and teams focusing in reusable and efficient code, so that gives me a better understanding of the code and how to solve problems efficiently.

How I plan on tackling this issue

I would focus in a comprehensive solution involving several key components: a certificate parsing module to extract relevant fields, a signature verification module supporting multiple cryptographic algorithms, and a chain building and verification module to validate the entire chain from end-entity certificates to root CSCAs. Additionally, we plan to integrate a Merkle tree for storing CSCAs on-chain, facilitating secure and efficient verification. The approach also includes leveraging existing work in halo2 for circuit implementation, ensuring scalability and performance. By prioritizing security, including certificate revocation checks and algorithm agility, this solution will also support related projects like zk AppAttest and zk DNS, providing a robust and future-proof certificate verification system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants