Skip to content

Latest commit

 

History

History
158 lines (110 loc) · 6.17 KB

README.md

File metadata and controls

158 lines (110 loc) · 6.17 KB

Literals

A Protocol To Create And Distribute Provable Facts To Enable Trust

About

This project introduces a unique way to use IPFS & Lit Protocol's accessControlConditions. Lit Protocol is typically used to maintain secrecy. This project uses Lit Protocol, IPFS and Covalent network to create a mechanism to share verifiable bits of truths by maintaining and serving JWTs received from Lit Protocol verification. Literal creates a web of accessControlConditions that are published to IPFS. Each accessControlCondition is published on IPFS and on the Lit Network. Any user who wishes to show proof of passing these conditions is then made to get JWTs for each condition. These JWTs do not provide access to any real world resources and can be shared as proofs of passing a certain condition. These proofs are called Literals and are stored on IPFS and Literal network. They are shown as tags. Any web3 platform can query these literals for an address and can show and verify relevant tags. These tags can be verified by anyone on the client side.

Components

IPFS

Used to store accessControlConditions and proofs generated by each users for any condition. This project uses NFT.Storage for IPFS interactions.

Lit Protocol

Used to generate proof for an accessControlCondition

Covalent

Used for Just In Time mode of interpreting conditions

Scaffolding

This project was bootstrapped with Create Eth App.

Project Structure

The default template is a monorepo created with Yarn Workspaces.

Workspaces makes it possible to setup multiple packages in such a way that we only need to run yarn install once to install all of them in a single pass. Dependencies are hoisted at the root.

my-eth-app
├── README.md
├── node_modules
├── package.json
├── .gitignore
└── packages
    ├── contracts
    │   ├── README.json
    │   ├── package.json
    │   └── src
    │       ├── abis
    │       │   ├── erc20.json
    │       │   └── ownable.json
    │       ├── addresses.js
    │       └── index.js
    ├── react-app
    │   ├── README.md
    │   ├── node_modules
    │   ├── package.json
    │   ├── public
    │   │   ├── favicon.ico
    │   │   ├── index.html
    │   │   ├── logo192.png
    │   │   ├── logo512.png
    │   │   ├── manifest.json
    │   │   └── robots.txt
    │   └── src
    │       ├── App.css
    │       ├── App.js
    │       ├── App.test.js
    │       ├── ethereumLogo.svg
    │       ├── index.css
    │       ├── index.js
    │       ├── serviceWorker.js
    │       └── setupTests.js
    └── subgraph
        ├── README.md
        ├── abis
        │   └── erc20.json
        ├── package.json
        ├── schema.graphql
        ├── src
        │   └── mappings
        │       ├── tokens.ts
        │       └── transfers.ts
        └── subgraph.yaml

Owing to this dependency on Yarn Workspaces, Create Eth App can't be used with npm.

Available Scripts

In the project directory, you can run:

React App

yarn react-app:start

Runs the React app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.

yarn react-app:test

Runs the React test watcher in an interactive mode.
By default, runs tests related to files changed since the last commit.

Read more about testing React.

yarn react-app:build

Builds the React app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the React documentation on deployment for more information.

yarn react-app:eject

Note: this is a one-way operation. Once you react-app:eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject the React app at any time. This command will remove the single build dependency from your React package.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into the react-app package so you have full control over them. All of the commands except react-app:eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use react-app:eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Subgraph

The Graph is a tool for for indexing events emitted on the Ethereum blockchain. It provides you with an easy-to-use GraphQL API.

To learn more, check out the The Graph documentation.

yarn subgraph:codegen

Generates AssemblyScript types for smart contract ABIs and the subgraph schema.

yarn subgraph:build

Compiles the subgraph to WebAssembly.

yarn subgraph:auth

Before deploying your subgraph, you need to sign up on the Graph Explorer. There, you will be given an access token. Drop it in the command below:

GRAPH_ACCESS_TOKEN=your-access-token-here yarn subgraph:auth

yarn subgraph:deploy

Deploys the subgraph to the official Graph Node.

Replace paulrberg/create-eth-app in the package.json script with your subgraph's name.

You may also want to read more about the hosted service.