-- v2 -> v3 (compatible with v1+): Identity resets waiting to be accepted -- A switched-on user's new master key the bridge has not accepted yet (work plan 4.2 ⑥): it is -- accepted only with a signature by the pinned identity, or with a proof through the messenger and 72 -- hours without a rejection, and dropped after 30 days. The proof code is kept only as a keyed -- fingerprint under the store key. CREATE TABLE xessenger_e2ee_identity_reset ( bridge_id TEXT NOT NULL, user_mxid TEXT NOT NULL, master_key TEXT NOT NULL, first_seen_at BIGINT NOT NULL, notified_at BIGINT, proof TEXT NOT NULL DEFAULT '', proved_at BIGINT, code_mac TEXT, code_expires_at BIGINT, code_tries INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (bridge_id, user_mxid) ); -- Master keys that are never accepted: new ones a device of the pinned identity rejected, and -- pinned ones a new identity replaced. CREATE TABLE xessenger_e2ee_rejected_key ( bridge_id TEXT NOT NULL, user_mxid TEXT NOT NULL, master_key TEXT NOT NULL, rejected_at BIGINT NOT NULL, PRIMARY KEY (bridge_id, user_mxid, master_key) );