Skip to content

Commit ede8ccd

Browse files
committed
feat: add zkVerify tutorial
1 parent 896f1f3 commit ede8ccd

4 files changed

Lines changed: 391 additions & 0 deletions

File tree

apps/tutorial/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
NEBRA_SIGNER_PK=""
2+
ZKVERIFY_SIGNER_PK=""

apps/tutorial/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,68 @@ Create `.env` file using `.env.example` as a template. Update `NEBRA_SIGNER_PK`
3030
```bash
3131
pnpm run useNebraUpa
3232
```
33+
# useZkVerify
34+
35+
## Overview
36+
A demonstration project for integrating zkVerify with Galxe Identity Protocol. This integration aims to significantly reduce verification costs while maintaining security.
37+
38+
### Prerequisites
39+
- Node.js (Latest LTS version)
40+
- pnpm
41+
- Account with testnet ETH
42+
43+
## Workflow Overview
44+
The verification process consists of three main steps:
45+
46+
1. **Credential Issuance**
47+
- Issuer creates and issues credentials to the user
48+
- Credentials contain verifiable claims about the user
49+
50+
2. **Proof Generation**
51+
- User generates zero-knowledge proofs
52+
- Proofs demonstrate specific statements about their credentials
53+
- Preserves privacy while proving credential validity
54+
55+
3. **Verification via zkVerify**
56+
- Proofs are submitted to zkVerify for verification
57+
- Can be done through direct verification or registered key method
58+
- Ensures efficient and cost-effective verification
59+
60+
### Verification Methods
61+
1. **Registered Key Verification**
62+
- Transaction Hash: [0x11c2ddf64b5ddfcb1b1404d655ac41f23190f579f4bf2d79d612375df7a1fbf6](https://zkverify-explorer.zeeve.net/extrinsics/0x11c2ddf64b5ddfcb1b1404d655ac41f23190f579f4bf2d79d612375df7a1fbf6)
63+
64+
2. **Direct Verification**
65+
- Transaction Hash: [0x7d7a24d8c0c47fcc03f24ec54fa4575f6806bc7f9ef202eff7172496a14c27a2](https://zkverify-explorer.zeeve.net/extrinsics/0x7d7a24d8c0c47fcc03f24ec54fa4575f6806bc7f9ef202eff7172496a14c27a2)
66+
67+
68+
### Configuration
69+
Add to `.env`:
70+
```
71+
ZKVERIFY_SIGNER_PK=your_private_key_here
72+
```
73+
### run
74+
75+
```bash
76+
pnpm run useZkVerify
77+
```
78+
79+
## Note
80+
81+
### Cost Reduction
82+
- >90% reduction in proof verification costs compared to native Ethereum verification
83+
- Significant savings at Galxe's scale (31M+ active users)
84+
85+
### Scalability
86+
- Supports Galxe's 350k+ credentials
87+
- Enables more frequent credential checks
88+
- Enhanced privacy features
89+
- Improved accessibility for smaller projects
90+
91+
### Technical Advantages
92+
- Supports multiple verification schemes (Groth16, Fflonk, Risc0)
93+
- Modular blockchain focused on proof verification
94+
- Efficient on-chain verification process
95+
96+
## Additional Resources
97+
- [zkVerify Documentation](https://zkverify.io/)

apps/tutorial/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"test": "echo TODO",
1414
"tutorial1": "ts-node -T src/tutorial1.ts",
1515
"useNebraUpa": "ts-node -T src/useNebraUpa.ts",
16+
"useZkVerify": "ts-node -T src/useZkVerify.ts",
1617
"prettier:write": "prettier --write ./src",
1718
"lint": "eslint --ignore-path ./.eslintignore --ext .js,.ts ."
1819
},
@@ -27,7 +28,9 @@
2728
"node-fetch": "^3.3.2",
2829
"tslog": "^4.9.2",
2930
"typescript": "^5.4.5",
31+
"zkverifyjs": "^0.3.1",
3032
"yargs": "^17.7.2"
33+
3134
},
3235
"devDependencies": {
3336
"rimraf": "^5.0.6",

0 commit comments

Comments
 (0)