Kasbah is a privacy-focused confidential token protocol built on Solana that enables secure, private token transfers using zero-knowledge proofs.
Kasbah allows users to:
- Deposit tokens into commitment pools with zero-knowledge proofs
- Generate off-chain receipts that can be sent to recipients
- Redeem tokens without revealing the connection between deposit and withdrawal transactions
This ensures transaction privacy while maintaining the security and auditability required for blockchain applications.
-
Solana Program (
programs/kasbah)- Core protocol implementation with treasury and commitment pools
- Handles deposit and redemption operations
-
Zero-Knowledge Circuits (
circuits/)- Implements
KasbahCommitmentCircuitfor ZK proofs - Uses Poseidon hash functions for commitments and Merkle tree verification
- Implements
-
WebAssembly Module (
wasm/)- Client-side ZK proof generation
- Handles format conversions for proofs
-
Verifier (
verifier/)- On-chain verification of Groth16 proofs
- Adapted from Lightprotocol's implementation
-
Deposit Flow:
- User deposits tokens, creating a commitment
- Commitment is added to an on-chain commitment pool
- User generates a receipt with recipient information
-
Redemption Flow:
- Recipient uses the receipt to generate a zero-knowledge proof
- Proof is submitted to the Kasbah program
- System verifies the proof and sends tokens to recipient
- Nullifiers prevent double-spending
- Blockchain: Solana
- Programming Languages: Rust, TypeScript
- Smart Contract Framework: Anchor
- Zero-Knowledge Proofs: Groth16 proofs
- ZK Circuit Language: Circom
- Client-Side Proof Generation: WebAssembly (WASM)
- Rust (1.70.0+)
- Solana CLI (1.16.0+)
- Anchor (0.28.0+)
- Node.js (16+)
- Circom (2.0.0+)
-
Clone the repository:
git clone https://github.com/yourusername/kasbah-capstone.git cd kasbah-capstone -
Install dependencies:
npm install
-
Build the project:
anchor build
-
Build the WASM module:
cd wasm cargo build --release cd ..
Run the test suite to verify the installation:
anchor testTo rebuild the circuits:
cd circuits
circom ksb.circom --r1cs --wasmnpm run generate-clientsThis project implements several security measures:
- Zero-Knowledge Proofs: For privacy-preserving verification
- Nullifiers: To prevent double-spending
- Commitment Pools: To organize and secure deposit data
- On-chain Verification: Using Solana's bn254 verification syscall
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Adapted verifier from Lightprotocol's implementation
- Built on Solana blockchain
- Uses Anchor framework for Solana development