Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bravonatalie/lit-storacha-demo
Exploring Lit Protocol
https://github.com/bravonatalie/lit-storacha-demo
decentralized encryption ipfs
Last synced: 18 days ago
JSON representation
Exploring Lit Protocol
- Host: GitHub
- URL: https://github.com/bravonatalie/lit-storacha-demo
- Owner: BravoNatalie
- Created: 2025-01-06T09:24:37.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-01-08T18:49:24.000Z (about 1 month ago)
- Last Synced: 2025-01-20T00:23:02.845Z (19 days ago)
- Topics: decentralized, encryption, ipfs
- Language: JavaScript
- Homepage:
- Size: 185 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lit Protocol & Storacha Demo
This demo showcases how to use the Lit network to encrypt data and enable decryption through a Lit Action, which performs custom authentication checks using the ucanto library.
### Setup
Before you start, run `pnpm install` to install dependencies.
### Steps to Run
1. **Build the Lit Action**:
```bash
pnpm run build-actions
```2. **Obtain the `ipfsHash`**:
Run the following command to get the IPFS CID v0:```bash
pnpm run ipfsCID
```Ensure that the hash matches the one in `src/acc.js`. If not, update it.
3. **Upload to IPFS**:
If you modified the Lit Action code, upload the generated files from `src/lit-actions/dist/` to IPFS (CID v0).4. **Encrypt the File**:
Run the encryption script, passing the file path:```bash
node src/encrypt.js testFile.md
```This will output `testFile-encrypted.md` and `dataToEncryptHash.json`, both required for decryption.
5. **Decrypt the File**:
With both output files from the encryption step, run the decryption script:```bash
node src/decrypt.js
```---
### More about Lit Protocol
Lit is a decentralized network where each node operates as a sealed machine, providing a Trusted Execution Environment (TEE). Nodes use Distributed Key Generation (DKG) to collaboratively generate public/private key pairs without any single party holding the entire key. Each node retains a key share for signing and decryption.
Key features relevant to this demo:
- Decentralized key management
- Client-side encryption
- Access control
- Lit Actions for custom workflows---
### Lit & Storacha Integration
- Lit Protocol enables private data storage on Storacha.
- Files encrypted with Lit can be stored on the Storacha network
- The decryption and access control are managed by Lit.
- Lit Actions can utilize [ucanto](https://github.com/storacha/ucanto) to provide custom decryption capabilities.---
### References
- [Lit Protocol Docs](https://developer.litprotocol.com/)
- [Storacha Network Docs](https://docs.storacha.network/)