Skip to content

The field note · 7 min read

The Dual-Layer Identity: How Physical QR Pairs with Digital Security

Hardware stickers and software credentials must remain strictly separated. Here is the cryptography, state machine, and edge routing powering the platform.

Eswar ChinthakayalaUpdated 3 Oct 2026
VaahanSafe Editorial Image for dual-layer-identity-architecture
In this story

Traditional automotive identifiers like engraved chassis plates, plastic keychains, or laminated cards suffer from a fundamental vulnerability: they cannot be dynamically revoked, transferred, or privacy-gated. If a static sticker contains encoded personal data, that data is permanently compromised the moment the car is sold or parked in public. VaahanSafe implements a dual-layer cryptographic state machine that strictly decouples physical inventory from authenticated digital ownership.

1. The Four Decoupled Domain States

In naive QR implementations, systems use a single boolean `is_active = true`. This is an architectural failure. VaahanSafe enforces four completely decoupled states across all relational schemas:

A. Payment State

Authoritative confirmation of financial transaction (`PENDING`, `PAID`, `FAILED`, `REFUNDED`). Governed exclusively by server-verified Cashfree signed webhook signatures. A paid order does not imply physical delivery or active service.

B. QR Lifecycle State

Tracks the physical sticker hardware (`INVENTORY`, `DISTRIBUTED`, `ASSIGNED`, `ACTIVATED`, `REPLACED`, `RETIRED`). A physical decal exists in warehouse inventory long before any user purchases it.

C. Entitlement State

Authoritative service capabilities (`DIGITAL_QR_ACCESS`, `SAFETY_VIEW_ACTIVE`, `EMERGENCY_ROUTING`). Entitlements require satisfying both the acquisition gate (verified payment OR verified retail activation) and verified vehicle ownership.

D. Subscription State

Optional plan-backed functionality (`TIER_FREE`, `TIER_STANDARD`, `TIER_PREMIUM`). Decoupled so that renewing or lapsing a subscription never corrupts physical decal identity.

2. The Three-Identifier Security Boundary

Under the VaahanSafe security charter, three values must never be collapsed or derived from each other:

Identifier Separation & Exposure Matrix
Identifier Separation & Exposure Matrix
IdentifierFormat / ExampleStorage LocationPublic Exposure Rule
1. Internal Database ID`qr_9x2k41b08f`Cloudflare D1 Primary KeySTRICTLY PRIVATE: Never returned to client DOM or URLs
2. Public Opaque IdentifierCryptographically random, non-sequential valueD1 unique indexed columnPUBLIC: Encoded into the physical resolver URL
3. Activation Secret ProofSeparate private claim credentialServer-side one-way verificationPRIVATE: Never encoded in the QR or exposed by the resolver

3. Cryptographic Retail Activation Flow

When a customer purchases a retail package from an authorized distributor or dealership, the physical decal is in an inert `DISTRIBUTED` state. Scanning the decal reveals only an unactivated registration portal. Service enablement requires satisfying an atomic, server-verified verification handshake:

01

Public ID Resolution

RESOLVE

The user scans the QR code; the browser resolves `qr.vaahansafe.com/{publicId}`. The edge worker confirms the decal exists in inventory and is eligible for initial claiming.

02

Owner Authentication & Mobile Gate

AUTH

The user must authenticate with a verified Indian mobile number (+91) via real MSG91 SMS OTP. Anonymous or guest activations are prohibited.

03

Concealed Secret Proof Verification

CRYPTO

The user reveals the separate private proof and enters it in the official activation flow. The server verifies it securely and limits repeated attempts.

04

Atomic Vehicle Binding & Entitlement Grant

ACTIVE

After proof and ownership checks, the server must atomically claim the QR, bind it to the authorized vehicle and grant only the services available for that vehicle.

RETAIL ACTIVATION SECURITY VERIFICATION
✓Verify physical packaging is intact with untampered scratch foil
✓Confirm the public URL matches official `qr.vaahansafe.com` domain
✓Authenticate using your primary phone number to receive MSG91 OTP
✓Reveal the scratch PIN only when ready to bind to your vehicle
✓Verify your vehicle license plate and make/model details before confirming
✓Check the resulting QR and service status in your account after binding
Common questions

What happens if someone photographs my retail QR before I buy it?

A photograph of the public QR is not proof of ownership. The QR contains a resolver identifier, while activation requires a separate private proof, a verified account and an authorized vehicle connection.

Can an activated decal be stolen and re-registered to another vehicle?

No. Once bound to a vehicle in Cloudflare D1, the activation secret is marked as consumed. Any attempt to re-activate the decal returns an error. Only the authenticated legal owner can reassign or replace the decal through their verified customer dashboard.

Sources & further reading (2)
References
  • ISO/IEC 18004 — Information technology automatic identification and QR code techniques

    Standards for physical symbology generation and alphanumeric URL encoding

    iso.org
  • Cloudflare D1 & Workers Relational Data Architecture Documentation

    Transactional ACID guarantees and edge read-replica replication across India

    cloudflare.com
#Product Architecture#Cloudflare D1#Dual Layer#QR Security#State Machine
ABOUT VAAHANSAFE

Learn how the vehicle safety identity works.

Discover how a QR connects a vehicle to the safety information its owner chooses to make available.

Explore VaahanSafe

Keep reading