Skip to content

sanjay-sol/proof-of-passkeys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Passkeys + Zero-Knowledge Proofs: A Realistic Architecture (and Why It's Still Hard)

Passkeys (WebAuthn/FIDO2) are the first authentication mechanism that actually replaced passwords at scale. Zero-knowledge proofs (ZKPs) promise privacy-preserving authorization and identity. Naturally, engineers ask:

Can we combine real passkeys FaceID / TouchID / fingerprint-backed keys with zero-knowledge proofs to get passwordless and privacy-preserving authentication?

The answer is: yes, partially today; fully only with browser changes.

This article designs a realistic, implementable architecture, explains what browsers would need to expose, and ends with today's hard limitations.

No hype. Just constraints, primitives, and tradeoffs.


1. What "real passkeys" actually are

A passkey is not "biometrics + crypto" in the abstract sense. It is a hardware-backed asymmetric key with strict guarantees:

The private key lives in:

  • Secure Enclave (Apple)
  • TPM (Windows)
  • StrongBox / TEE (Android)

The private key:

  • Is non-extractable
  • Is not directly addressable by applications
  • Signing is allowed only via WebAuthn APIs

Every signature is:

  • Origin-bound (domain + RP ID)
  • Challenge-based
  • User-verified (biometric / PIN)

This model is enforced by browsers and OS vendors like Google and Apple for phishing resistance and account isolation.

This matters because ZK systems want programmable access to secrets, while passkeys explicitly deny that.


2. The core incompatibility: ZK circuits vs Secure Enclaves

Zero-knowledge proof systems assume:

  • Deterministic computation
  • Full access to private inputs
  • Repeatable execution inside a prover

Passkeys provide:

  • A black-box signing oracle
  • No access to private key material
  • No control over nonce generation
  • No guarantee of deterministic signatures

This creates a fundamental constraint:

You cannot directly "put a passkey inside a ZK circuit."

Any architecture that claims otherwise is either:

  1. Ignoring Secure Enclave constraints, or
  2. Assuming browser changes that do not exist today

So the design goal becomes:

Use passkeys as a trust anchor, not as a ZK witness.


3. A realistic architecture: Passkey-gated ZK credentials

The only architecture that works today respects WebAuthn's boundaries.

3.1 High-level idea

  • Passkeys authenticate who may receive a credential
  • ZK proves what that credential allows
  • Authentication and authorization are decoupled
  • Passkeys never appear inside the ZK circuit

3.2 Components

Client:

  • Browser with WebAuthn
  • ZK prover (WASM / native)

Server:

  • WebAuthn verifier
  • Credential issuer
  • Public verification keys

ZK System:

  • Circuits for attribute proofs
  • Nullifier logic
  • Verification logic (off-chain or on-chain)

3.3 Registration flow

  1. User registers a passkey with the website
  2. Server stores:
    • WebAuthn public key
    • Credential commitment root (Merkle root or hash)
  3. Server associates the passkey with a credential issuance policy

At this stage:

  • No ZK proof exists
  • No attributes are exposed
  • The passkey is just an authentication primitive

3.4 Authentication + credential issuance

  1. User authenticates using WebAuthn (biometric prompt)
  2. Server verifies:
    • Signature
    • Origin
    • User verification flag
  3. Server issues a ZK credential, e.g.:
    • Membership token
    • Age bucket
    • Subscription tier
    • Eligibility flag

This credential is:

  • Bound to a secret known only to the user
  • Stored client-side
  • Represented as commitments (not plaintext)

The passkey is now out of the picture.

3.5 ZK proof usage (where privacy actually happens)

Later, the user proves statements such as:

  • "I am a valid member"
  • "I am over 18"
  • "I have not exceeded my quota"
  • "I have not voted before"

Using ZK proofs that reveal:

  • No identity
  • No passkey
  • No stable user identifier

Optionally:

  • Nullifiers prevent double-use
  • Proofs can be verified on-chain

This is the only scalable model today.


4. Why not prove WebAuthn signatures inside ZK?

Let's be explicit.

4.1 Cryptographic cost

  • WebAuthn commonly uses ECDSA P-256
  • ECDSA verification in ZK:
    • Large circuits
    • Slow proving
    • High memory usage
  • Even optimized circuits are unsuitable for UX-critical login flows

4.2 Nondeterminism

  • Secure Enclaves choose nonces internally
  • ZK circuits require deterministic computation
  • You cannot replay or recompute the same signature inside the prover

4.3 Origin binding breaks portability

WebAuthn signatures bind:

  • RP ID
  • Origin
  • Client data hash

This is a feature, but it means:

  • Proofs are not transferable
  • Cross-site ZK proofs are impossible by design

5. What browsers would need to expose (to go further)

To truly merge passkeys and ZK, browsers would need new primitives, not hacks.

5.1 ZK-friendly attestation API

Browsers would need to expose something like:

A verifiable attestation:

  • "A valid WebAuthn authentication occurred"
  • Without revealing RP ID or public key

Signed by:

  • Platform root key
  • Device attestation key

This is fundamentally different from today's WebAuthn assertions.

5.2 Deterministic signing mode (scoped)

A controlled mechanism where:

The enclave signs:

  • A fixed-format message
  • With deterministic nonce derivation

Scope-limited:

  • Only for ZK usage
  • Only for specific relying parties

This is controversial because it touches side-channel risk.

5.3 Exportable commitments, not keys

Instead of exporting keys, browsers could expose:

  • Commitment to the passkey public key
  • Commitment to attestation metadata
  • Zero-knowledge verifiable statements like:
    • "This key was generated in a Secure Enclave"
    • "User verification occurred"

No raw cryptography leaves the device.

5.4 First-class anonymous credentials

The cleanest long-term solution:

  • Browsers act as credential issuers
  • Passkeys unlock issuance
  • ZK proofs consume credentials
  • Authentication events are never revealed

This aligns far better with the WebAuthn security model.


6. Why this hasn't shipped (yet)

6.1 Security conservatism

Browser vendors treat authentication APIs as critical infrastructure.

Any new surface:

  • Risks fingerprinting
  • Risks side channels
  • Risks cross-site correlation

ZK systems are still evolving, which makes vendors cautious.

6.2 UX constraints

  • ZK proof generation is still slow on mobile
  • Battery and thermal budgets matter
  • Login must feel instant
  • Passkeys succeeded because they removed friction. ZK risks adding it back.

6.3 Incentive mismatch

Privacy-preserving authentication:

  • Reduces tracking
  • Breaks analytics
  • Weakens centralized identity graphs

This is not aligned with most platform business models.


7. Today's hard limitations (no sugarcoating)

You cannot today:

  • ❌ Prove a Google / Apple passkey login inside a ZK circuit
  • ❌ Generate portable ZK proofs from WebAuthn assertions
  • ❌ Use passkeys directly for on-chain authorization
  • ❌ Extract enclave-backed secrets for ZK use

You can today:

  • ✅ Use passkeys as a secure gate to issue ZK credentials
  • ✅ Build anonymous, unlinkable authorization systems
  • ✅ Combine WebAuthn with ZK without violating security models
  • ✅ Achieve passwordless + privacy-preserving authorization

8. The realistic conclusion

Passkeys and ZK are complementary, not composable primitives - yet.

The winning architecture is not:

"ZK replaces passkeys"

It is:

"Passkeys securely bootstrap ZK credentials"

Anything deeper requires:

  • New browser APIs
  • New standards
  • Years of security review

About

Proof-of-Passkeys is a technical exploration of deriving verifiable and privacy-preserving proofs from WebAuthn passkey authentication events, without extracting hardware-backed keys.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors