File size: 14,361 Bytes
d40e568 b6ae8c3 d40e568 b6ae8c3 d40e568 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | ### 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.
|