Build1 distinct publisher3 min readUpdated
A dev.to invariant list treats each code as a single-use challenge with server-side authority. The published storage interface counts resends but never counts wrong guesses.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The load-bearing artefact in this design is the event log, not the code generator. The write-up wants a reviewer able to follow issued, attempted, suppressed and verified events for one login without trusting a client timestamp [13], and the same record is what gives support a correlation ID and tells a reconciliation job what "one send" actually means [12]. That is the difference between a duplicate tap being a billing question and a billing dispute.
The race that makes it necessary is ordinary latency. Two requests carrying the same idempotency key arrive 40 milliseconds apart while the first worker is still blocked on the carrier adapter; the first reserves the challenge and the intent, the second reads that reservation and returns the same opaque identifier, and no second code is minted [10]. Verification is the mirror image: consuming the challenge has to be atomic, so two concurrent verifies cannot both win [5].
Now the arithmetic the invariant list does not do. The Go sketch mints six random digits and sets expiry five minutes out [15]. That is a million candidates, so a guesser needs roughly 500,000 tries for even odds, about 1,700 verify calls per second inside the 300-second window [1]. Comfortable, until you read the storage interface: it offers Create, Consume and CountResends, and nothing that counts failed verifications [2]. A resend cooldown and a rolling budget govern the request side [6]. They do not slow a guesser at all. If the client never decides whether a code is valid [4], the attempt ceiling has to live server side too, per challenge and per recipient, or the keyspace is the only control in the system.
Suppression is where the money failure and the privacy failure share a path. The article checks the suppression list before dispatch and again when delivery feedback is ingested, which is what catches bounces, reassigned numbers and manually blocked recipients [7]. The recycled number is the case worth writing down first: the code reaches whoever holds the handset now, and a recycled number sits alongside duplicate taps and delayed carrier messages as a route into account enumeration or SMS bombing [3]. Delivery feedback is the only evidence you get that a recipient moved, so one check before send is a check against a stale list.
Client-side OTP state is rejected for the reason you would expect: a rooted device can edit its clock or replay a request [8]. The concession is honest, though. It survives in an offline puzzle where validity carries no security meaning [8].
The response shape does real work here as well. Suppressed recipients, over-budget recipients and a storage failure all return the same generic accepted response [16], which pairs with a generic verify failure so the endpoint never reveals whether a number has an account [9]. The price is that callers stop being an information source. If the endpoint answers identically in every direction, your only view of abuse is the audit stream, which is where this design put it to begin with [1].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
The author's short answer: model each SMS OTP as an auditable challenge that can be consumed once, and make the server, not the mobile screen, the authority for expiry, autofill acceptance, repeat-request limits and recipient suppression.
The server creates a challenge with a random short-lived code, stores only a salted hash, and binds the challenge to a normalized recipient plus a login intent; the client receives an opaque challenge identifier and never decides whether a code is valid.
Verification consumes the challenge atomically, so two concurrent requests cannot both win.
A resend is a new delivery attempt on the same login intent, subject to a cooldown and a rolling budget, and must not silently invalidate a code already in transit unless the product documents that behaviour.
Suppression is checked before dispatch and again when delivery feedback is ingested; the second check matters for bounces, reassigned numbers and manually blocked recipients.
Autofill is a presentation hint, not proof of possession: the backend still receives the code through the same verify operation with the challenge ID and a request nonce, and the app should submit the autofilled value exactly as typed, display a generic failure, and avoid revealing whether a phone number has an account.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Self-contained design note, single self-published source
The design and code claims are fully checkable against the published text — interfaces, handler flow, hashing, expiry constant and audit calls are all shown — which gives the story internal verifiability. But the cluster contains exactly one self-published dev.to article with no external corroboration, no test results, no telemetry and no cited standard or incident report, and the empirical assertions (incident modes, compliance and support benefits, failure of client-generated state) are asserted rather than demonstrated.
No adoption evidence supplied
The source reports no release, deployment, user count, message volume, benchmark, incident or pricing datum. It is a design pattern with an illustrative Go sketch, so there is nothing in the supplied material from which adoption could be measured, and no adoption observations were recorded.
Mildly overstated relative to what is shown
The prose is unusually hedged for the genre — five minutes is explicitly called an example policy, attempts and expiry are deferred to threat model and regulation, and a delivery record is explicitly not a claim of delivery — which keeps the gap small. It tilts positive because the piece presents itself as a completed security contract of seven invariants that makes compliance review finite, while the artifact it publishes budgets the request path only and provides no way to count failed verifications, and no deployment or cost evidence supports the claimed abuse and reconciliation benefits.
Low commercial pull, developer-platform authorship incentive
No vendor, product, sponsor or pricing is named anywhere in the source, and the design deliberately keeps storage and the SMS adapter behind interfaces so that no particular provider benefits — this argues against commercial steering. The residual incentive is authorial: a self-published post on a developer content platform where an authoritative 'seven invariants' framing and a code sketch earn attention, which plausibly favours confident completeness over caveats about what the sketch omits.
Confident about what was published, not about its effect
Confidence is high that the cluster accurately captures the design and code as written, because the text and the Go sketch are fully quoted and the derived brute-force and missing-verify-budget observations follow arithmetically from them. Confidence is low that the pattern's claimed abuse-prevention, reconciliation and compliance benefits hold in practice: one publisher, no corroboration, no adoption or measurement of any kind.
build
Your meter now runs on someone else's machine: signed receipts, fsync, and failing open1 distinct publisher
build
A Timed-Out Reset SMS Is Not A Failed One, And Your Retry Code Probably Disagrees1 distinct publisher
build
Buy transactional email on recovery controls, not send price1 distinct publisher
build
Geofencing beats GPS polling on power, then loses to the OEM battery optimiser1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 21, 2026