labdao / openlab-cli

Openlab - decentralised bioinformatics services - from the command line.
https://cli.openlab.tools
MIT License
19 stars 3 forks source link

RFC: threshold encryption and token-gating of static objects #23

Open NiklasTR opened 2 years ago

NiklasTR commented 2 years ago

Hi frens,

over the last couple of weeks, I have been looking into various ways to enable scientists to store sensitive information in an encrypted but decentralized fashion. As a community we talked to multiple providers that develop solutions in the problem space of decentralized file access. Some of the providers I have identified are listed below:

After looking into all the above protocols and talking to folks at most of them, I believe the most promising infrastructure we can build on is lit protocol. They have built out a JS SDK for decentralized threshold encryption of static objects that can be exposed via IPFS. It is the most straightforward-looking tool I have seen so far for static content.

https://litprotocol.com/ https://developer.litprotocol.com/docs/intro/ https://developer.litprotocol.com/docs/SDK/staticContent

NiklasTR commented 2 years ago

The process to manage access to static content looks like this:

writing

  1. [[authSig]] - prove ownership of the [[metamask]] key pair
  2. perform [[symmetric encryption]]
  3. define [[access control condition]]
  4. store the [[symmetric encryption]] key with the [[access control condition]] on the [[lit protocol]] - defines an encrypted symmetric key
  5. save the following three files
    1. encrypted static object
    2. encrypted [[symmetric encryption]] key
    3. [[access control condition]]

reading

  1. pull the following files
    1. encrypted static object
    2. encrypted symmetric encryption key
    3. access control condition
  2. [[authSig]] of the user to prove ownership
  3. obtain the decrypted symmetric key from the lit network based on the control condition and the user's authSig
  4. decrypt the encrypted static object with the symmetric key
  5. return object