m.megolm_backup.v1.curve25519-aes-sha2. 32-byte Curve25519 private key; public half signed by your cross-signing master. Every Megolm inbound session is wrapped with ECIES: ephemeral Curve25519 → ECDH → HKDF-SHA-256 (→ aes_key/mac_key/iv) → AES-256-CBC + HMAC-SHA-256. Ciphertext uploaded to /_matrix/client/v3/room_keys/keys. Homeserver sees opaque blobs.
m.secret_storage.v1.aes-hmac-sha2 (MSC1946 + MSC2472). 32-byte master key derived from passphrase (PBKDF2-HMAC-SHA-512, 500k iters) or from a printed Recovery Key (0x8B 0x01 + 32 bytes + parity, Bitcoin-alphabet Base58, ≈48 chars). Each secret wrapped via HKDF(info=secret name) → AES-CTR-256 + HMAC-SHA-256. Stores: Megolm backup seed + 3 cross-signing private keys.
The SSSS master key — 32 bytes that unlock everything. Replace the passphrase / Recovery Key with a t-of-n threshold scheme and you get M-of-N recovery of all five secrets for free. No changes to Matrix, Megolm, Olm, or MSCs.
In crypto-wallet speak "multisig" usually means Bitcoin-style N-of-M signatures on transactions. Not what you want — Matrix backups are encrypted blobs, not transactions. What you actually want is one of:
Use the term "t-of-n threshold recovery" in design docs. It's precise and maps to the literature.
| Tier | Scheme | Custodians see | Rust library | Effort |
|---|---|---|---|---|
| MVP | Shamir over GF(2^8) or SLIP-0039 | Raw seed at reconstruction | vsss-rs, sharks | ~1 week |
| V2 (recommended V1) | Feldman / Pedersen VSS | Raw seed, but cheating detected | vsss-rs (same lib) | +2–3 weeks |
| V3 | DKG + threshold ElGamal on Curve25519 | Never see the seed | frost-core + custom threshold ElGamal | +2–3 months |
Storage cost on the homeserver: N encrypted shares + N commitments, ≈ N × 200 bytes. Negligible.
| Threat | Mitigation |
|---|---|
| M custodians collude → total compromise | Diversify jurisdictions, legal entities, infra. Signal SVR3 uses 3 different cloud-enclave vendors (SGX/Azure + SEV-SNP/GCP + Nitro/AWS). |
| Custodian loses their share | Set M < N (e.g. 3-of-5, 5-of-9). Optional time-locked recovery share with a notary. |
| Malicious dealer at setup | Feldman VSS. Commitments on a transparency log. |
| Eclipse on recovery channel | Noise-XK or pinned-TLS to each custodian. User sees custodian fingerprints at both enrollment and recovery. |
| Replay of old shares after rotation | Proactive Secret Sharing (Herzberg et al.) — vsss-rs supports it. |
| Custodian platform coercion | Jurisdictional diversity. Warrant canaries. Public custodian list + transparency report. |
| User forgets second-factor | Tier-2 social-recovery set, separate custodians from primary. |
User picks 5 contacts, 3 required. Pure consumer. Works for user disaster recovery; useless for regulatory access.
3 legal entities in different jurisdictions, 2 required. Professional SLAs. UX cost of custodian setup.
3 hardware-attested enclaves you operate across SGX / Nitro / Apple SE. Fastest recovery UX. Requires trust in enclave attestation.
User chooses social or institutional at enrollment. Different sets, different ceremonies.
If the same t-of-n ceremony covers both cases, regulators gain a permanent capability — the mechanism exists, custodians are identified, compelling t of them always returns plaintext. This is the single biggest technical-policy mistake you can make.
Better — dual encryption with disjoint custodian sets. Each session_data backup row is encrypted to both P_user_recovery (user ceremony) and P_compliance (regulator ceremony). The two threshold sets are disjoint legal entities with disjoint governance. Storage doubles for backups only (Megolm backups are tiny vs media).
You're in Abu Dhabi. The UAE has consistently required lawful access to comms: BlackBerry standoff (2010), persistent OTT-voice blocks, TDRA whitelist-only VoIP, Federal Decree-Law 34/2021 (Cybercrimes & Rumors) and 45/2021 (PDPL) both presuming state access under investigation. A TDRA-licensed UAE messenger will almost certainly be required to ship a compliance path. Design for it explicitly with disjoint custodians and public governance — don't bolt it on after a regulator asks.
| Property | Shamir (MVP) | Feldman VSS | Pedersen VSS | DKG + Threshold ElGamal |
|---|---|---|---|---|
| Seed exists during recovery | Yes | Yes | Yes | Never |
| Detects malicious custodian | No | Yes | Yes | Yes |
| Hides secret in commitment | Info-theoretic | Reveals g^secret | Info-theoretic | Yes |
| Custodians online at recovery | No | No | No | Yes |
| Rounds | 1 | 1 | 1 | 2–3 |
| Rust library (2026) | vsss-rs, sharks, SLIP-0039 | vsss-rs | vsss-rs | frost-core + custom |
| Proactive refresh | Add-on | Yes | Yes | Yes (DKG re-run) |
| Effort | Low | Low+ | Low+ | High |
| Production reference | Vault unseal · Trezor Shamir | Ledger Recover | Academic + some wallets | Signal SVR3 model |
vsss-rs, implement m.secret_storage.threshold.v1 account_data. Publish as a draft MSC for community review.Effort: 4–6 engineer-months for a V1 ceremony wrapped into matrix-rust-sdk + custodian service + UI + governance. Doesn't include the rest of the product.