← Projects

Case study · Ledgercross · 2026

LedgerScan

Scan a product, get a counterfeit-risk verdict, around 0.3 s per scan as reported for the product.

role
Software developer on a multi-person team at Ledgercross
year
2026
status
Live
links
led-scan.com (opens in new tab)
stack
reactfastifyfastapipythonsupabasekeycloaksoliditydocker

A printed code on a box is easy to copy. Once a counterfeit carries a cloned code, a simple lookup still answers “genuine”. What a brand actually needs to know is whether this particular scan makes sense: where the product was meant to go, who is scanning it, and whether the same code is turning up somewhere else at the same time.

What happens when someone scans

  1. triggerA consumer scans a productThe product code arrives with device and location context.
  2. actionNearby authorised hubs are listedThe consumer confirms where they bought it, and that choice joins the scan’s fingerprint.
  3. actionThe product’s on-chain state is readThe expected hub and lifecycle stage of its digital twin.
  4. conditionThe risk engine checks for a triple matchSelection against the ledger, selection against location, and whether the device and connection look sane. It also looks for the same code active in two places.
    • trusted · confirmed
    • high risk · flagged
  5. resultA verdict comes backThe consumer sees the verdict and it is saved against the product; high-risk units are flagged for the brand. On-chain state changes come from hub and enterprise scans.
The scan path, from phone to verdict.

How it fits together

I worked on LedgerScan as one developer on a team at Ledgercross. My part, as the repositories show it, was the authentication setup with Keycloak, the Docker configuration and one-command local run, the superadmin dashboard, container tracking, manufacturer insights with regional scan views, and improvements to the store dashboards.

The idea underneath is simple. Every physical unit gets an on-chain identity, a digital twin whose state follows it through the supply chain, so the expected route is written down somewhere nobody can quietly edit. Scanning devices at logistics hubs are bound to their hub, which makes hub impersonation harder.

A React frontend talks to a Node.js gateway built on Fastify. The gateway handles routing, persistence in Supabase (PostgreSQL with row-level security per tenant) and the blockchain transactions, and for every scan it asks a separate Python risk engine, built with FastAPI, for a score. Keycloak handles identity, and everything runs in Docker.

A product’s life, step by step

  1. 01Register and mint identities manufacturer
    • A batch of serials is registered as digital twins on-chain.
  2. 02Move through authorised hubs logistics
    • Hub devices are bound to their hub.
    • Each hand-off updates the unit’s state on the ledger.
  3. 03Consumer verification retail
    • The scan is scored by the risk engine.
    • The result is saved against the product in the database; consumer scans don’t write to the chain.
  4. 04Dashboards for each role operations
    • Manufacturer insights and regional scan views.
    • Store and superadmin dashboards.

Results

  • ~0.3 s

    Per counterfeit-risk verdict, as reported for the productFrom product copy, not a benchmark I ran.

  • 3

    Continents where the product reports verificationAs reported by the product; I haven’t published the underlying data.

  • Live

    In production at led-scan.com (opens in new tab)Public product site.

What I took from it: a counterfeit check is less about the code and more about context. The code is the easy part to fake; the route it took, and the place it is scanned, are much harder.