TB-006
Bulletin
TB-006Bulletin
How passkeys actually work, without the hype
What is created, what crosses the network and the five checks your server makes. The fingerprint is the one part we never see.
Yuki TanabeEngineer, mobile SDKs, Osaka
- Title
- Technical bulletin
- Doc. no.
- LM-09 / TB-006
- Subject
- Protocols
- Issued
- 10 Nov 2026
- Reading
- 4 min
Most explanations of passkeys stop at “it uses your fingerprint”. That is the one part that never reaches us. The fingerprint unlocks a private key on the device; what crosses the network is a signature. This bulletin walks through what is created, what is sent and what your server has to check, using the WebAuthn terms you will meet in the API.
1.0A key pair per site, and nothing else
A passkey is a public and private key pair made for exactly one relying party: a domain such as app.acme.dev, called the rpId. The private key stays inside the authenticator (a phone's secure enclave, a laptop's TPM, a password manager, a security key). Your server stores the public key, a credential ID and a counter. There is no shared secret, so a copy of your database is useless for signing in anywhere, including on your own site.
Registration is one call. Your server sends a random challenge and says who it is; the browser asks the authenticator to mint a key pair bound to that rpId; the public key comes back. The second call, the one people do every day, is authentication.
2.0Sign-in is a signature over a challenge
Challenge 32 random bytes, stored server-side for a few minutes and used once.
Request The browser adds the origin it is really on. A page cannot lie about this.
User verification Face, finger or PIN unlocks the key locally. The biometric never leaves the device.
Assertion A signature over the authenticator data and a hash of the client data.
Response Credential ID, signature, authenticator data and clientDataJSON.
Verification Five checks against the stored public key, listed in section 3.
In the browser, the whole ceremony is one promise. With mediation: "conditional" the saved passkeys appear in the autofill row of the email field, so there is no separate “use a passkey” decision for the visitor to make.
const credential = await navigator.credentials.get({ mediation: "conditional", // offer passkeys in the autofill row publicKey: { challenge, // 32 random bytes from your server rpId: "app.acme.dev", userVerification: "preferred", allowCredentials: [], // empty: the device picks (discoverable credential) },});await fetch("/auth/passkey/verify", { method: "POST", body: JSON.stringify(serialize(credential)),});3.0What the server checks
The authenticator signs two things joined together: the authenticator data (a hash of the rpId, a flags byte and a counter) and a SHA-256 hash of clientDataJSON (the challenge, the origin and the ceremony type, written by the browser). Verification is short, and every line matters:
export function verifyAssertion(a: Assertion, key: StoredKey, expected: Expected) { const client = JSON.parse(a.clientDataJSON.toString("utf8")); if (client.type !== "webauthn.get") throw new Error("wrong ceremony"); if (client.challenge !== expected.challenge) throw new Error("stale challenge"); if (client.origin !== expected.origin) throw new Error("wrong origin"); const rpIdHash = a.authenticatorData.subarray(0, 32); if (!rpIdHash.equals(sha256(expected.rpId))) throw new Error("wrong rpId"); const flags = a.authenticatorData[32]; if ((flags & 0x01) === 0) throw new Error("user not present"); const signed = Buffer.concat([a.authenticatorData, sha256(a.clientDataJSON)]); if (!verify("sha256", signed, key.publicKey, a.signature)) throw new Error("bad signature");}- Type and challenge stop a registration response or an old assertion being replayed.
- Origin is the anti-phishing check. It is written by the browser, not by the page.
- rpId hash proves the key was made for you and not for a look-alike relying party.
- Flags: bit 0 is user present, bit 2 is user verified. Require bit 2 for anything sensitive.
- Signature proves possession of the private key that matches the stored public key.
4.0Why phishing stops working
A password can be typed into any page that asks for it. A passkey cannot be offered to the wrong page at all: the browser only lists credentials whose rpId matches the domain in the address bar, and it stamps the real origin into the data that gets signed. A proxy on acme-login.example receives no credential to forward, and if it somehow relayed one, your origin check would fail. That is the entire security argument, and it does not depend on the user noticing anything.
5.0What passkeys do not solve
| Synced | Device-bound | |
|---|---|---|
| Lives in | iCloud Keychain, Google Password Manager, 1Password | Security key, some TPMs |
| Survives a lost phone | Yes | No |
| Backup-eligible flag | 1 | 0 |
| Counter | Usually 0 | Increments |
| Good default for | Consumer and most B2B apps | Admin and high-assurance roles |
Account recovery is still your problem. Someone who loses every device, or leaves the ecosystem their passkeys were synced in, needs another way back, and that path is exactly as strong as you make it. A recovery email link guarded by nothing quietly turns a phishing-resistant account back into an email account.
Shared computers, older Android builds and embedded web views also still exist. On those, the right behaviour is to not show the passkey prompt and fall back without an error. Signing in on a device that has no passkey works through the hybrid transport: a QR code, plus a Bluetooth proximity check so the phone must physically be near the laptop.
6.0What we ship
In Latch, <SignIn /> runs conditional mediation whenever the browser supports it, stores the backup flags with each credential so you can require device-bound keys for a role, and keeps the email code as the recovery path with five attempts per code. Runwell switched its mobile app to passkey-first in the spring; failed sign-ins went from 7.4% to 0.9% of attempts, almost all of the difference being mistyped passwords that no longer exist.
3.1 s
Median time to sign in
98.7%
Ceremonies completed
91%
Synced, by backup flag
7.0
Get started
7.0Get started
Read enough. Try the part.
Everything in these bulletins is switched on in the free plan: passkeys, 60-second tokens, organizations and roles, for your first 10,000 monthly active users.
npm install @latch/nextjsIncluded on Free
- Monthly active users
- 10,000
- Passkeys, codes, links
- Included
- Social providers
- 3
- Organizations
- 5 members each
- Card required
- No