← Projects

Case study · KYC platform · Ledgercross · 2026

Veritas

A KYC and identity-verification platform: a hosted link in, a signed decision out.

role
Software developer on a multi-person team at Ledgercross
year
2026
status
Confidential not public
stack
fastapireacttypescriptpostgresqldockergoogle cloudterraform

A business that has to verify identities needs to do three things: read an ID document, confirm that the person holding the phone is the person on the card, and check they are physically there. Then it has to decide, without paying for the most expensive check on every applicant, and without quietly rejecting people whose ID photo is ten years old.

One verification, start to finish

  1. triggerA customer creates a sessionTheir backend asks for a hosted verification link.
  2. actionThe applicant captures their ID and a selfieConsent, an auto-captured document and a short selfie burst; images upload straight to storage.
  3. actionDocument fields are extractedCheapest method first, escalating only when needed.
  4. actionLiveness and face matchOnly frames that pass spoof checks are compared with the document portrait.
  5. conditionThe decision engine applies the level’s thresholdsThe face-match approval threshold is relaxed when the document portrait is old; borderline matches go to review, and a session can still be approved, reviewed or declined.
    • approve
    • review · operator queue
    • decline
  6. resultA signed webhook goes outSigned by the API, then delivered and retried by a queue; operators resolve reviews in the dashboard.
A verification session, from capture to decision.

My part

I worked on Veritas as one developer on a team at Ledgercross. Early on I built prototype work for document-image preprocessing, scene detection, face verification and liveness. Later I worked on the native iOS document and liveness capture SDKs, the web capture gate, and verifying the macOS and Android SDKs.

Decisions that shaped it

Compute runs on Cloud Run, which scales to zero, rather than on Kubernetes, with infrastructure in Terraform. Idle compute costs almost nothing, and capacity follows demand. It was designed to support more than ten million users a month; that is design capacity, not traffic it has served.

Faces are matched against a portrait cropped from the perspective-corrected document. Only selfie frames that pass presentation-attack scoring may supply the match score, and first-time applicants must complete a randomised active liveness challenge in the hosted flow. A returning applicant whose fresh selfie matches their earlier approved session can skip it, while passive liveness still applies. The MVP stored its data in Firestore; PostgreSQL on Cloud SQL replaced Firestore as the application store.

The extraction ladder

Reading the document is where cost can quietly run away, so extraction climbs a ladder and stops as early as it can. A wrong document fails fast after the first OCR pass, before escalating to the costlier tiers.

  1. 01Document AI OCR always
    • Deterministic machine-readable-zone checksums decide whether the result is trusted.
  2. 02Gemini on gate fail
    • Schema-locked output, with guards against instructions hidden in the image.
  3. 03Dedicated ID processor if earlier tiers fail
    • When configured for the document type, the final arbiter for documents the earlier tiers could not read, and the most expensive step.

The system

    • clientBrowser captureThe hosted capture page: React and TypeScript in the browser.
    • clientOperator dashboardReviews, analytics and settings for the customer’s team.
    • clientCustomer backendCreates sessions and receives decisions; calls the API directly.
  1. edgeHosting and CDNServes both web apps and routes their calls to the API.
  2. serviceAPI on Cloud RunPython and FastAPI: sessions, decisions, signed webhooks. It calls out to each of these:
    • storageCloud StorageID and selfie images, uploaded straight from the browser.
    • dataPostgreSQLOn Cloud SQL, the application store.
    • modelsDocument AI and GeminiThe extraction ladder above.
    • serviceFace serviceCloud Run: portrait, liveness and matching with InsightFace, ONNX Runtime, OpenCV and MiniFASNet.
    • queueCloud TasksDelivers and retries HMAC-signed webhooks to the customer backend.
The system, redrawn: browser capture and the operator dashboard reach the API through hosting; the customer backend calls it directly. The API calls out to storage, the database, the models, the face service and a webhook queue. Cloud Run compute scales to zero; infrastructure is Terraform, deployed by CI on merge.

The dashboard

Veritas operator dashboard, Analytics page: bar charts and breakdowns of decision mix, document types and risk distribution.
Operator analytics, cropped to the decision-mix, document-mix and risk panels. Seeded test data, not production traffic.

Results

  • 10M+

    Monthly users the platform is designed to supportDesign capacity, not measured production traffic.

  • ≈ $0.009

    Typical cost per verificationAn estimate from the code paths and Google’s published rates (August 2026), for one person and one ID card, assuming most documents stop at the first rung. Not a billing figure.

The platform is confidential, so there is no link to it. What I’d keep from it is the habit of the ladder: do the cheap, checkable thing first, and spend only when it fails.