AWS Builder Center
Building TrustMint: a forge-proof document engine on AWS in 4 days

Building TrustMint: a forge-proof document engine on AWS in 4 days

First Commit hackathon (Bharat Builds, WeMakeDevs × AWS) — Team METIS

First Commit hackathon (Bharat Builds, WeMakeDevs × AWS) — Team METIS

Four days ago I'd never opened the AWS console. Today TrustMint is live: a serverless, AI-checked, tamper-proof document system running entirely on AWS. Here's how we built it — and everything that fought back.

The problem

India has a forgery problem in every sector. Prescriptions for controlled drugs get reused and photocopied. Degree certificates are faked at scale. Tickets and IDs get duplicated. The root cause is always the same: documents exist as static files or templates that anyone can copy.

The idea: Just-In-Time documents

What if a document doesn't exist until the exact moment it's needed? You can't forge something that isn't there yet.
TrustMint mints each document just-in-time: a unique cryptographic signature and QR are generated on issue, the record is stored with an expiry, and it can be verified only under its own rules — one-time use, or time-limited. Once used, expired, or revoked, it's dead.
The decision I'm proudest of: it's one generic engine, and a document type is just configuration. Prescriptions, certificates, tickets, invoices, event passes, and ID cards all run on the same code. Adding a new type is a row in a registry — no new code, no redeploy.

Architecture (all serverless)

  • AWS Lambda — six functions: create, verify, revoke, dashboard, pdf, history
  • API Gateway (HTTP API) — REST endpoints with request throttling
  • DynamoDB — a type registry, the documents table with native TTL auto-expiry, and a verification audit log
  • Amazon Bedrock (Nova Lite) — real-time AI checks: dangerous drug-interaction flagging on prescriptions, content validation on certificates
  • HMAC signing — every document is signed, so tampering with a stored record fails verification
  • AWS SAM — infrastructure as code
  • AWS Amplify — hosting the React (Vite) frontend

What fought back

AWS account KYC limbo. My brand-new India account got stuck in identity verification for hours. So I built and tested the whole engine locally and deployed the moment it activated. Lesson: don't let account setup block you.
A 500 that lied to me. Every  /create  call threw "Internal Server Error." The logs revealed it: API Gateway was handing Lambda a base64-encoded body, so  json.loads  choked. One  if event.get("isBase64Encoded"): base64.b64decode(...)  fixed it.
Region roulette with Bedrock. Model access is region-specific. Nova Lite wasn't in ap-south-1, so I enabled and called it in us-east-1 while the rest of the stack ran in Mumbai.
Build gremlins.  sam build  wanted a specific local Python version, and later a stripped execute-bit on the  vite  binary — fixed by running it through  node  directly.

What I learned

Serverless from zero in a weekend: Lambda, DynamoDB single-table design and TTL, API Gateway, Amazon Bedrock via the Converse API, HMAC-based integrity, SAM deployments, and shipping a React frontend on Amplify.

What's next

More document types (contracts, land records), a proper AWS Cognito auth layer (the current role-based login is a demo layer, architected for it), and asymmetric-key offline verification.

Links

Built with help from Claude (Anthropic). Document AI checks run on Amazon Bedrock (Nova Lite).
#BharatBuilds


Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article