At a hackathon or working on a personal project and interested in integrating Lit into your project? Here's a handy guide on how to integrate Lit with a few examples and tutorials.
What does Lit Protocol do?
Access Control
Lit Protocol's main feature is a decentralized access control protocol running on top of EVM chains and Solana. With Lit, you can harness on-chain access control conditions to do 4 main things:
Encrypt and lock static content (images, videos, music, etc) behind an on chain condition (for example, possession of an NFT).
Decrypt static content that was locked behind an on chain condition.
Authorize network signatures that provide access to dynamic content (for example, a server or network resource) behind an on chain condition.
Request a network signed JWT that provisions access and authorization to dynamic content behind an on chain condition.
Encryption
Store private data on the open web and use Lit to provision decentralized keys to users based on on-chain data, like the assets they hold in their wallet.
Programmable + Distributed Cloud Wallets
Use Lit as a decentralized serverless function platform to create applications that write data to public state machines like blockchains and storage networks. Create automated agents for user funds and data.
Tutorials, Guides and Examples:
Decentralized Unlockable Content
Content stored on the decentralized web is platform-less and public. This introduces privacy concerns as we now have a fully accessible online world. Since this content is stored publicly, we need a way to keep information private. How do we keep publicly searchable content private? Through encryption! Check out this guide to create private, decentralized content with Lit Protocol.
Ceramic integration
Store encrypted data on Ceramic. The data on Ceramic by default public; use this tool to store private data in your dApp. Check out an example integration here.
Arweave x Bundlr
Read this guide on how to encrypt data using Lit Protocol, upload it to Arweave using Bundlr, fetch the Lit encrypted data, and decrypt using Lit.
NextJS: Token Gate a URL Page
This is a minimal example of how to token-gate a Next.js page within the getServerSideProps
. This example was created by Nader Dabit.
Authorize Dynamic Content via JWT: Cloudflare x Lit Protocol
Use decentralized threshhold encryption to set access controls that are only accessible by who you give access to - even on centralized services like Cloudflare.
Lit x Cloudflare Code Template for URL Gating, GitHub Repo
Lit Documentation to Authorize Dynamic Content via JWT
Encryption and Private Data Using Lit
Check out this video that explains how to add encryption and private data using Lit Protocol. This video was created by Lit’s CTO and co-founder, Chris Cassano.
Lit Actions + Programmable Key Pairs (PKPs)
Smart contracts are powerful but generally isolated to the blockchain ecosystem on which they reside. Things like oracles and bridges help but must be set up on a case-by-case basis.
What if a smart contract could have it's own public and private key-pair, just like any other wallet? And what if that smart contract had the ability to make arbitrary HTTP requests and use the data in it's computation? Imagine smart contracts that can read and write from any HTTP endpoint, blockchain, state machine, or decentralized storage system.
We're building this at Lit: The smart contracts are Lit Actions and the key-pairs they can use are PKPs.
Check out this example utilizing Lit Actions & PKPs with Ceramic. You can find an example React App implementation that talks to Ceramic and signs with Lit Actions / PKPs here: https://github.com/LIT-Protocol/lit-action-ceramic-signing-demo.
In Berlin for Blockchain Week?
Come meet the team at Gorlitzer Park on Sept 16th, 3pm - 5pm CET. Join for snacks before the ETHBerlin opening ceremony, come meet other builders and listen to some Berlin selectors. RSVP here.