← Back to home

Architecture

Veymark

Physical proof that cannot be copied. A cryptographic chip on each part, plus a digital passport minted per unit on Solana.

1. The problem

Every anti-counterfeit measure in common use today, QR codes, serial numbers, holograms, is defeated with a camera and a printer. Photograph the label, reprint it, apply it to the counterfeit. Verification passes because the code is identical.

Counterfeit goods account for USD 467 billion of world trade. In auto parts alone, Europe loses over EUR 4 billion a year, and the most counterfeited items are bulbs, bearings and shock absorbers: safety components, where a failure costs more than a margin.

What the system promises, and the limit it states: we do not claim this is impossible to fake, and we never will. Any verification screen can be cloned, including ours. What Veymark removes is the easy attack. What remains is building a parallel fake ecosystem, with its own tags, its own site and its own distribution, which is expensive, traceable and prosecutable.

2. The numbers

Counted in the repository. Most of the tests are rejection cases, not happy paths.

61
tests, most of them rejection cases
14
tests for the SUN tag cryptography alone
17
tests for sealed assemblies
12
tests for catalog slot declarations
11
tests for the on-chain Anchor program
7
tests for seal position validation
10
migrations
3
independent proofs, each failing on its own
3
verification states, and the second one is a product decision
AES-128
plus a truncated CMAC, per tap, with a read counter

Devnet deployment

Program

9tCeoRVp4MRZTM6hxtJp2Nd797i1Mf2JbwLgXE6JFZcp

Merkle tree

3uvL6ntvFq1iqBoNnEjPymcD6TQP1suTqjQFy7sam9hk

First passport

E3FMgTHkTQQCPpswhxZ712o7Sr5T6H1g41ypvJvTrK8d

Solscan does not index compressed NFTs on devnet. Inspecting passports requires the DAS API or an explorer with DAS support.

3. The design

Three independent proofs. None of them is the defence on its own, and each one fails independently without taking the others down.

NTAG 424 DNA tagtapBrowser on the phoneno app, no wallet, no account1. Proof of siliconNXP factory signatureverified on the phone, no server2. Proof of touchSUN: UID and counter, AES-128truncated CMAC, replay rejected3. Proof in the opencNFT passport on Solanacheckable without trusting usAuthenticcryptography validatedCould not verifynever "counterfeit"Unusual patterncryptography passed,behaviour did not

The first proof never reaches the server: the NXP chip's factory signature is verified on the phone itself. The second is real cryptography in the backend, with replay rejected by the counter. The third is the only one that does not depend on our infrastructure: the passport is on Solana and anyone can check it against the manufacturer's public wallet.

Verification needs no app, no wallet and no account. The tag opens a URL in the browser and the answer appears.

The hard case: sealed parts

A tag on a battery proves the case. It says nothing about the cells inside, so a workshop can open it, swap the internals and close it again with the tag still reading as authentic.

Two things answer that. The tag is applied across the opening, so opening the case tears the antenna and the part stops answering. The position is recorded, because a part sealed across the opening but recorded as a surface tag would tell the buyer that a torn antenna proves nothing. An unrecognised position is refused rather than assumed.

And the components inside carry their own tags, recorded as belonging to that case. A product declares what belongs inside it and which product fills each slot, so attaching the wrong part is refused rather than recorded. A slot cannot be removed once real parts are recorded in it: that would erase the record of what is inside cases already shipped.

4. The decisions

Every decision has a price. Below is what I chose, what I rejected, why, and what it costs.

01. Three independent proofs instead of one strong check

Chose
Proof of silicon on the phone, proof of touch with cryptography in the backend, and proof in the open on-chain. Each one fails on its own.
Over
A single well-built verification.
Because
A defence that depends on one mechanism falls entirely when that mechanism falls. With three independent layers, breaking one does not hand over the system, and an attacker has to solve three problems of different natures at once.
Price I pay
Three systems to maintain, three failure surfaces, and more to explain to someone who only wants to know whether the part is genuine.

02. Compressed NFTs on Solana, and that is why it is Solana

Chose
One passport per unit, minted as a compressed NFT with Metaplex Bubblegum.
Over
A database record, a regular NFT, or another network.
Because
A passport per individual unit only adds up where minting costs close to nothing. On most networks the issuance cost alone restricts this to luxury goods. The choice of network here is not a preference, it is what makes the model possible at all.
Price I pay
Compressed NFTs need the DAS API to be read, and Solscan does not even index them on devnet. The promise that anyone can check depends on tooling not everyone has.

03. The second state is "could not verify", never "counterfeit"

Chose
Three states: authentic, could not verify, and unusual pattern.
Over
Two states, genuine or fake.
Because
A damaged tag and a fake tag are indistinguishable to software. Accusing a legitimate buyer is a worse failure than admitting uncertainty, because it destroys trust in the whole system and creates a problem the company cannot undo.
Price I pay
The answer people most want, whether the part is fake, is exactly the one the product refuses to give.

04. An unrecognised seal position is refused, not assumed

Chose
If the recorded position is not recognised, the part does not enter the system.
Over
Falling back to a sensible default.
Because
A part sealed across the opening but recorded as a surface tag would tell the buyer that a torn antenna proves nothing. A wrong default here does not produce a visible error, it produces a confident wrong answer, which is the worst possible outcome.
Price I pay
Provisioning fails more often, and whoever applies the tag has to record the right position or the part simply does not enter.

05. A slot cannot be removed once real parts are recorded in it

Chose
The catalog accepts additions and refuses to remove a slot that already holds a real part.
Over
Letting the catalog be edited freely.
Because
Removing it would erase the record of what is inside cases already shipped, which are out in the world and cannot be corrected. The catalog here does not describe an idea, it describes physical objects that already left the factory.
Price I pay
The catalog accumulates slots that may become obsolete, and a modelling mistake becomes permanent.

06. Tag keys encrypted at rest

Chose
Keys are encrypted with a 32-byte master key, so a database dump alone cannot forge taps.
Over
Storing the tag key directly in the table.
Because
A database leak is the most common incident there is. With the key in the clear, whoever took the dump can issue valid taps forever, and none of the other layers would notice.
Price I pay
The master key becomes a single point of failure. Losing it means no existing tag can be verified again.

07. A tag simulator instead of waiting for hardware, with the limit stated

Chose
A simulator generates the same payloads a real tag emits: same AES-128, same PICCData layout, same incrementing counter. The backend performs real cryptographic validation, real CMAC verification and real replay rejection.
Over
Either returning a mock response, or blocking the project until tags arrive.
Because
The cryptography can be built and proven correct before any silicon exists. A mocked response would prove nothing: only simulating the generation side exercises the real verification path.
Price I pay
The byte layout has not been validated against physical silicon. The implementation follows NXP application note AN12196, and the tests prove that generation and verification agree with each other, not that either matches a real chip. When hardware arrives, only the generation side is replaced.

5. What breaks

The README itself states that nothing has shipped and that tags are simulated. What follows is what is still unresolved.

The byte layout has not been checked against real silicon

This is the biggest gap and it is stated in the README. The suite proves that generation and verification agree with each other, and proves that wrong keys, forged signatures and tampered payloads are rejected. It does not prove the format matches what an NTAG 424 DNA actually emits. Only the first physical tag answers that.

The verification screen can be cloned

A fake tag pointing at a fake site will show authentic. The only defence is the on-chain record, which does not depend on Veymark's infrastructure, and it only works if the buyer actually goes and checks. Most will not.

The master key is a single point of failure

It protects against a database dump, and it concentrates all the risk in one place. There is no rotation, no split custody, and losing the key invalidates verification for every tag ever issued.

Unusual pattern needs volume to exist at all

Detecting the same part appearing in distant places minutes apart depends on there being enough taps. Early on, with few reads, that signal simply does not exist, and the unusual-pattern state is inert precisely when the system is most fragile.

Seal position depends on whoever applies the tag

The system refuses an unrecognised position, and has no way to detect a tag recorded as crossing the opening that was in practice stuck on the surface. The sealed-part guarantee rests on a human process on the production line.

Reading on-chain depends on DAS

Compressed NFTs are not readable by ordinary explorers. If the DAS provider goes down or changes, the check-it-yourself path breaks for most people, and all that is left is Veymark's word, which is exactly what the project exists to avoid requiring.

6. What I would change at 100x

Scenario: millions of tagged parts, several manufacturers in the same installation, and peaks of thousands of taps per second.

What survives unchanged

The three proofs. Silicon verification happens on the phone and never touches the server, so it scales on its own. And one passport per unit stays viable because compressed minting was chosen for cost in the first place, not for small volume.

What breaks first

Issuance. One NFT per unit means a line producing 10,000 parts an hour needs 10,000 mints an hour, and a Merkle tree has a fixed depth. Tree capacity runs out before anything else goes wrong.

In the order I would change them

  1. 1

    Batch minting and multiple Merkle trees, one per manufacturer or per production batch, so capacity is planned rather than discovered on the day a tree fills up.

  2. 2

    Split the hot read path. Every tap writes the counter, so a write per tag is unavoidable, but it shards naturally by tag identifier. Passport reads move to an indexed copy, with the chain still the source of truth and still the check-it-yourself path.

  3. 3

    Take DAS out of the common path and keep it for the audit path. Anyone who wants to verify independently still goes to the source; anyone who just wants the answer gets it from the copy, with the on-chain record shown alongside for whoever wants to follow it.

  4. 4

    Treat unusual pattern as a stream problem, not a query. The same part appearing in distant places within minutes needs time and space windowing over millions of reads, which is not something you run per request. That becomes continuous processing, with the result written before anyone asks.

This page describes the system as it stands today. Nothing has shipped, everything runs on devnet and the tags are simulated. The physical tags have been sourced and none have been ordered.