Skip to main content

Privacy-Preserving Age Verification with Zero-Knowledge Proofs

Compare $0.10 selfie age checks with signed wallet attributes, then learn how a separate zero-knowledge proof can establish an age threshold without revealing a birth date.

Privacy-Preserving Age Verification with Zero-Knowledge Proofs

Contents

In this guide

Jump to the part you need.

This guide is for teams that must keep under-18s out of a product, or admit people who are 18 or older, without storing a date of birth or a passport scan. Standalone selfie age estimation costs $0.10 per live HTTP 200 response and includes passive liveness. The caveat comes first: the Didit integrations documented here are selfie age estimation and signed wallet-attribute verification. The zero-knowledge proof design below requires a separate implementation.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Age checks Didit publishes, what each one reveals, and the list price
RouteWhat it reveals to youList priceAvailability
Selfie age estimation, passive liveness includedA predicted age and a liveness score. No document, no date of birth. Nothing is stored when save_api_request is false.$0.10 per checkAvailable
ID document verificationProcesses an identity document and may disclose personal data. Confirm that the result includes the date of birth before relying on it for an age decision.$0.15 per checkAvailable
Google Wallet IDSigned attributes the wallet releases, checked against the issuer signature and the device signature when the response arrives$0.10 per completed verificationAvailable in the United States, United Kingdom, Brazil, Singapore and Taiwan
EUDI WalletAttributes released by a national wallet$0.15 per completed verification, rate publishedComing soon, no launch date promised
Zero-knowledge proof of ageThe proof can establish that the holder meets the minimum age without revealing the date of birth. The verifier still sees the public inputs and may see request metadata.No published Didit price in the supplied sourcesSeparate implementation

Start free in the sandbox at business.didit.me, no sales call. Developers who want an assistant to wire the call can connect Didit to an AI assistant through the Didit MCP server. The product itself is described on the Age Estimation product page. The Age Estimation documentation sits at Age Estimation, the endpoint contract at the Age Estimation API reference, and live prices at the pricing page.

What a privacy-preserving age check has to do

An age gate needs four things. First, the check answers one predicate: does this person meet the minimum age, yes or no. Second, it does not create a store of birth dates that turns into a liability the day you are breached. Third, it resists spoofing, or the predicate is worthless. Fourth, you can show an auditor why a decision was made.

A correctly designed zero-knowledge proof can establish eligibility without disclosing the credential's date of birth. The user's wallet holds a credential signed by an issuer and emits a proof that the credential's date of birth is on or before the eligibility cutoff. The proof can establish that the holder meets the minimum age without revealing the date of birth. The verifier still sees the public inputs and may see request metadata. The constraint is supply, not the cryptography: a proof needs a credential that your verifier trusts. Check whether the issuer, credential and wallet support the predicate you need. A wallet that releases a signed birth date may support age calculation but still disclose the birth date.

So we split the problem in two. Where a signed credential exists, use it and take only the attribute you need. Where it does not, use a check that never collects the birth date in the first place. Age estimation from a selfie does that: the model predicts an age from a face, returns a float and a liveness score, and when you set save_api_request to false there is no stored image and no persisted session to look up later.

Age zk in one paragraph

Age zk, or zero-knowledge age verification, is the specific case where a user proves a comparison rather than a fact. The proof condition is that the credential's date of birth is on or before the eligibility cutoff, and it is proved against a credential the user already holds, without the verifier seeing the credential, the date, the name or the document number. Zero knowledge hides credential fields used as private inputs, beyond what the public inputs and the proven statement reveal. A verifier can separately ask the user to disclose more. The practical difficulty is issuer trust: a proof is only as good as the signature under it, so a verifier keeps a list of accepted issuers and rejects proofs from anyone else.

Three routes, and the evidence each one gives your verifier

Model-estimated age, issuer-signed age attribute, and a proof of a hidden age predicate
RouteEvidence your verifier getsWhat it reveals
Model-estimated age from a selfieA model-predicted age, a passive liveness score and a decision statusA face image is processed. The predicted age and the liveness score come back. No date of birth and no document, unless you also run a document check.
Issuer-signed age attribute from a walletAuthenticated, issuer-signed attributes returned by the walletWhatever attributes the wallet releases. A wallet that releases a signed birth date may support age calculation but still disclose the birth date. Inspect which verified attributes were returned.
Proof of a hidden age predicateA proof against a credential from an issuer your verifier accepts, bound to your verifier and to a fresh challengeThe proof can establish that the holder meets the minimum age without revealing the date of birth. The verifier still sees the public inputs and may see request metadata.

Prerequisites

  • A Didit application and an API key from the Business Console. Sandbox keys are free and never charge credit.
  • A decision on the threshold, 18 or 21, and a written retention rule for what you keep after the check.
  • Selfies in tiff, jpg, jpeg, png or webp, maximum 5 MB. PDFs are not accepted.
  • Credit on the organization if you call a live application. A live 200 response consumes one Age Estimation credit.
  • For redirect wallets that use an HTTPS return URL, a return hostname registered on your application before you start a verification.

How to run a privacy-preserving age check, step by step

  1. Write the predicate and the retention rule before you write code. Record the threshold, then decide which decision data your service needs to keep. For a live standalone call with save_api_request set to false, Didit does not persist the call. The request_id is a correlation ID, not a retrievable session ID. Define which decision data your service needs to retain, and apply that policy to your logs and storage.

  2. Create the application and copy the sandbox key. Sandbox keys skip processing and billing: after request validation, the endpoint returns a static Approved payload with an age of 30 and no warnings, and no session is written.

  3. Pick the integration shape. Mode A embeds Age Estimation inside the Liveness step of a workflow, enabled on the Liveness node in the Business Console, and you create the session with POST /v3/session/. Mode B is the standalone POST /v3/age-estimation/ call for when your server already holds a selfie. This guide uses the standalone call because it is the shortest path.

  4. Send the selfie with the privacy-preserving request. save_api_request is false here, so nothing is stored and no webhook fires:

    curl -X POST 'https://verification.didit.me/v3/age-estimation/' \
    -H 'x-api-key: YOUR_API_KEY' \
    -F 'user_image=@./selfie.jpg' \
    -F 'age_estimation_decline_threshold=18' \
    -F 'save_api_request=false'
  5. Know what the default does. save_api_request defaults to true, which persists the call as an API-type session: it appears in the Business Console, the returned request_id is a real session id you can pass to GET /v3/session/{sessionId}/decision/, the face crop and reference image are stored, the face embedding is added to your application's face index, and a status.updated webhook is emitted. Keep the flag at false only if you can work without the console record and the webhook, and retain only the decision data your policy requires.

  6. Read the decision server side, never in the browser. status is Approved only when the warnings array is empty, so treat any warning as a decline. In Mode A the same result lives at liveness_checks[].age_estimation on the Liveness entry, fetched from GET /v3/session/{sessionId}/decision/, not from a top-level array.

  7. Route the borderline cases to a second method. The docs say that borderline ages near your threshold deserve a fallback to document-based verification, because the model error grows for faces close to the limit. A buffer of a year or two is a policy example, not a documented bound: calibrate it against representative live evaluations, because the published mean absolute errors are aggregate metrics, not individual error bounds. A legitimate user whose estimate lands just below the cutoff should go to the fallback, not to an automatic final denial. Inside that buffer, ID document verification costs $0.15. If Google Wallet is supported for the user, it costs $0.10 per completed verification. Grant access only if the final wallet result includes the verified attribute required by your age policy.

  8. Store less. When you do keep a persisted session, the Delete Session API removes the session and its data, and by default the face embedding goes with it. That API applies to persisted sessions: with save_api_request set to false there is no session to delete, and what you hold is only what your own service wrote down.

The age estimation flow greeting the user before the selfie is taken
The user is asked for one selfie. No document is requested and no date of birth is typed.
The selfie being captured and analysed for age and liveness
One frame drives the age estimate and the passive liveness score in the same call.

Expected output

The excerpt below shows only the documented sandbox values for status, predicted age and warnings, nested under the age estimation object. It is not a measured result.

{
  "age_estimation": {
    "status": "Approved",
    "age_estimation": 30,
    "warnings": []
  }
}

In sandbox the call returns a mock Approved with an age of 30 and no warnings, so do not tune thresholds against sandbox numbers. status and warnings are nested under the age_estimation object.

Inputs you send and outputs you receive on POST /v3/age-estimation/
FieldDirectionWhat it does
user_imageInput, requiredThe selfie. jpg, jpeg, png, tiff or webp, maximum 5 MB, no PDF. The largest face in the frame drives the estimate.
age_estimation_decline_thresholdInputThe minimum age you accept. Default 18. A predicted age below it adds AGE_BELOW_MINIMUM.
face_liveness_score_decline_thresholdInputThe liveness floor. Default 30. A score at or below it adds LOW_LIVENESS_SCORE.
rotate_imageInputSet it when captures may be sideways or upside down.
save_api_requestInputDefault true, which persists the call as an API-type session. Set false for a call that nothing is stored for.
vendor_dataInputOptional reference supplied with the request.
request_idOutputThe session id when the call is persisted, a one-off correlation id when it is not.
age_estimation.statusOutputApproved or Declined for a standalone age call. The call approves only when warnings is empty.
age_estimation.warnings[]OutputRisk codes. Any entry means the call is not approved.

Failure cases and recovery

What goes wrong on an age gate and what to do about it
SignalMeaningRecovery
HTTP 400Missing or oversized user_image, or an unsupported extensionFix the file before retrying: re-encode as jpg or png under 5 MB.
HTTP 403Out of credits, or a bad keyTop up the organization, or check the key. The 403 for balance arrives before any image processing.
HTTP 429Over the shared write budget of 300 requests per minute per keyBack off and retry. Do not fan out retries.
AGE_BELOW_MINIMUMThe predicted age is under your thresholdThe API declined this estimate. That is not necessarily a final denial of access. Send the user to the fallback your policy defines, such as an ID document check at $0.15 or, where supported, Google Wallet at $0.10, and keep the appeal path outside the retry loop.
AGE_NOT_DETECTEDThe model could not extract an age, usually a poor imageAsk for a retake with better light and a front-facing pose.
NO_FACE_DETECTEDNo face found by the liveness modelRetake, and check for a cropped or covered face.
MULTIPLE_FACES_DETECTEDMore than one face in the frameAsk the user to be alone in the frame.
LOW_LIVENESS_SCOREThe passive liveness score fell at or below the configured floor, default 30Reject. Do not let a retake loop act as a bypass.
LIVENESS_FACE_ATTACKThe liveness model flagged a presentation attack, such as a photo of a photo, a screen or a maskReject, and log the signal for fraud review.

The full risk catalogue is on the Age Estimation warnings page, and the per-feature report shape is on the report page.

A liveness entry in the Didit Business Console showing the check result for a session
When a call is persisted, the liveness entry in the Business Console holds the age result you audited.

A stronger claim without a document: digital ID wallets

When the person holds a national eID or a bank identity, the wallet route gives you a signed attribute set without a document scan. Your backend starts a verification on that wallet's endpoint, Didit returns the action the person must take, your interface opens the authentication page or shows the approval instructions, and your backend reads the result. For Digital Credentials wallets such as Google Wallet, the start response carries next_action.type = request_digital_credential and the browser runs navigator.credentials.get. Send the wallet's unchanged protocol and data values inside the documented response object. Submit it from your backend with the application API key that started the verification. Didit checks the issuer signature against its trusted issuer roots, every returned value against its signed digest, and the device signature over your origin and this request, then decides.

Two rules matter here. Treat a pending response as pending, because authentication is asynchronous and a successful start does not mean a verified identity. Then only accept the identity when wallet_verification.outcome is verified and simulated is false. Google Wallet ID costs $0.10 per completed verification and is available in the United States, United Kingdom, Brazil, Singapore and Taiwan. The EUDI Wallet rate is published at $0.15 but the wallet is coming soon, and we do not promise a launch date. For redirect wallets, register your return hostname on PATCH /v3/webhook/ before the first redirect. Google Wallet uses its documented Digital Credentials request and response flow. Setup details are in the digital ID wallet documentation and the wallet API reference.

Where zero-knowledge proofs fit, and where they do not

Zero-knowledge age verification has no published Didit price in the supplied sources, and we do not quote one. What we ship is close in intent and different in mechanism: a selfie check that never collects a date of birth, and wallet checks that consume issuer-signed attributes instead of documents.

Setup assumptions, proof size and verification cost depend on the scheme. For an age gate, first check whether the wallet can prove your exact age predicate against a credential from an issuer you trust.

The architecture is three roles, and this route is a separate implementation from the Didit calls in this guide. An issuer signs a credential that contains a date of birth. The user's wallet holds it and generates the proof locally. Your service verifies the proof. The private inputs are the credential, its signature, the date of birth and the holder key. The verifier sends its identifier, the policy cutoff, the verification time and a fresh, expiring challenge. The wallet proves that a credential signed by an issuer under a trusted root contains a birth date on or before the cutoff and a signed validity window that covers the verification time. For a holder-bound credential, the proof also demonstrates control of the key or secret bound to that credential. Bind the proof to the verifier identifier and challenge. Verify the proof against the expected inputs, check revocation through the credential scheme's status mechanism and atomically consume the unexpired challenge before granting access. Zero knowledge protects the private inputs beyond what the statement and the public inputs reveal, so bind the proof to your verifier and to the fresh challenge, or a captured proof can be replayed.

A verifier checklist for the proof route:

  1. Issuer trust: does your verifier hold a trusted root for the issuer that signed the credential?
  2. The exact eligibility cutoff: is the predicate the credential's date of birth is on or before the cutoff the one your policy and jurisdiction actually require?
  3. Holder binding: where the credential supports holder binding, does the presenter control the key or secret bound to it?
  4. Request binding: does the proof bind to your verifier identifier and to a fresh, unexpired challenge, and do you consume that challenge on acceptance and reject reuse even if the proof bytes differ?
  5. Credential validity: is the credential inside its validity window and not revoked?
  6. Replay rejection: do you reject a proof you have already accepted?
Pass and fail examples for a proof-of-age verifier
CasePrivate test setupWhat the verifier seesResult
Birthday boundary under the example policyThe credential's date of birth falls exactly on the eligibility cutoff date in the example policyThe verifier receives the public cutoff, the challenge and a valid proofPass under the example's inclusive cutoff rule. A strict earlier-than comparison would fail this person on their 18th birthday.
Replayed proofThe same proof is presented without the fresh challenge your verifier issuedThe verifier receives a proof that does not bind to the current challenge, or a challenge already consumedFail. Reject it. Zero knowledge on its own supplies no replay protection.
Unsupported issuerThe credential is signed by an issuer outside your trusted rootsThe proof verifies against a credential from an issuer your verifier does not acceptFail. A valid proof under an untrusted issuer establishes nothing for your policy.

Use selfie estimation for routing where your age-assurance requirements permit it. If your policy requires proof from a verified credential or document, obtain that evidence before granting access. Send borderline estimates to an approved fallback. The Sessions API supports hosted wallet verification with configured document fallback. Hosted selfie age estimation is configured on a Liveness step.

Worked cost example

Take 100,000 age gates a month and a policy that sends every borderline face to a document check. Assume 6 percent of users land in the borderline band. That figure is an assumption for this example, not a measured rate.

  • Selfie age estimation: 100,000 x $0.10 = $10,000.00
  • Document fallback: 6,000 x $0.15 = $900.00
  • Total at list price: $10,900.00 per month
  • On the Scale plan, with 10 percent off every Didit price: 100,000 x $0.09 = $9,000.00, plus 6,000 x $0.135 = $810.00, so $9,810.00 in monthly usage at Scale rates before any included plan credit and before the plan fee

Now a wallet-first mix on the same volume. Assume 40 percent of the 100,000 complete a Google Wallet verification at $0.10 and the rest take selfie age estimation, with the same 6 percent document fallback applied to the selfie group. Both assumptions are for the example only; use your own share from live traffic.

  • Wallet verifications: 40,000 x $0.10 = $4,000.00
  • Selfie age estimation: 60,000 x $0.10 = $6,000.00
  • Document fallback: 3,600 x $0.15 = $540.00
  • Total at list price: $10,540.00 per month
  • On Scale: 40,000 x $0.09 = $3,600.00, plus 60,000 x $0.09 = $5,400.00, plus 3,600 x $0.135 = $486.00, so $9,486.00 in monthly usage at Scale rates before any included plan credit and before the plan fee

The wallet route only comes out lower per decision when wallet coverage in your market keeps the fallback volume down. Google Wallet and selfie age estimation share the same $0.10 list price, so the saving comes from fewer alternates, not from the wallet unit price.

Test matrix: what the sandbox proves and what needs a live key

Sandbox validation against live testing for an age gate
TestSandboxLive application
Near-threshold estimateNo. Sandbox returns a static Approved mock with an age of 30 and no warnings.Yes. Run representative faces around your threshold and calibrate your buffer from those results.
Poor image qualityOnly request validation. Malformed input still returns 400.Yes. Watch for AGE_NOT_DETECTED and NO_FACE_DETECTED and confirm your retake copy works.
Insufficient creditNo. Sandbox skips billing entirely.Yes. A 403 arrives before any image processing, so test it on a live key with a low balance.
Wallet result missing the required age attributeNo. Sandbox wallet results carry simulated: true; only a real check reports simulated: false.Yes. Inspect the returned attributes and confirm your policy handles a verified identity that carries no age attribute.

Every live 200 response on the age estimation endpoint consumes one credit at $0.10. Sandbox calls consume nothing and store nothing. A 403 for balance is returned before any image processing. Persisting a call through save_api_request costs the same as not persisting it; the field changes storage, not price.

Human review is a separate decision you own. Define how users can challenge an estimate and which alternate verification method you will accept. The cost example counts only the automated checks and document fallbacks shown. For a regulated product, write the escalation rule down, including what happens when a user claims the model got their age wrong, and keep the appeal path outside the automated loop so a retry cannot be used to force a pass.

We serve 4,000+ companies. Didit supports verification across 220+ countries and territories. We have a SOC 2 Type 2 report and ISO/IEC 27001:2022 certification. Didit's Age Estimation documentation reports a mean absolute error of 1.1 years at ages 16 and 17 and 1.9 years at ages 18 to 20. The same documentation reports 96 percent aggregate accuracy for under-18 versus 18-and-over classification. Those are aggregate model metrics, not an error bound for any single person.

Sources

Next step: create a free sandbox application at business.didit.me, validate the request and response handling against the sandbox mock, then wire a live key for production. No sales call required.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

What is age zk?

Age zk means proving an age condition, such as being 18 or older, in zero knowledge, so the verifier learns only whether the condition is true. The prover holds a credential with a date of birth and proves that the date is on or before the eligibility cutoff. The proof hides the date of birth, but the verifier still sees the public inputs and may see request metadata.

Can Didit run a zero-knowledge age verification today?

The Didit integrations documented here are selfie age estimation and signed wallet-attribute verification. The zero-knowledge proof design in this guide requires a separate implementation, and no published Didit price for it appears in the supplied sources. Selfie age estimation costs $0.10 per live HTTP 200 response with passive liveness included.

How much does a privacy-preserving age check cost?

Standalone selfie age estimation costs $0.10 per live HTTP 200 response and includes passive liveness. A Google Wallet verification is $0.10 per completed verification and an ID document check is $0.15. Growth takes 4 percent off Didit prices and Scale takes 10 percent.

Does the selfie age check store the user's face?

By default save_api_request is true: the face crop and reference image are stored, the face embedding joins your face index and a status.updated webhook fires. Set it to false and Didit does not persist the call, the request_id becomes a correlation ID rather than a retrievable session ID, and no webhook fires. Your own logs and storage still follow the retention policy you wrote.

Is selfie age estimation accurate enough for an 18+ gate?

Didit's Age Estimation documentation reports a mean absolute error of 1.1 years at ages 16 and 17 and 1.9 years at ages 18 to 20. The same documentation reports 96 percent aggregate accuracy for under-18 versus 18-and-over classification. Those are aggregate metrics, not a per-person error bound. That is enough to route traffic and not enough to be legal proof of age on its own, so send borderline faces to a document or wallet check.

What if the model says a user is 17 and they are really 18?

For a live call with the minimum age set to 18, a predicted age below 18 adds AGE_BELOW_MINIMUM and the status is Declined. That is an API decline, not a final denial of access. Send the user to the fallback your policy defines: an ID document check at $0.15, Google Wallet at $0.10 where supported, or a manual route. Keep that appeal path outside the automated retry loop so a retry cannot force an approval.

Can I verify age without a selfie at all?

You can verify age without a selfie if the supported wallet returns a verified attribute sufficient for your age policy, and you should check the final result for that attribute before granting access, because a completed wallet identity check alone does not establish age. Google Wallet is available in the United States, United Kingdom, Brazil, Singapore and Taiwan at $0.10 per completed verification. The EUDI Wallet has a published $0.15 rate and is coming soon, with no launch date promised.

Is age estimation the same as ID verification?

No. Age estimation predicts an age from a face and never reads a document, so it cannot confirm a name, a nationality or an identity. ID verification processes a document at $0.15 and may disclose personal data, which is a different privacy trade. Pick based on what the regulation actually requires you to know.

Does this meet GDPR data minimisation?

Turning off Didit session persistence reduces the data Didit retains for a standalone age check. The service still processes a face image. Assess whether that processing is necessary, identify the applicable lawful basis, and set retention limits for any decision data your service keeps. Data minimisation under the GDPR is about collecting what you need for the purpose, so the boolean you keep needs a lawful basis and a retention period of its own.

How do I delete a user's age verification data?

Call the Delete Session API with the session id. It deletes the session and its data, and by default the face embedding goes with it; applications that opted in can keep an image-free biometric template instead. The Delete Session API applies to persisted sessions, so a call made with save_api_request set to false has nothing to delete on our side.

Can I run age estimation inside a workflow instead of the standalone API?

Yes. In hosted flows age estimation is embedded inside the Liveness step, so you enable it on the Liveness node in the Business Console, set the decline threshold, create a session with POST /v3/session/ and read the result at liveness_checks[].age_estimation from the decision endpoint. There is no separate age estimation workflow feature.

Can a coding agent do the integration for me?

Yes. The integration prompt gives a coding agent the endpoint, the fields and the failure modes in one paste, and the Didit MCP server lets an assistant call the platform directly.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.