|
Download content/client-server-api/modules/identity.md from abr00kx/taper: direct link, hf CLI and curl.
- Browser
- Download file 14.4 kB
-
https://huggingface.co/abr00kx/taper/resolve/main/content/client-server-api/modules/identity.md
- Command line
-
hf download hf://abr00kx/taper/content/client-server-api/modules/identity.md
-
curl -L -o identity.md https://huggingface.co/abr00kx/taper/resolve/main/content/client-server-api/modules/identity.md
14.4 kB
| ### Identity and Portability | |
| A Taper account belongs to a server, but a person's identity shouldn't. This | |
| module lets a user hold an **identity key** that they generate and keep | |
| themselves, prove which accounts and websites belong to that key using the | |
| [Ariadne](https://ariadne.id/) identity specification (the format | |
| [Keyoxide](https://keyoxide.org/) verifies), and **move their account** to | |
| another server with that key as proof, whether or not the old server | |
| cooperates. | |
| Identity is optional and private by default. A user who never sets one up | |
| loses nothing, and one who does decides who can see it. | |
| #### Identity keys | |
| An identity key is one of: | |
| * an **OpenPGP** key ([RFC 9580](https://www.rfc-editor.org/rfc/rfc9580)). | |
| The primary key SHOULD be Ed25519 or Ed448. Existing RSA keys of at least | |
| 3072 bits are accepted. | |
| * an **Ariadne Signature Profile** key | |
| ([ASP v0](https://ariadne.id/related/ariadne-signature-profile-0/)): | |
| Ed25519 (`EdDSA`) or P-256 (`ES256`). | |
| It is identified by its Ariadne key URI: | |
| * `openpgp4fpr:<FINGERPRINT>` for OpenPGP, with the fingerprint in upper-case | |
| hexadecimal. | |
| * `aspe:<domain>:<FINGERPRINT>` for ASP, where `<domain>` is the ASP Exchange | |
| server hosting the profile and `<FINGERPRINT>` is the ASP fingerprint. | |
| ##### Your keys, not ours | |
| The private half of an identity key belongs to the user alone: | |
| * It MUST be generated on a device the user controls, or on their own | |
| hardware token (such as an OpenPGP smartcard). | |
| * Servers MUST NOT generate, receive, store, escrow or back up a private | |
| identity key in any form. Clients MUST NOT put it in | |
| [secret storage](#secret-storage) or [key backup](#server-side-key-backups), | |
| even encrypted, because both live on the server. | |
| * Clients SHOULD support importing an existing key and using a key held on a | |
| hardware token. | |
| Clients MAY offer to generate an identity key for the user. A client that does: | |
| * MUST generate it locally; | |
| * MUST first tell the user, plainly, that bringing their own key is the | |
| recommended path, and ask them to confirm before going ahead; | |
| * MUST then offer the private key and, for OpenPGP, a revocation certificate | |
| for export, and urge the user to keep both offline. | |
| {{% boxes/note %}} | |
| Suggested wording when a user asks the client to make a key: | |
| > We can make your identity key here, but you really shouldn't let us. Not | |
| > your keys, not your identity. Make your own with a tool you trust, keep it | |
| > somewhere offline, and import it. **Generate one anyway?** | |
| {{% /boxes/note %}} | |
| ##### What an identity key signs | |
| An identity key MUST only sign the statements defined in this module: the | |
| [identity binding](#identity-binding), [move statements](#move-statements) | |
| and move cancellations, plus the user's own Ariadne profile. Clients MUST | |
| NOT use an identity key to sign or encrypt messages, events, or anything else | |
| that enters a room, and MUST refuse requests to do so. | |
| {{% boxes/rationale %}} | |
| A signature from a long-term personal key is permanent proof of authorship | |
| that anyone can check, which is exactly what Taper's | |
| [deniability](#deniability) removes from conversations. OpenPGP encryption | |
| also lacks forward secrecy: one stolen key decrypts every past message. | |
| Messages therefore stay on Olm and Megolm, and the identity key is used only | |
| for statements a user *wants* to be provable: "these accounts are mine" and | |
| "I moved". | |
| {{% /boxes/rationale %}} | |
| #### Identity binding | |
| An **identity binding** links an identity key to a Taper account and that | |
| account's [cross-signing](#cross-signing) master key: | |
| ```json | |
| { | |
| "user_id": "@alice:example.org", | |
| "identity_key": "openpgp4fpr:3637202523E7C1309AB79E99EF2DC5827B445F4B", | |
| "master_key": "nqOvzeuGWT/sRx3h7+MHoInYj3Uk2LD/unI9kDYcHwk", | |
| "ts": 1795400000000, | |
| "identity_signature": "<see below>", | |
| "signatures": { | |
| "@alice:example.org": { | |
| "ed25519:nqOvzeuGWT/sRx3h7+MHoInYj3Uk2LD/unI9kDYcHwk": "<master key signature>" | |
| } | |
| } | |
| } | |
| ``` | |
| It carries two signatures over the same bytes: the | |
| [Canonical JSON](/appendices#canonical-json) of the object without | |
| `identity_signature`, `signatures` and `unsigned`. | |
| * `identity_signature` is by the identity key. For OpenPGP keys, it is a | |
| binary OpenPGP detached signature (signature type `0x00`), encoded as | |
| unpadded base64. For ASP keys, it is a JWS with detached payload | |
| ([RFC 7515, Appendix F](https://www.rfc-editor.org/rfc/rfc7515#appendix-F)) | |
| in compact serialization, signed with the profile key. | |
| * `signatures` holds the master key's signature, following | |
| [Signing JSON](/appendices#signing-json). | |
| A binding is valid only if both signatures verify and the identity key has | |
| not been revoked. Each side vouches for the other: the identity key says | |
| "this account is mine", and the account says "this key is mine". | |
| The binding lives in the user's `t.identity` account data, together with who | |
| may see it: | |
| {{% event event="t.identity" %}} | |
| | `disclosure` | Who can see the binding | | |
| |--------------|-------------------------| | |
| | `private` (default) | Only the user's own devices. | | |
| | `contacts` | Users the user chooses. The client sends the binding to their devices in an encrypted [`t.identity.announce`](#tidentityannounce) to-device message. | | |
| | `public` | Anyone allowed to see the user's profile, through the `t.identity` profile field, plus [identity proofs](#identity-claims). | | |
| {{% event event="t.identity.announce" %}} | |
| ##### Verifying a binding | |
| A client that receives a binding MUST check both signatures and that the | |
| `user_id` matches the account it came from. It obtains the identity key from | |
| the place its URI names: for OpenPGP, from the user's | |
| [Web Key Directory](https://datatracker.ietf.org/doc/draft-koch-openpgp-webkey-service/) | |
| or a keyserver the user configured; for ASP, from the ASP Exchange server. It | |
| then checks the key hasn't been revoked. | |
| If the user has already verified the identity key's fingerprint by another | |
| route (in person, or from a trusted source), the client MAY treat the bound | |
| master key as verified for cross-signing. That carries existing trust in a | |
| person's key over to their Taper devices. | |
| #### Identity claims | |
| Users can publish [Ariadne identity claims](https://ariadne.id/core/0/) that | |
| link their identity key to their Taper account, so that Keyoxide and other | |
| Ariadne verifiers can confirm it. A claim needs both directions: | |
| 1. **Key → account:** the user adds their account's | |
| [Taper URI](/appendices#taper-uri-scheme) as a claim in their Ariadne | |
| profile, for example `taper:u/alice:example.org`. For OpenPGP that means a | |
| `proof@ariadne.id=taper:u/alice:example.org` notation on the key; for ASP, | |
| an entry in `http://ariadne.id/claims`. | |
| 2. **Account → key:** the user sets the `t.identity_proofs` profile field to | |
| an array of Ariadne proofs: the key URI itself, or an Argon2id or bcrypt | |
| hash of it. **Hashed proofs are RECOMMENDED.** Someone reading the profile | |
| learns nothing about the key unless they already know which key to test. | |
| Verifiers fetch the proof with the unauthenticated `t.identity.proofs` gateway | |
| method, giving an exact user ID. It returns `{"proofs": [...]}`. Servers MUST | |
| answer `T_NOT_FOUND` both for users who don't exist and for users who haven't | |
| published proofs. The method is subject to [read budgets](#read-budgets) and | |
| [challenges](#challenges) like any other lookup. | |
| ##### Keyoxide compatibility | |
| Current Keyoxide verifiers fetch proofs over HTTPS, not through the Taper | |
| gateway. For them, servers MAY offer a **compatibility proof document**. It is | |
| off by default, and each user must opt in separately: | |
| ``` | |
| GET https://example.org/_taper/identity/v1/alice | |
| Accept: application/activity+json | |
| ``` | |
| ```json | |
| { | |
| "@context": "https://www.w3.org/ns/activitystreams", | |
| "type": "Person", | |
| "id": "https://example.org/_taper/identity/v1/alice", | |
| "preferredUsername": "alice", | |
| "summary": "aspe:keyoxide.org:CSY6CYWH443HWQ5LCB6IDQFWVU", | |
| "attachment": [ | |
| { "type": "PropertyValue", "name": "taper", "value": "aspe:keyoxide.org:CSY6CYWH443HWQ5LCB6IDQFWVU" } | |
| ] | |
| } | |
| ``` | |
| The document is shaped so that Keyoxide's existing ActivityPub verifier | |
| ([ARC-0001](https://ariadne.id/arc/0001/)) accepts it. The user adds the | |
| document's `https://` URL as a claim in their Ariadne profile. It is the only | |
| HTTP resource a Taper server serves apart from discovery, and the following | |
| rules apply: | |
| * It is read-only. It is not an ActivityPub actor: it has no inbox or outbox | |
| and takes part in no federation. | |
| * It contains only the user's published proofs. | |
| * It returns `404` for users who haven't opted in. | |
| * It is rate limited per client address. | |
| A native Ariadne service provider definition for `taper:` claims, verified | |
| through the gateway, should be proposed as an Ariadne ARC so the | |
| compatibility document can eventually be retired. | |
| ##### The fediverse and other accounts | |
| The same identity key can carry claims for fediverse accounts (through | |
| ARC-0001), domains and other services. A contact who verifies someone's Taper | |
| identity can then see their other verified accounts, and the reverse. | |
| Linking accounts makes them easy to correlate. Before a client publishes | |
| proofs or sets `disclosure` to `public`, it MUST tell the user that anyone who | |
| can see them can connect this account to every other account the identity key | |
| claims. | |
| {{% boxes/note %}} | |
| The Ariadne core specification is still marked as a draft. Taper depends on | |
| it only for claims. Bindings and moves use the identity key directly and work | |
| without an Ariadne profile. | |
| {{% /boxes/note %}} | |
| #### Account portability | |
| A user can move from one server to another and keep their contacts and rooms. | |
| The identity key, not the old server, proves that the new account belongs to | |
| the same person, so a move works even if the old server is hostile or gone. | |
| Short retention makes this simple: past events keep the old user ID, and they | |
| expire within 21 days anyway. | |
| ##### Move statements | |
| {{% event event="t.identity.move" %}} | |
| A move statement is signed by the identity key in `identity_signature`, in the | |
| same way as a binding. If the user can still use their old account, it is | |
| also signed by the old account's master key in `signatures`. | |
| * **Signed by both:** the move takes effect at once. | |
| * **Signed by the identity key only** (old account lost): the move takes | |
| effect only after `not_before_ts`, which MUST be at least 7 days after `ts`. | |
| Until then, clients show the move as pending. The holder of the old account | |
| can cancel it with an `t.identity.move_cancel` signed by the old account's | |
| master key. This protects users whose identity key is stolen. | |
| {{% event event="t.identity.move_cancel" %}} | |
| ##### Making a move | |
| 1. The user creates the new account and binds the same identity key to it. | |
| 2. Their client creates and signs the move statement. | |
| 3. It sends the statement as an encrypted to-device message to every device of | |
| every contact, and of every member of every room the old account is in. | |
| Sending it over encrypted to-device messages keeps the move out of room | |
| history and keeps it deniable. | |
| 4. If the old server cooperates, the client calls `t.account.move` on it | |
| with the statement. The server then: | |
| * refuses new logins to the old account; | |
| * answers profile lookups, invites and direct messages for the old user ID | |
| with `T_MOVED`, including `moved_to` and the statement, for at least the | |
| [retention ceiling](#the-retention-ceiling); | |
| * then deactivates the old account. | |
| 5. The user updates their Ariadne profile, replacing the old Taper claim with | |
| the new one. | |
| ##### Receiving a move | |
| A client that receives a move statement MUST check that: | |
| * `identity_signature` verifies against an identity key it has already seen | |
| validly [bound](#identity-binding) to the `from` account (a move from an | |
| account with no known binding MUST be ignored); | |
| * the identity key isn't revoked; and | |
| * the move has taken effect, as described above. | |
| Once it has, the client: | |
| * updates direct message mappings ([`t.direct`](#tdirect)) and its contact | |
| list to the new user ID; | |
| * carries the user's own lists over: if it ignored the old user ID, it ignores | |
| the new one too, so moving doesn't get anyone around a block; | |
| * shows "*Alice moved to @alice:new.example*" where it shows the contact. | |
| In rooms the old account was in, members with permission to invite SHOULD | |
| invite the new account, automatically if the user has allowed it and | |
| otherwise after asking. **Power levels MUST NOT carry over automatically.** | |
| Clients SHOULD prompt room administrators to grant the new account the old | |
| one's power level, so that a stolen identity key can't take over rooms. | |
| ##### Portability archive | |
| Clients SHOULD let users export a **portability archive** to load into the | |
| new account. It contains: | |
| * account data, push rules and ignored users; | |
| * the room list, with memberships and the user's room aliases; | |
| * the user's `t.identity` binding; | |
| * their secret storage and key backup metadata (still encrypted as on the | |
| server). | |
| It contains message content and Megolm sessions only if they haven't expired. | |
| Each keeps its original `expires_ts`, and importing clients MUST drop anything | |
| already expired and honour the rest. | |
| The archive is a single JSON document, encrypted as an OpenPGP message | |
| ([RFC 9580](https://www.rfc-editor.org/rfc/rfc9580)): to the user's OpenPGP | |
| identity key, or with a passphrase using the Argon2 S2K (for ASP keys, or if | |
| the user prefers). Clients MUST delete an archive once it has been imported, | |
| and MUST NOT keep one beyond the earliest `expires_ts` inside it. | |
| The new server needs nothing special. The importing client replays the | |
| archive through the ordinary APIs. | |
| #### Security considerations | |
| * A stolen identity key can start a move. The 7-day delay, cancellation with | |
| the old master key, key revocation and the rule that power levels never | |
| transfer automatically limit the damage. Users SHOULD keep their identity | |
| key offline or on a hardware token. | |
| * A user who loses both their identity key and their old account can't prove | |
| a move. They have to rebuild trust with contacts by hand. | |
| * Published proofs and public bindings link accounts. Hashed proofs and the | |
| `private` default keep that a deliberate choice. | |
| * Identity keys never touch message content, so taking part in identity | |
| doesn't reduce the [deniability](#deniability) of conversations. | |