Serial numbers on stamps, and how to get them wrong
13 August 2026 ยท Estamplab
A stamp without a serial is the same mark every time. Nothing distinguishes the third impression from the first, and nothing distinguishes a copy from an original.
A serial changes that, but only if the number is actually unique. Most implementations are not, and the failure is silent.
What a serial is for
Three things, usually:
Traceability. Certificate 000418 can be found in a register. "A certificate" cannot.
Detecting duplication. Two documents bearing the same serial means one of them is a copy, and you know to look.
Sequence. Gaps are visible. If your register runs to 512 and the last document issued was 498, something happened to fourteen impressions.
None of that works if the number can repeat.
The three ways counters break
A counter in the browser. The most common approach: store the last number in local storage, add one each time. It works perfectly on one device and knows nothing about any other. Open the tool on a laptop and a phone and both will hand out 000042. Clear your browsing data and the counter starts again from one, silently reissuing everything.
A counter read then written. Read the current value, add one, write it back. Two tabs doing that at the same moment both read 41, both write 42, and two documents leave with the same number. This is a race condition, it is rare enough to look like it works, and it fails exactly when volume is highest.
A counter you type yourself. Fine until the day somebody is not paying attention, and impossible to audit afterwards because there is no record of what was issued.
What a counter actually has to guarantee
Atomicity. Read and increment must be one indivisible operation. In Postgres that means a row lock on the stamp own record: the second request waits for the first to finish rather than reading a stale value.
Durability. The number survives a cleared browser, a new device and a new machine. That means it lives on a server, which is the honest reason this cannot be a purely client-side feature.
Scope. Each stamp gets its own sequence. Your certificate stamp and your received stamp should not share a counter, or the certificate register has holes in it wherever the mailroom was busy.
Monotonicity. It only ever goes up. A counter that can be reset is a counter that can reissue, and a reissued serial is worse than none because it looks trustworthy.
Formatting
Worth deciding once:
- Padding. 000042 rather than 42. Fixed width sorts correctly and looks deliberate.
- A prefix. CTC-000042 for certified true copies, RCV-000042 for received. When two registers meet in one file, the prefix says which is which.
- Year segments. 2026-000042 restarts each year, which suits some registers and ruins others. Decide before you start, because changing it later leaves an ambiguous stretch.
- Not the sequence itself as a secret. A serial is a reference, not a password. Anyone can guess 000043. If something needs to be unguessable it needs a different mechanism.
Where a serial does not help
A serial proves nothing on its own. It is a label, and a label can be copied along with everything else on the page. What it gives you is the ability to notice: to compare an impression against a register and find that the register says something different, or says nothing at all.
That means the register is the actual control. A serial with nothing recording what each number was issued for is decoration with better typography.
The short version
Printing a number on a seal is easy and every tool can do it. Guaranteeing that number is never issued twice needs a counter that is atomic, durable and scoped to the stamp, which means it needs a server.
If numbered impressions matter in your process, that distinction is the whole feature. Ask where the counter lives.