🔐 Lit Secrets: A secure secret manager built on Lit Protocol that ensures your API keys & credentials can only be used within pre-approved code. No more worrying about leaked keys - cryptographic guarantees for how your secrets are used
Description
Lit Secrets is a secure secret management solution built on Lit Protocol that fundamentally changes how sensitive credentials are handled in applications. Unlike traditional secret managers that rely solely on encryption, Lit Secrets adds a crucial layer of control by cryptographically binding secrets to specific code executions.
At its core, the system ensures that secrets (like API keys, access tokens, or any sensitive data) can only be decrypted and used within pre-approved Lit Actions - secure, verifiable code environments. This means when you store a secret, you're not just encrypting it; you're explicitly defining how it can be used.
Key features:
The current implementation includes:
Future development roadmap:
Use cases include:
The project aims to solve the fundamental problem of secret misuse while providing a developer-friendly interface for managing sensitive credentials across modern applications.
Lit Secrets is built using a combination of modern web technologies and Lit Protocol's encryption infrastructure. Here's a detailed breakdown of the technical implementation:
Core Technologies:
Key Implementation Details:
const accessControlConditions = [{
contractAddress: "ipfs://[LIT_ACTION_CID]",
standardContractType: "LitAction",
chain: "ethereum",
method: "checkVal",
parameters: [litActionCid],
returnValueTest: { comparator: "=", value: "true" }
}]
The encryption process binds secrets to specific Lit Actions using access control conditions. This is implemented through Lit Protocol's encryptString
function, which returns a cipher text and verification hash.
const sessionSignatures = await litNodeClient.getSessionSigs({
chain: "baseSepolia",
expiration: new Date(Date.now() + 1000 * 60 * 10).toISOString(),
resourceAbilityRequests: [
{
resource: new LitActionResource("*"),
ability: LitAbility.LitActionExecution,
},
]
});
The execution environment uses session signatures and wallet authentication to ensure secure access to secrets.
Notable Technical Solutions:
Dynamic Access Control: Created a flexible system for defining access control conditions that can accommodate various use cases while maintaining security.
Secret Storage: Implemented a secure storage solution using browser local storage that maintains encryption while allowing searchable access to secret metadata.
Session Management: Built a robust session management system using SIWE and Lit Protocol's session signatures to ensure secure access across page reloads.
Partner Technologies Used:
Lit Protocol:
Challenges and Solutions:
Secret Binding: Challenge: Ensuring secrets could only be used in approved contexts. Solution: Implemented custom access control conditions that cryptographically bind secrets to specific Lit Actions.
User Experience: Challenge: Making complex cryptographic operations user-friendly. Solution: Built an intuitive interface that abstracts the complexity while maintaining security.