Zero-Knowledge Proof Credentials on Sui Blockchain with Walrus Decentralized Storage
A cutting-edge decentralized identity verification system that proves your credentials without revealing your personal information. Built with Groth16 ZK-SNARKs, Sui blockchain, and Walrus storage.
In today's digital world, proving your identity or credentials means sacrificing privacy:
- π Companies collect and store your personal data
- π Your exact age, income, and identity are exposed
- π― Data breaches put millions at risk
- π Centralized systems control your information
ZK Credential enables you to prove statements about yourself without revealing the underlying data:
β
Prove you're over 18 β Without revealing your exact age
β
Prove your income meets requirements β Without disclosing exact salary
β
Prove you passed KYC β Without exposing personal details
How?
- π¬ Zero-Knowledge Proofs (Groth16) - Cryptographic proofs that are mathematically impossible to fake
- βοΈ Sui Blockchain - Immutable verification and credential minting
- πΎ Walrus Storage - Decentralized, permanent credential storage
- π Browser-Based - No servers, no databases, complete client-side execution
| Scenario | What You Prove | What You Hide |
|---|---|---|
| DeFi Lending | Income > $30,000 | Exact income amount |
| Age-Restricted Services | Age β₯ 18 | Exact birthdate |
| Premium Access | KYC verified | Identity documents |
| Credit Applications | Creditworthy status | Financial details |
graph TB
A[User Input] --> B[ZK Proof Generator]
B --> C[Groth16 Circuit]
C --> D[Proof + Public Signals]
D --> E[WASM Serializer]
E --> F[Arkworks Format]
F --> G[Sui Smart Contract]
G --> H[On-Chain Verification]
H --> I[Credential NFT Minted]
D --> J[Walrus Storage]
J --> K[Permanent Blob Storage]
I --> L[Success Screen]
K --> L
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 16 + TypeScript | Modern React framework |
| Styling | Tailwind CSS + shadcn/ui | Beautiful, responsive UI |
| ZK Proofs | Circom + Groth16 + SnarkJS | Zero-knowledge circuit & proof generation |
| Blockchain | Sui Network (Testnet) | On-chain verification & NFT minting |
| Storage | Walrus (Testnet) | Decentralized credential storage |
| Serialization | Rust + WASM (Arkworks) | Proof format conversion |
| Wallet | Sui Wallet / Mysten dApp Kit | Blockchain interaction |
- Node.js 20+
- A Sui Wallet (install from Sui Wallet)
- Some testnet SUI tokens (faucet)
# Clone the repository
git clone https://github.com/yourusername/zkcredential.git
cd zkcredential
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your configuration
# NEXT_PUBLIC_SUI_PACKAGE_ID=<your_deployed_package_id>
# NEXT_PUBLIC_WALRUS_ENDPOINT=https://testnet.walrus.xyznpm run devOpen http://localhost:3000 in your browser.
- Click "Connect Wallet" in the top-right corner
- Select your Sui Wallet
- Approve the connection
Enter your credentials:
- Age: Your actual age (e.g., 25)
- Income: Your monthly income in Rupiah (e.g., 35000000)
- KYC Status: Select "Verified"
π‘ Privacy Note: This data never leaves your browser!
Click "Generate Proof"
The app will:
- β Run the Circom circuit locally in your browser
- β Generate a cryptographic proof
- β Create public signals (only reveals: age β₯ 18, income β₯ 30M, KYC = true)
Time: ~3-5 seconds
Click "Upload to Walrus"
The app will:
- β Package your credential data
- β Upload to Walrus decentralized storage
- β Receive a permanent Blob ID
Result: Your data is now stored forever on Walrus!
Click "Submit to Blockchain"
The app will:
- β Serialize proof using Arkworks (WASM)
- β Send transaction to Sui smart contract
- β Verify proof on-chain using Groth16
- β Mint credential NFT
Your wallet will prompt you to approve the transaction.
Success! Your credential is now:
- β Verified on Sui blockchain
- β Stored permanently on Walrus
- β Accessible as an NFT
On the success screen, you'll see:
Walrus Blob ID
z3UAJMCNDQPMxxxxxxxxx
[View on Walrus] π
Click the button to open Walruscan:
π URL: https://walruscan.com/testnet/blob/YOUR_BLOB_ID
What you'll see:
- β Your credential data stored as a blob
- β Storage metadata (size, upload time)
- β Proof that data is on Walrus testnet
On the success screen, you'll see:
Transaction Hash
0x8a3f2b1c9e4d7b5a...
[View on Sui Explorer] π
Click the button to open SuiScan:
π URL: https://suiscan.xyz/testnet/tx/YOUR_TX_HASH
What you'll see:
- β Transaction details (sender, gas used, status)
- β
Smart contract called:
zk_credential::verify_proof - β Events emitted (proof verified, NFT minted)
- β On-chain confirmation
Open browser console (F12) and look for:
β
Proof generated successfully
β
Public Signals: ["1", "1", "1"] // [age>=18, income>=30M, KYC=true]
β
Walrus Blob ID: z3UAJMCNDQPMxxxxxxxxx
β
Sui Transaction: 0x8a3f2b1c9e4d7b5a...# Test Walrus upload
curl -X PUT https://testnet.walrus.xyz/v1/store \
--data-binary @test.json \
-H "Content-Type: application/octet-stream"
# Test Sui RPC
curl -X POST https://fullnode.testnet.sui.io:443 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"sui_getChainIdentifier"}'Walrus Response:
{
"newlyCreated": {
"blobObject": {
"id": "0x...",
"blobId": "z3UAJMCNDQPM..."
}
}
}Sui Response:
{
"jsonrpc": "2.0",
"result": "testnet-1",
"id": 1
}β
File: lib/walrusStorage.ts
β
Endpoint: https://testnet.walrus.xyz
β
Method: PUT /v1/store
β
Returns: Permanent Blob ID
β
File: lib/smartContract.ts
β
Package ID: 0x91e5baf5bb184dc7b1eeca481d2720a7ea918c5967bbffa6e6573a67d51c1ef8
β
Contract: contracts/sources/verifier.move
β
Function: groth16::verify_groth16_proof
// lib/zkProof.ts
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
{ age: 25, income: 35000000, kycStatus: 1 },
"/circuits/credential.wasm",
"/circuits/credential_final.zkey"
);Output:
proof: Groth16 proof (3 points: A, B, C)publicSignals:["1", "1", "1"](only boolean results!)
// lib/walrusStorage.ts
const response = await fetch('https://testnet.walrus.xyz/v1/store', {
method: 'PUT',
body: credentialData
});
const { blobId } = await response.json();
// blobId: "z3UAJMCNDQPMxxxxxxxxx"// vk-converter/src/lib.rs
use ark_serialize::CanonicalSerialize;
let proof_bytes = proof.serialize_compressed();
// Converts to Arkworks format for Sui Move// contracts/sources/verifier.move
public fun verify_and_mint(
proof: vector<u8>,
public_inputs: vector<u8>,
vk: vector<u8>,
ctx: &mut TxContext
) {
// Verify proof using groth16::verify_groth16_proof
assert!(verified, E_INVALID_PROOF);
// Mint credential NFT
let credential = Credential { ... };
transfer::transfer(credential, sender(ctx));
}# Run deployment script
./deploy.sh
# Follow Railway setup instructions
# See: RAILWAY_DEPLOYMENT.mdLive Demo: [Your Railway URL]
- β Zero-Knowledge: Proofs reveal nothing beyond the statement
- β Client-Side: All computation happens in your browser
- β No Backend: No server stores your data
- β Immutable: Blockchain records can't be altered
- β Decentralized: Walrus ensures data availability
- Groth16: Industry-standard ZK-SNARK
- Trusted Setup: Uses Powers of Tau ceremony
- Curve: BN254 (same as Ethereum)
- Security Level: 128-bit
zkcredential/
βββ app/ # Next.js app directory
βββ components/ # React components
βββ lib/ # Core libraries
β βββ zkProof.ts # ZK proof generation
β βββ walrusStorage.ts # Walrus integration
β βββ smartContract.ts # Sui integration
β βββ wasmSerializer.ts # Arkworks serialization
βββ contracts/ # Sui Move contracts
β βββ sources/
β βββ verifier.move # On-chain verifier
βββ vk-converter/ # Rust WASM module
βββ public/
β βββ circuits/ # ZK circuits (.wasm, .zkey)
β βββ wasm/ # Compiled WASM modules
βββ scripts/ # Deployment scripts
| File | Purpose |
|---|---|
lib/zkProof.ts |
Generates Groth16 proofs using SnarkJS |
lib/walrusStorage.ts |
Uploads data to Walrus storage |
lib/smartContract.ts |
Interacts with Sui blockchain |
vk-converter/src/lib.rs |
Serializes proofs to Arkworks format |
contracts/sources/verifier.move |
On-chain proof verification & NFT minting |
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
Built with:
Made with β€οΈ for a privacy-first future
- Live Demo: [Your Railway URL]
- Sui Package:
0x91e5baf...c1ef8 - GitHub: github.com/yourusername/zkcredential
π Ready to prove your credentials without revealing your secrets? Let's go!










