Device-issued identity and API key differences
An API key is a secret string that grants access to whoever presents it. A device-issued identity is a key pair the device generates for itself: the private half stays on the device, and the device proves who it is by signing something fresh with it. The first is something you send; the second is something you prove without sending.
That one difference decides most of the security:
| API key | Device-issued identity | |
|---|---|---|
| What is presented | The secret itself | A signature made with a private key |
| Who can use a copy | Anyone who holds it | Nobody, because the private key is never copied |
| Where it tends to end up | Code, config files, CI logs, chat messages, app binaries | Platform key storage on one device |
| Typical lifetime | Long, until someone rotates it | Tied to the device, replaced when the device is |
| Scope of one leak | Everything the key can do, from anywhere | One device, revoked on its own |
API key leak causes
API keys leak because a key is useful anywhere it is copied, and it gets copied everywhere. A key starts in a secret manager, then lands in an environment file, a CI variable, a teammate’s laptop, a debugging log and sometimes a public commit. GitGuardian’s 2025 report counted 23,770,171 new secrets in public GitHub commits in 2024, a 25% rise on the year before, and found that 70% of the secrets it saw leaked in 2022 were still valid. AI coding tools have not helped: the same report found secret leakage in 6.4% of repositories using GitHub Copilot, against a 4.6% average across public repositories.
A key shipped inside a mobile or desktop app has to be treated as public. Anyone with the binary can extract it. Offline Protocol’s own docs say this plainly about the one key its SDK can carry, the telemetry key: it ships in the application binary and can be extracted, so scope it to that application, monitor its use, and delete it if it is exposed.
Device key signature verification
A device-issued identity proves who it is by signing. The device generates a key pair, keeps the private key in platform storage such as the iOS keychain or Android Keystore, and shares the public key. When another party wants proof, it sends a fresh random challenge, the device signs it, and the other party checks the signature against the public key. The challenge is new each time, so a recorded answer cannot be replayed.
Some systems go one step further and derive the device’s address from its public key. That makes the address a self-certifying identifier: anyone can check that a presented key belongs to the address by recomputing it, with no directory or certificate authority to ask.
This is the same principle as passkeys. The FIDO Alliance describes passkeys as using standard public key cryptography to provide phishing-resistant sign-in: the private key stays on the user’s device and is bound to the site, so there is no shared secret for a fake page to collect.
API keys for server-to-server calls
An API key is still the right choice for server-to-server calls to a third-party service that only offers keys. Then make the key as small and short-lived as the platform allows:
- Scope it to one job. A key that can only read one resource is a small loss when it leaks.
- Prefer temporary credentials. AWS recommends relying on temporary credentials instead of long-term access keys wherever possible, and using roles for workloads so that no long-lived key is distributed at all.
- Store it in a secret manager and rotate it. OWASP’s secrets guidance recommends regular rotation so that a stolen credential only works for a short time, and immediate revocation when one is exposed.
- Never put a broad key in a client. Anything in a browser or app binary is readable by whoever has it.
For devices talking to devices, or devices proving themselves to your backend, use device-issued identity. What happens when an API key leaks? covers the clean-up when a key gets out.
Offline Protocol device identity without API keys
Offline Protocol gives every device its own Ed25519 identity key, generated and held on the device, and derives the device’s off1 address from the public key. Two devices verify each other directly from the key, with no lookup, no certificate authority and no round trip, and a mismatch is refused. Sessions between them are end-to-end encrypted with MLS. A local mesh session needs no portal account and no API key at all.
When a device needs to belong to an existing account, your server binds it the device-issued way: it issues a fresh nonce, the device signs it, and the server verifies the signature, checks the derived address and stores the binding. An app API key is needed only for hosted services such as hosted MCP, SDK telemetry and CLI use in CI, and the portal stores only a hash of each key, so a lost key is replaced, never recovered. The result is a fleet whose devices carry no shared secret that could be pasted into the wrong place, and where one lost device is one key to revoke.