Encryption and identity

What is a self-certifying identifier?

A self-certifying identifier is a name derived from a public key, usually by hashing it, so anyone can check that a presented key belongs to the name by recomputing the derivation, with no directory or certificate authority to ask. It proves that a key matches the name. It does not prove who controls the key or whether they should be trusted.

TL;DR

To trust a self-certifying identifier, recompute it from the presented key and check a signature over a fresh challenge, since public keys can be copied. The identifier is only as trustworthy as the way you received it, and grants no permissions. A changed or leaked key means a new identifier, so systems must spread new names and revocations.

Learning objectives

After reading this article you will be able to:

  • Explain how a verifier recomputes an identifier from a key and checks the private key
  • Compare how SFS, libp2p and Tor onion services derive self-certifying identifiers
  • Identify what a self-certifying identifier cannot prove and what happens when its key changes

Name-to-key binding without a third party

A self-certifying identifier makes the name out of the key. Otherwise, linking a name to a public key usually needs a third party. A certificate authority signs a statement that a key belongs to a domain, or a directory answers when you ask for someone’s key. Both have to be reachable and trusted.

In their 1999 paper on SFS, a secure network file system, David Mazières and colleagues introduced self-certifying pathnames: file names that, in their words, effectively contain the appropriate server’s public key. Each pathname had the form Location:HostID, where HostID was a cryptographic hash of the server’s public key and its location. A client that knew the pathname could ask the server for its key and check the reply against the HostID itself, with no separate key management in the file system.

The same pattern appears in later systems where devices or services need names that nobody issues, including the examples below.

Self-certifying identifier verification

When a peer presents a key and claims a self-certifying identifier, the verifier does two things: it recomputes the identifier from the key, and it checks that the peer holds the private key.

  1. Recompute the identifier from the key. Hash or encode the presented public key the same way the system defines, and compare the result with the claimed identifier. If they differ, reject the key.
  2. Check that the peer holds the private key. A public key can be copied by anyone, so a match alone proves nothing about who sent it. The peer signs a fresh challenge, or the message itself, and the verifier checks that signature with the key it just matched.

The first step relies on the hash. NIST’s key management guidance describes approved hash functions as preimage-resistant and collision-resistant: finding an input that maps to a given output, or two inputs that map to the same output, is computationally infeasible. That is what stops an attacker from producing a different key that yields your identifier.

Self-certifying identifier examples

SFS host IDs, libp2p peer IDs and Tor onion addresses are all self-certifying identifiers.

SystemIdentifierHow it is derived
SFSHostID in a pathnameHash of the server’s public key and location
libp2pPeer IDThe encoded public key itself if it is short, otherwise its SHA-256 hash
Tor onion servicesOnion addressThe service’s Ed25519 public key plus a checksum and version, in base32

The libp2p and Tor cases show that an identifier can contain the key rather than a hash of it. The libp2p specification embeds keys that serialise to 42 bytes or fewer, which covers Ed25519, and hashes longer ones. Tor’s onion address carries the full 32-byte Ed25519 public key. Either way, the identifier can be checked against a presented key without asking anyone.

Mesh networks use the same approach. In Offline Protocol’s mesh SDK, each device’s off1 address is derived from its Ed25519 identity key, which makes it self-certifying, and the security documentation notes that verification binds the presented key to that address but does not establish a person’s role or permission.

Self-certifying identifier limits

A self-certifying identifier shows only whether a key belongs to a name. It leaves other questions open, such as who is behind it, what a human-readable name means and what the holder may do.

  • Who is behind it. An attacker can generate a key and a valid identifier just as easily as anyone else. The identifier is only as trustworthy as the way you received it, such as a QR code shown in person, a link from someone you already trust, or trust on first use.
  • What a human-readable name means. Identifiers look random, so systems map friendly names onto them. SFS used symbolic links for this. That mapping is a separate trust decision, and a name that anyone can claim should never be accepted automatically.
  • What the holder may do. Proving control of a key grants no permissions. The application decides that after enrolling the identity.

Self-certifying identifiers after key change or leak

Because a self-certifying identifier is tied to one key, it cannot survive a change of key. Key rotation for a self-certifying identity means a new identifier, and every contact has to learn it. The SFS paper describes publishing under both names or leaving a forwarding pointer at the old one.

A leaked key is worse. Whoever holds it can act as that identifier, and the SFS paper notes that an attacker with a disclosed key could serve a false forwarding pointer. SFS therefore added revocation certificates, signed with the compromised key’s own private key, that clients check before trusting a pathname. Any system built on self-certifying identifiers needs some way to spread revocations, especially when devices are offline and cannot ask a server.

Frequently asked questions

Can an attacker make a different key that matches my identifier?

Not if the identifier uses an approved hash function. NIST describes approved hash functions as preimage-resistant and collision-resistant, so producing a different key that yields your identifier is computationally infeasible.

Is a Tor onion address a self-certifying identifier?

Yes. An onion address carries the service's full 32-byte Ed25519 public key plus a checksum and version, encoded in base32, so it can be checked against a presented key without asking anyone.

How does libp2p derive a peer ID?

A libp2p peer ID is the encoded public key itself if the key serialises to 42 bytes or fewer, which covers Ed25519, and otherwise the SHA-256 hash of the key.

Does a self-certifying identifier prove who someone is?

No. An attacker can generate a key and a valid identifier just as easily as anyone else, so the identifier is only as trustworthy as the way you received it, such as a QR code shown in person or trust on first use.

How is an Offline Protocol off1 address derived?

In Offline Protocol's mesh SDK, each device's off1 address is derived from its Ed25519 identity key, which makes it self-certifying. Verification binds the presented key to that address but does not establish a person's role or permission.

Sources

Build it with Offline Protocol

The device identity guide shows how a device's off1 address is computed from its Ed25519 public key, and how invites carry an address and key that the scanning device verifies before acting on them.

Read the device identity guide