Architecture
When a user connects, MetaMask Connect automatically handles the following:
- Platform detection: Checks for the MetaMask extension, browser type, and device.
- Transport selection: Connects directly to the extension, or falls back to a QR code or deeplink relay.
- Session creation: Establishes a CAIP-25 session for the requested chains.
- End-to-end encryption: Encrypts relay connections so the relay server never sees message content.
- Session persistence: Preserves sessions across page reloads and new tabs.
The following diagram illustrates this: