Skip to content

Commit 459b00c

Browse files
zkVerify integration example for on-chain zk proof verification (#11)
## zkVerify [zkVerify](https://zkverify.io/) is a modular blockchain focused on proof verification. It's specifically enables blockchain networks to offload the computationally heavy and expensive process of zk (zero-knowledge) proof verification, drastically reducing cost. It's support multiple verification schemes, including Groth16. ## Considerations Assessed that zkVerify can reduce proof verification costs by >90% compared to native verification on Ethereum, at Galxe's scale, this translates to a significant costs dropping - a transformation that could generate millions in savings annually. Beyond pure cost reduction, this integration opens new possibilities for Web3 identity management. With around 1 million users actively using Galxe Passport, cheaper verification enables more frequent credential checks, enhanced privacy features, and broader accessibility to trustless credential systems for smaller projects. On a closing thought, we want to remark how specialized verification layers can solve real problems in large-scale identity systems, with the zkVerify-Galxe integration setting a new standard for efficient, accessible credential verification in Web3. --------- Co-authored-by: feka7 <feka7@hotmail.it>
1 parent 896f1f3 commit 459b00c

6 files changed

Lines changed: 1611 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ pnpm test
5858

5959
### NOTICE
6060

61-
If you saw build error when building a package that is depending on local packages, try `pnpm build` in the root directory first. It is because that dependencies were not built.
61+
If you saw build error when building a package that is depending on local packages, try `pnpm build` in the root directory first. It is because that dependencies were not built.

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"build": "echo NOTHING",
1313
"test": "echo TODO",
1414
"tutorial1": "ts-node -T src/tutorial1.ts",
15+
"useZkVerify": "ts-node -T src/useZkVerify.ts",
1516
"useNebraUpa": "ts-node -T src/useNebraUpa.ts",
1617
"prettier:write": "prettier --write ./src",
1718
"lint": "eslint --ignore-path ./.eslintignore --ext .js,.ts ."
@@ -27,7 +28,8 @@
2728
"node-fetch": "^3.3.2",
2829
"tslog": "^4.9.2",
2930
"typescript": "^5.4.5",
30-
"yargs": "^17.7.2"
31+
"yargs": "^17.7.2",
32+
"zkverifyjs": "^0.13.0"
3133
},
3234
"devDependencies": {
3335
"rimraf": "^5.0.6",

0 commit comments

Comments
 (0)