Skip to content

Commit

Permalink
chore: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Envoy-VC committed Aug 11, 2024
1 parent 6f22453 commit f5f04fb
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 48 deletions.
190 changes: 143 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,177 @@
# Turborepo starter
<p align="center">
<img src="./assets/logo.svg" alt="SchemaCraft" width="200px"/></p>

This is an official starter Turborepo.
SchemaCraft is an Attestation Developer Tool for Ethereum Attestation Service. The project consists of two parts:

## Using this example
1. **Attest Chain** - A L3 Chain tailored specifically for attestations. It is built using OP Stack with EigenDA, deployed using Conduit. It uses Base Sepolia as a L2 Chain.
2. **EAS UIKit** - A developer tool in form of a npm component library which has various components like Schema Builder, Schema Viewer, Attestation Requester, Attestation Viewer, etc.

Run the following command:
## Architecture 🏗️

```sh
npx create-turbo@latest
<img src="./assets/2.png" alt="Attest Chain" >

## How it works 🛠️

### Attest Chain

The Custom Attest Chain is deployed using Conduit and is built on OP Stack with EigenDA.

The main modification are in sequencer nodes, where the batches of transactions are posted to DA and state roots of executed transactions are sent to the DA.

When transaction is written to Eigen DA the disperser return as unique blob key which can be used to later retrieve the data

We also have deployed EAS Contract on Attest chain on the following addresses

```bash
EAS=0xe86b1899376c77e1a109eA2124E462EF58E56897
SchemaRegistry=0x8f966BC6Ad2D241a01C1f7634C47c7419Ce96830
Indexer=0xA787c2162F60559eC602C33b5720e51ec19bfF5F
EIP712Proxy=0x2Df018Bf17f31e81a0677C77Fa90A23f9FceCF59
```

## What's inside?
Also the custom chain comes with an open source Blockscout explorer.

This Turborepo includes the following packages/apps:
Block Explorer: https://explorer-attest-chain-52s82yu298.t.conduit.xyz

### Apps and Packages
---

- `docs`: a [Next.js](https://nextjs.org/) app
- `web`: another [Next.js](https://nextjs.org/) app
- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
### Virtual Testnet

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
The Virtual Testnet is deployed using Tenderly and is used for testing the Attest Chain. It is based on Base Sepolia and EAS Contracts are deployed on the Virtual Testnet.

### Utilities
Block Explorer: https://virtual.base.rpc.tenderly.co/1f98648a-38db-493e-9560-f23a8254c17d

This Turborepo has some additional tools already setup for you:
---

- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting
### EAS UIKit

### Build
EAS UIKit is a collection of components and utilities used to build applications on top of Ethereum Attestation Service. Developers can quickly build applications that interact with the EAS smart contracts by using the components provided by EAS UIKit.

To build all apps and packages, run the following command:
https://www.npmjs.com/package/eas-uikit

To get started with EAS UIKit, you can install the package using the following command/s:

```bash
npm install eas-uikit
# or
yarn add eas-uikit
# or
pnpm add eas-uikit
```
cd my-turborepo
pnpm build

```tsx
<SchemaBuilder
registryAddress='0x0a7E2Ff54e76B8E6659aedc9103FB21c038050D0' // Sepolia Schema Registry Address
onSuccess={(uid) => console.log('Schema created with uid:', uid)}
/>
```

### Develop
```tsx
<AttestSchema
schemaUID='0xa1d848a3e4fc480df46ab83f0708ff436a8cc2e5d33ae96b10dba43f3ddc6b7c'
easContractAddress='0xC2679fBD37d54388Ce493F1DB75320D236e1815e' // Sepolia EAS Contract Address
registryAddress='0x0a7E2Ff54e76B8E6659aedc9103FB21c038050D0' // Sepolia Schema Registry Address
signer={signer}
/>
```

To develop all apps and packages, run the following command:
Full Documentation can be found [here](./packages/eas-uikit/README.md)

```
cd my-turborepo
pnpm dev
```
---

### World ID

The application uses World ID to gate access to verified users with `Device` type or `Orb` level verification.

The verification is done using Incognito Action and verified using Cloud Verification. This returns `merkle_root`, `nullifier_hash` and `proof`

The Proofs along with nullifier hash are stored in session cookies with checks ensuring that proofs are valid.

### Remote Caching
## Demo Video 🎥

Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
https://stream.mux.com/dEIk6ycEm02Didw7eMW01wKH02R7rhj37mqRg01RELiStL00/high.mp4

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:
## Screenshots 📸

<table>
<tr>
<td valign="top" width="50%">
<br>
<img src="./assets/1.png" alt="Cover" >
</td>
<td valign="top" width="50%">
<br>
<img src="./assets/2.png" alt="Home Page" >
</td>
</tr>
</table>

<table>
<tr>
<td valign="top" width="50%">
<br>
<img src="./assets/3.png" alt="Peer Select" >
</td>
<td valign="top" width="50%">
<br>
<img src="./assets/4.png" alt="Vault Create" >
</td>
</tr>
</table>

<table>
<tr>
<td valign="top" width="50%">
<br>
<img src="./assets/5.png" alt="Face Capture" >
</td>
<td valign="top" width="50%">
<br>
<img src="./assets/6.png" alt="Dashboard" >
</td>
</tr>
</table>

## 🧑🏼‍💻 Tech Stack

- **Frontend**: Next.js, Tailwind CSS, shadcn
- **Integration**: `@worldcoin/idkit`, `wagmi`, Conduit, Tenderly, `eas-sdk`
- **Contracts**: `Ethereum Attestation Service`

## Get Started 🚀

The following repository is a turborepo and divided into the following:

- **apps/www** - The web application built using NextJS.

First install the dependencies by running the following:

```
cd my-turborepo
npx turbo login
pnpm install
```

This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
Then fill in the Environment variables in `apps/www/.env.local`

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
```bash
NEXT_PUBLIC_WALLETCONNECT_ID="your_wallet_connect_id"
NEXT_PUBLIC_ATTEST_CHAIN_TESTNET_RPC_URL="tenderly_virtual_base_rpc"
NEXT_PUBLIC_ATTEST_CHAIN_TESTNET_BLOCK_EXPLORER_URL="tenderly_virtual_base_block_explorer"

```
npx turbo link
NEXT_PUBLIC_ATTEST_CHAIN_RPC_URL="https://rpc-attest-chain-52s82yu298.t.conduit.xyz"
NEXT_PUBLIC_ATTEST_CHAIN_WSS="wss://rpc-attest-chain-52s82yu298.t.conduit.xyz"
NEXT_PUBLIC_ATTEST_CHAIN_BLOCK_EXPLORER_URL="https://explorer-attest-chain-52s82yu298.t.conduit.xyz"

NEXT_PUBLIC_WORLDCOIN_CLIENT_ID="your_worldcoin_client_id"

IRON_SESSION_PASSWORD="your_secured_session_password"
```

## Useful Links
Then run the following command to start the application:

Learn more about the power of Turborepo:
```bash
pnpm dev
```

- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
---
Binary file added assets/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f5f04fb

Please sign in to comment.