Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kidneyweakx/gohan-layer
A proof generate reward system
https://github.com/kidneyweakx/gohan-layer
Last synced: about 1 month ago
JSON representation
A proof generate reward system
- Host: GitHub
- URL: https://github.com/kidneyweakx/gohan-layer
- Owner: kidneyweakx
- License: apache-2.0
- Created: 2024-05-03T10:31:57.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-04T16:42:26.000Z (8 months ago)
- Last Synced: 2024-10-14T06:36:16.444Z (3 months ago)
- Language: TypeScript
- Homepage: https://gohan-layer.pages.dev
- Size: 16.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
Gohan Layer
A future proof generate reward system
[![License: ](https://img.shields.io/github/license/kidneyweakx/gohan-layer
)](./LICENSE)### Demo Page
- WebPage: [gohan-layer.page.dev](https://gohan-layer.pages.dev/)
- Contract Address
+ Base: https://sepolia.basescan.org/address/0x47f2b8e6483Cb8FCcd937d8bCC70390a5d334e77#code
+ Mantle: https://explorer.sepolia.mantle.xyz/address/0x47f2b8e6483Cb8FCcd937d8bCC70390a5d334e77#code
+ Polygon Cardona https://cardona-zkevm.polygonscan.com/address/0xe3a6b8Da8932354592E7F3f6199b82D6E2bdBDb2#code
+ OP Avail: https://op-avail-sepolia-explorer.alt.technology/address/0x8E42aB07232757CC0DA117d2846ff981E3eDCbdF#code
- Token Contract Address: [packages/contract/README.md](./packages/contract/README.md)### Abstract
Gohan-Layer is a liquidity pool leveraging a Data Availability Layer (DA) to generate and validate transaction proofs.- Problem Settlement:
+ **Lack of liquidity**: current DeFi solutions struggle with seamless operations across different layer 2.
+ **Lack of transparency**: Lots of people rely on Exchange to swap their token.
+ **High entry barriers in new chain**: New chain and learn new token.
- Soultion:
+ **Avail DA(Enhanced transparency )**: Using DA as our proof storage, everyone can verify it.
+ **SP1 ZKVM(Enhanced Safety)**: Use ZK to prove the actions on chain make it more secure.
+ **Lower Barriers**: miner will send money to your other chain account, it can be the chain expert in the fastest time!
### Build & Installation
| GohanLayer is a monorepo managed using `turbo`. You can find the source code for each package in the `apps` and `packages` directory.
- apps`
+ `apps/circuits` is the SP1 ZK circuits use for eigenlayer withdraw proof and also publish to DA
+ `apps/web` is the web frontend. It built by frontend template, `wagmi` and `vite`
- `packages`
+ `packages/contract` is the miner register contract and the test ERC20 token for test.### Step By Step
1. Install all peer dependencies
```bash
pnpm install
```2. Build only frontend
```bash
pnpm build --filter web
```3. Deploy Contract
```bash
cd packages/contract
pnpm deploy:token --networks
pnpm deploy:miner --networks
```4. Run the ZK Circuits
```bash
cd apps/circuits/script
cargo clean & cargo update
RUST_LOG=info cargo run --release
```
### Sequence Diagram
```mermaid
sequenceDiagram
actor U as User
actor M as Miner
participant C as MinerToken
participant L as LendingPool
participant S as SP1-ZKvm
participant DA as Avail-DA%% User
U ->>+ L: Stake some collateral into pool
L -->>- M: Listen event and get tx hash
%% Contract
M ->> C: Register as a miner (stake token)
M ->>+ S: use SP1 to generate zk proof (withdraw)
S ->>+ DA: Submit Compress zkProof to DA
DA -->>- M: Query Proof data and can let everyone verify
M ->>+ L: Send Proof and avail hash for verify
%% Withdraw
U ->> L: After prove collateral can lend money in other pool according collateral
```