So long and thanks for all the checks
And so this chapter ends - it was a very interesting and elusive time to work on this project and improve privacy for a tool we will soon be using ourselves! When we started in 2025, Zero Knowledge Proofs (ZKPs) started to appear on the radar for electronic identities (eIDs), but it was not clear how useful they would be. There were two main problems with ZKPs in 2025:
- resource usage - both for the size of the proof, and the time it takes to create and verify proofs
- complexity of creating a ZKP - it was not easy to understand all the implications of choosing a technique over another
Now, only 18 months later, the landscape has changed a lot: modern ZKPs create small proofs, and can be created in less than 10 seconds, with some tricks they approach 1 second on a mobile device:
| Prover | Mac | Intel | Mobile | Proof size |
|---|---|---|---|---|
| UltraHonk / Barretenberg | 3.1s | 8.8s | 16.1s | 18 kB |
| Spartan | 3.7s | 8.3s | 11.0s | ≤ 202 kB |
| Spartan, pre-computed | load: 0.2s final: 1.0s total: 1.5s |
load: 0.4s final: 2.2s total: 3.0s |
load: 0.4s final: 3.4s total: 4.5s |
≤ 202 kB |
The circuit runs an age-proof with device and issuer verification. For more information, see Table 3 in ms4-report
Also, thanks to frameworks like noir, it is possible to write ZKPs in a high-level language, without having to know most of the underlying complexity:
fn main(
// Private: never leaves the phone
payload: BoundedVec<u8, PAYLOAD_MAX_LEN>,
jwt_signature: [u8; 64],
dob_salt: BoundedVec<u8, DOB_SALT_MAX_LEN>,
dob_value: BoundedVec<u8, DOB_VALUE_MAX_LEN>,
device_signature: [u8; 64],
// ... offsets into the payload
// Public: known to the verifier
issuer_pub_x: pub [u8; 32],
issuer_pub_y: pub [u8; 32],
now_date: pub u32,
challenge_nonce: pub [u8; 32],
) {
// 1. The credential is signed by the issuer
let signing_input = jwt_signing_input(payload);
assert(
std::ecdsa_secp256r1::verify_signature(
issuer_pub_x, issuer_pub_y, jwt_signature,
sha256_var(signing_input.storage(), signing_input.len()),
),
"Invalid JWT signature",
);
// 2. The proof comes from the device the credential was issued to
let (device_pub_x, device_pub_y) = device_key(payload, x_offset, y_offset);
assert(
std::ecdsa_secp256r1::verify_signature(
device_pub_x, device_pub_y, device_signature, challenge_nonce,
),
"Invalid device signature on challenge nonce",
);
// 3. The birth date is one of the disclosures in the credential...
check_disclosure_digest(payload, dob_salt, dob_value, dob_sd_offset);
// 4. ...and the holder is old enough
assert(
is_at_least_25_years_old(birth_date_as_int(dob_value), now_date),
"User must be 25 or older",
);
}
Thank You
We extend our thanks to all our partners and collaborators, without whom this journey would not have been possible:
- SICPA: Clément Humbert, Darko Kulic, Jean-Christophe Makuch, Luca Multazzu, Stephan Gruber
- EPFL: Ahmed Elghareeb, Alessandro Chiesa, Carine Dengler, Edouard Bugnion, Imad Aad, Linus Gasser
- FOJ: Alexandra Höss, Andreas Freysang, Fabrice Egger, Jonas Niestroi
- Ubique: Fabian Aggeler, Patrick Amrein
Documents
You can find a summary of our work on our github page here:
With the most important ones being:
- ZKP-Vault is a collection of documents we used during our work
- ZKP-Reports hold the results and comparisons of different ZKP approaches