PUBLISHED •

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 ChinthakayalaIdentity Systems Architect, VaahanSafe
1,900 WORDSSTANDARDS-ALIGNED
The Dual-Layer Identity: How Physical QR Pairs with Digital Security
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
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 Identifier`vs_8f4k9a21` (High-entropy nanoid)D1 Unique Indexed ColumnPUBLIC: Encoded into physical QR URL (`qr.vaahansafe.com/vs_...`)
3. Activation Secret ProofConcealed 6-to-8 digit scratch PINStored as salted SHA-256 hashPRIVATE: Concealed under scratch foil; never stored in plaintext

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 scratches the security foil to reveal the private PIN. The server computes `SHA-256(PIN + Salt)` and verifies it against D1. Rate-limiting protects against brute-force guessing.

04

Atomic Vehicle Binding & Entitlement Grant

ACTIVE

Upon proof match, an atomic D1 transaction transitions the decal to `ACTIVATED`, binds it to the user's verified vehicle plate, creates service entitlements, and enables live emergency routing.

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
Confirm that your public safety view is live immediately after binding
OPERATIONAL EDGE CASES • FREQUENTLY ASKED QUESTIONS

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

Nothing. Because the physical QR only encodes the public ID (`vs_xxxx`) and NOT the activation secret, photographing the code grants zero ownership rights. The sticker cannot be activated without scratching the physical foil to reveal the one-way hashed PIN.

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.

STATUTORY REFERENCES • VERIFIED LEGAL SOURCES (2)
GOVT & STANDARDS ARCHIVE
  • ISO/IEC 18004 — Information technology automatic identification and QR code techniques

    Standards for physical symbology generation and alphanumeric URL encoding

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

    Transactional ACID guarantees and edge read-replica replication across India

    Source: cloudflare.com
#Product Architecture#Cloudflare D1#Dual Layer#QR Security#State Machine
OFFICIAL PRODUCT SPECIFICATION
Technical Architecture & Security Whitepaper

Canonical reference guidelines and regulatory specifications under VaahanSafe Documents.

Open Reference
ABOUT VAAHANSAFE

Learn how the vehicle safety identity works.

Industrial UV-cured optical decals connecting bystanders directly to your emergency contacts without exposing private phone numbers or home addresses.

Explore VaahanSafe
CONTINUE / JOURNAL