diff --git a/xmtp_mls/IDENTITY.md b/xmtp_mls/IDENTITY.md index 918c3da96..97170eb30 100644 --- a/xmtp_mls/IDENTITY.md +++ b/xmtp_mls/IDENTITY.md @@ -8,13 +8,13 @@ Amal's account (Ethereum wallet address) ├── Converse app (mobile phone) │ └── Installation key bundle 1 │ -├── Coinbase Wallet (mobile phone) +├── Coinbase Wallet app (mobile phone) │ └── Installation key bundle 2 │ -├── Lenster (tablet) +├── Lenster app (tablet) │ └── Installation key bundle 3 │ -└── Coinbase Wallet (tablet) +└── Coinbase Wallet app (tablet) └── Installation key bundle 4 ``` @@ -24,59 +24,143 @@ Using per-installation keys provides the following benefits: - The user may enumerate the installations that have messaging access to their account. - The user may revoke keys on a per-installation level. -**Installation provisioning** +## Identity lifecycle -Every new app installation gains messaging access as follows: +### Ethereum wallet -1. A new Ed25519 signature key pair is generated and stored on the device, representing the installation's identity. -2. The app prompts the user to sign the public key with their Ethereum wallet, establishing an association between the installation's identity and the user’s account. Example text: +As of Nov 30 2023, an Ethereum wallet consists of a secp256k1 keypair, and is identified by a public address, which is the hex-encoding of the last 20 bytes of the Keccak-256 hash of the public key, prepended by `0x`. Wallet keys do not expire and are not rotatable - in the event of a compromise, the user must create a new wallet. The user is expected to have a pre-existing Ethereum wallet prior to onboarding with XMTP. + +The wallet keys can be used to sign arbitrary text, with most wallet software requiring explicit [user acceptance](https://docs.metamask.io/wallet/how-to/sign-data/#use-personal_sign) of the signature text. The signature text is formatted according to version `0x45` of [EIP-191](https://eips.ethereum.org/EIPS/eip-191), and is signed via a recoverable ECDSA signature. + +Wallet signature requests originating from XMTP will additionally prepend context to the EIP-191 `message` field to prevent collisions between signatures in different contexts: + +``` +XMTP: