Protocol overview
Triauth is a challenge-response protocol. A website builds a request, the user's device signs it, and the website verifies the signature against public keys published in DNS. This page describes the main parts. The reference implementation, triauth-js, and its conformance test vectors define the exact behavior.
The parts
Identifiers
An identifier is username@domain, in lowercase. The domain part names the domain whose DNS TXT record a verifier reads first, to find the authentication endpoint and the mode. The username part, together with the mode, tells it under which DNS name at the same domain the identity records are published.
DNS records
Two DNS names matter for each identifier (e.g., john@example.com).
The domain itself (e.g., example.com) carries the triauth record, which names the web address of authenticator to use for that domain, and can specify additional options. For example:
dns
example.com TXT "auth.triauth.org mode=private include=any"A domain name derived from the identifier (e.g., john._at.example.com) carries the identity records: keys, profile, groups, and delegations. For example:
dns
john._at.example.com TXT "key desktop[1/1]:BJSnllMPgReHvUqe7CYElsmTx8hLdYWVyneqif1DP58WlhItgSp5KAQWwgPPXVhRwZwB2Rjh5k7_EHd5cnPE1nQ"See DNS records for more information.
The challenge
A challenge is the request that a website makes. It names the website's callback URL, the request type, the identifier, a random value, the time, the protocol version, and a public key for sealing the response. For a sign-in, the decoded challenge looks like this:
json
{
"cburl": "https://example.com/cb",
"type": "auth",
"identifier": "john@triauthdemo.org",
"nonce": "ABEiM0RVZneImaq7zN3u_wAR",
"iat": 1777454675000,
"ver": 1,
"ek": "BAvIl9VT2wgrhKaA2l711aZb1IReYDd_E-uT_p9vVssfwjXnUZ5MqXcE3fICBFZf8IEyrhQuf_At89RhpY0YRqE"
}The website stores the challenge together with the matching private key that can be used to unseal future response.
The website encodes the challenge and sends the user's browser to the authenticator with it, for example by issuing HTTP 302 Found redirect to:
https://auth.triauth.org/auth.html#?challenge=eyJjYnVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vY2IiLCJ0eXBlIjoiYXV0aCIsImlkZW50aWZpZXIiOiJqb2huQHRyaWF1dGhkZW1vLm9yZyIsIm5vbmNlIjoiQUJFaU0wUlZabmVJbWFxN3pOM3Vfd0FSIiwiaWF0IjoxNzc3NDU0Njc1MDAwLCJ2ZXIiOjEsImVrIjoiQkF2SWw5VlQyd2dyaEthQTJsNzExYVpiMUlSZVlEZF9FLXVUX3A5dlZzc2Z3alhuVVo1TXFYY0UzZklDQkZaZjhJRXlyaFF1Zl9BdDg5UmhwWTBZUnFFIn0The response
A response is the authenticator's answer to a challenge. To approve a request, the authenticator:
- prepares a response envelope that contains the user's identifier, the time of signing, and other data,
- signs the envelope with the user's private key, whose public key is published in the identity records in DNS, to prove that the user controls the identifier,
- adds the unsigned metadata to the envelope, such as the transport details of a security-key signature,
- seals the envelope by encrypting it with the encryption key (
ek) received in the challenge, so that private information does not leak through website logs or to the intermediaries that the website uses, - sends the sealed envelope back to the website through the callback URL (
cburl).
Response envelope
The response envelope records the request type, the identifier, an actor if someone signed on the identifier's behalf, the base URL of the website, the version, the time of signing, optional signed metadata, optional unsigned metadata, and one signature per key of the device. A verifier checks each signature against the keys published for that device.
|auth;john@example.com;;https://example.com/;v1;1787224766683;;;S8lEY3KOYs9gsSpCJ8YnbnKHVCJcT0dXRREZCAgfIR_3dqkW3S9eUcfQZc6q2HD2sy56LwndOoSbcGyO2ZbUnw|The parts are separated by ; and appear in this order.
| Part | Meaning |
|---|---|
| and | | Wrap the response. When several identities sign, as in an attestation, their parts are joined inside one pair of wrappers, separated by |. |
auth | The request type. A signature for one type is never valid for another. |
john@example.com | The identifier that the signature speaks for. |
(empty) | The actor. Empty when the identifier's own keys signed. For a delegated signature, the identifier of the actor. |
https://example.com/ | The base URL of the website's callback URL, its origin and path up to the last slash. The signature is valid only there. |
v1 | The protocol version. |
1787224766683 | The time of signing, in milliseconds since 1970, by the device's clock. |
(empty) | Signed metadata, encoded and covered by the signature. Holds extras such as extension data, attachment digests, and lookup codes. |
(empty) | Unsigned metadata, encoded and not covered by the signature. Carries only transport details of security-key signatures. |
S8lEY3KO…O2ZbUnw | The signature. A device with several keys puts one signature per key here, separated by ;. |
Envelope sealing
The response envelope travels encrypted. The authenticator encrypts it to the ek (encryption key) of the challenge with HPKE (RFC 9180). The encrypted response is in <enc>.<ciphertext> format, where both parts are base64url encoded, and enc is the one-time public key that the authenticator made for this response:
BNh1cQjNAGfM2AT7Kee_wcSpCMPmf393GaP5h1bOOFgrH58q9CIgGz0ChLLBzLGOUGbZB46FIgY8CPljfgKTNj4.DJguMmSAhafOTygveRsBQlHfpOcc4haXughtMSANoZO3ra2IIpYviH6H4ErvaqeRb_bEBu2e0URsJUjsA4iJ1Fu_2MMnn80zA-slH6XIsReM6i7m7a74iU_hmDmUMaL6KkwDM_LVJQw71pR1qnSLEE9EWOHHe8sqOT8t42S4TX0fhmzZFrlPm969B2eopvMFvJ0HMQ0I1USB6XB-lT0arzJt9UQB6XKsi2DmThe website decrypts it with the private key kept in the stored challenge. A denial is the plain string false.
Session key
When the authenticator seals the response and the website opens it, both sides also obtain the same secret, the session key. It comes from the encryption itself, so neither side has to send it to the other. The website stores it with the user's session, and the authenticator stores it with the permissions that the user granted. See Sessions and sign-out.
The five request types
Every request that a website makes has a type. The type is written in the challenge and in the response, and it decides what the authenticator shows the user, what the device signs, and how long the request stays valid.
| Type | What the user sees | What the website gets |
|---|---|---|
auth | A sign-in to approve or deny | Proof that the user controls the identifier |
ping | Nothing. Answered in the background with the ping permission | Proof that the device still holds its keys |
sign | A message and files to review and sign | A transferable signature over the message |
stamp | Nothing. Answered in the background with the stamp permission | A signature over a short message, for third parties |
attest | Confirmations to complete with a provider | The provider's signature bundled with the user's |
All types share the three stages of the sign-in flow and the same response envelope structure.
Requests after sign-in
The requests that follow authentication, such as ping, sign, stamp, and attest, travel encrypted under the session key established during sign-in. This helps to prevent potentially sensitive information about attestations and signed documents from being stored plain in browser history, and from there reaching the browser's vendor or extensions that read the history.
Verification
A verifier opens the response with the key kept in the stored challenge. It reads the domain's triauth record, derives the name of the identity records, reads the keys, and checks the signatures. It also checks that the response matches the request, that it is fresh, that it was made for the verifier's own base URL, and that every applicable key of the signing device took part. Records that DNSSEC-validating resolvers confirmed mark the result as secure.