┌─┐ ║"│ └┬┘ ┌┼┐ │ ┌─────────────┐ ┌───┐ ┌─────────────┐ ┌─────────┐ ┌─────────────────────┐ ┌┴┐ │User's Device│ │SDK│ │Local Storage│ │Lit Nodes│ │Lit Network Endpoints│ User └──────┬──────┘ └─┬─┘ └──────┬──────┘ └────┬────┘ └──────────┬──────────┘ │Generate session key pair (Ed25519) │ │ │ │ │ │───────────────────────────────────>│ │ │ │ │ │ │ │ │ │ │ │ │ Initiate SDK │ │ │ │ │ │───────────────────────────────────────>│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╔══════╤═════════╪════════════════════════════════════════╪════════════════════════════════════════╪════════════════╗ │ │ │ ║ ALT │ Session key in storage │ │ ║ │ │ │ ╟──────┘ │ │ │ ║ │ │ │ ║ │ │ Retrieve `lit-session-key` │ ║ │ │ │ ║ │ │───────────────────────────────────────>│ ║ │ │ │ ╠════════════════╪════════════════════════════════════════╪════════════════════════════════════════╪════════════════╣ │ │ │ ║ [Session key not in storage] │ │ ║ │ │ │ ║ │ Generate new `lit-session-key` │ │ ║ │ │ │ ║ │<───────────────────────────────────────│ │ ║ │ │ │ ║ │ │ │ ║ │ │ │ ║ │ Cache `lit-session-key` │ ║ │ │ │ ║ │────────────────────────────────────────────────────────────────────────────────>│ ║ │ │ │ ╚════════════════╪════════════════════════════════════════╪════════════════════════════════════════╪════════════════╝ │ │ │ │ │ │ │ │ │ │ │────┐ │ │ │ │ │ │ │ Create authSig (ERC-5573 message) │ │ │ │ │ │<───┘ │ │ │ │ │ │ │ │ │ │ │ │ Retrieve `lit-wallet-sig` │ │ │ │ │ │───────────────────────────────────────>│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╔══════╤═════╪════════════════════════════════════╪════════════════════════════════════════╪════════════════════════════════════════╪════════════════╗ │ │ ║ ALT │ Wallet sig expired │ │ │ ║ │ │ ╟──────┘ │ │ │ │ ║ │ │ ║ │ Prompt re-sign │ │ ║ │ │ ║ │<────────────────────────────────────────────────────────────────────────────│ │ ║ │ │ ║ │ │ │ │ ║ │ │ ║ │ Re-sign with ERC-5573 message │ │ ║ │ │ ║ │────────────────────────────────────────────────────────────────────────────>│ │ ║ │ │ ║ │ │ │ │ ║ │ │ ║ │ │ │ Cache new `lit-wallet-sig` │ ║ │ │ ║ │ │ │───────────────────────────────────────>│ ║ │ │ ╠════════════╪════════════════════════════════════╪════════════════════════════════════════╪════════════════════════════════════════╪════════════════╣ │ │ ║ [Wallet sig valid] │ │ │ ║ │ │ ║ │ │ │────┐ │ ║ │ │ ║ │ │ │ │ Use cached `lit-wallet-sig` │ ║ │ │ ║ │ │ │<───┘ │ ║ │ │ ╚════════════╪════════════════════════════════════╪════════════════════════════════════════╪════════════════════════════════════════╪════════════════╝ │ │ │ │ │ │ │ │ │ │Use session private key to sign message │ │ │ │ │ │<───────────────────────────────────────│ │ │ │ │ │ │ │ │ │ │ │ Send device-generated signature │ │ │ │ │ │───────────────────────────────────────>│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╔══════╤════╪════════════════════════════════════════╪══════════════════════╪══════════════╗ │ │ │ ║ ALT │ Using PKP │ │ ║ │ │ │ ╟──────┘ │ │ │ ║ │ │ │ ║ │ Lit Nodes perform signing │ ║ │ │ │ ║ │──────────────────────────────────────────────────────────────>│ ║ │ │ │ ╚═══════════╪════════════════════════════════════════╪══════════════════════╪══════════════╝ │ │ │ │ │ │ │ │ │ │────┐ │ │ │ │ │ │ │ Create sessionSigs (access token) │ │ │ │ │ │<───┘ │ │ │ │ │ │ │ │ │ │ │ │ Access features (executeJs, pkpSign) │ │ │ │ │─────────────────────────────────────────────────────────────────────────────────────────>│ User ┌──────┴──────┐ ┌─┴─┐ ┌──────┴──────┐ ┌────┴────┐ ┌──────────┴──────────┐ ┌─┐ │User's Device│ │SDK│ │Local Storage│ │Lit Nodes│ │Lit Network Endpoints│ ║"│ └─────────────┘ └───┘ └─────────────┘ └─────────┘ └─────────────────────┘ └┬┘ ┌┼┐ │ ┌┴┐