@lit-protocol/lit-auth-client) handle OAuth; signIn() starts the flow, and after redirect handleSignInRedirect() / authenticate() return an AuthMethod (e.g. OAuth token).
getSessionSigs({ authMethod, pkpPublicKey, ... })). Those signatures authorize access to resources (e.g. decrypt content, call Lit Actions) for a limited time.
balanceOf ≥ threshold, or “owns token id”).
- EVM custom: Any contract call + returnValueTest (e.g. “must have ≥1 share in this DAO”).
- Boolean logic: AND/OR over conditions (e.g. “holds NFT X and (holds token Y or balance ≥ Z)”).
So in Lit: social login → PKP (identity) → SessionSigs (session) and ACCs (token/NFT/contract) gate who can decrypt or act.
mindX does not use Lit’s social login or PKPs. Identity is:
So we already have:
The Lit analogue is: our “AuthMethod” is “wallet signs challenge”; our “PKP” is the wallet address; our “SessionSigs” are the session token.
Lit’s idea: access (e.g. decrypt, or “can use this app”) can be gated on on-chain state — e.g. “holds NFT X” or “holds ≥ N of token Y”.
In mindX we can do the same for issuance of access:
So:
That keeps “identity = public key that signed” and adds “issuance of access = optional NFT/fungible requirement for that same public key”.
mindx_backend_service/access_gate.py), driven by environment variables:MINDX_ACCESS_GATE_ENABLED=true
- RPC: MINDX_ACCESS_GATE_RPC_URL=https://... (required when gate is on)
- Contract: MINDX_ACCESS_GATE_CONTRACT=0x...
- Type: MINDX_ACCESS_GATE_TYPE=erc20 or erc721
- ERC20: MINDX_ACCESS_GATE_MIN_BALANCE=1 (min balance in smallest units)
- ERC721: MINDX_ACCESS_GATE_TOKEN_ID=123 (require owning this token id), or omit for “balanceOf ≥ 1”
register-with-signature, after signature verification and before creating the session:
- If token gate is enabled, we call eth_call to check the wallet’s balance or ownership.
- If the condition is not met → 403 and a clear message (e.g. “Access requires holding at least 1 token(s) at 0x...”).
- If met (or gate disabled) → issue session and vault folder as today.
| Concept | Lit Protocol | mindX (this implementation) |
|---|---|---|
| Proof of identity | Social OAuth → PKP | Wallet signature over challenge |
| Public key | PKP public key | Wallet address (Ethereum) |
| Session | SessionSigs for PKP | Vault-backed session token |
| Gating access | ACCs (NFT, ERC20, custom call) | Optional token gate at session issuance |
| Where gating applies | Decryption / Lit Actions | Issuance of session + vault folder access |
If you later want Lit-based flows (e.g. social login → PKP, or Lit ACCs for decryption), that can sit alongside this: we keep wallet-signature identity and optional NFT/fungible gating for issuance, and add Lit where needed for specific features.