Irys-xyz / irys-lit

Example showing how to use Irys with Lit protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encrypting on-chain data

Data uploaded to Irys is stored permanently on Arweave. Once on Arweave, this data becomes publicly accessible, anyone can view or retrieve it. For projects where privacy is a concern, you can use LitProtocol to encrypt data before storing it on Irys.

This repository teaches you how to:

  • Encrypt data before storing it on-chain
  • Establish a set of rules determining who can decrypt the data
  • Decrypt data

Technology

  • Irys for uploading data
  • Lit v3 for encrypting and decrypting data

Encrypting data

There are three steps to encrypting data

  • Obtain a wallet signature (AuthSig), which proves you own a wallet
  • Define access control conditions for who can decrypt your data
  • Connect to a Lit node and request that it encrypt your data

Once encrypted, use Irys to store your data on Arweave.

Decrypting data

There are three steps to decrypting data:

  • Obtain a wallet signature (AuthSig), which proves you own a wallet
  • Retrieve data stored on Arweave via the Irys gateway
  • Connect to a Lit node and request it decrypt your data

Docs

For a deeper dive, check out our docs:

Installation

  1. Clone this repository
  2. Rename .env.example to .env and add a private key
  3. cd irys-lit
  4. yarn

Install with yarn only. There is currently a bug in the Lit Protocol npm install script, it will be fixed soon

Running

  1. node scripts/lit-irys.js

About

Example showing how to use Irys with Lit protocol


Languages

Language:JavaScript 96.6%Language:TypeScript 3.4%