A comprehensive zero-knowledge authentication system for file verification, built on Starknet with a full-stack implementation.
This project implements a decentralized file authentication system using Cairo smart contracts on Starknet, combined with a modern web interface and Java backend. Files are registered on-chain with immutable timestamps and cryptographic hashes, enabling trustless verification of authenticity and provenance.
- Cairo Smart Contract: File authentication registry deployed on Starknet
- Next.js Frontend: Modern React interface for file upload and verification
- Java Backend: Spring Boot API for file processing and blockchain integration
- Starknet Integration: Zero-knowledge proof verification system
- Frontend: Next.js 15, TypeScript, React 19
- Backend: Spring Boot 3.5, JPA, Lombok
- Smart Contract: Cairo, Starknet
- Network: Starknet Sepolia Testnet
Contract Address: 0x06ebf0234be358bd087fdf5165d4b5cf7103fa1d00b8a4edb32b6e61b6d764f0
Explorer: View on Starkscan
Test it with your own wallet (account) or, Just use 0x06ecb9425da32b868721a6b9dd609879eb81d6b80494bff9dcf2e3b002801d2f to see if it works. (Thanks to Starknet sepolia faucet)
register_file()- Register a new file with metadataverify_file()- Verify file authenticity and get detailsis_file_registered()- Check if file exists in registryget_author_files()- Get all files by author
- Node.js 18+
- Java 17+
- Starknet Foundry (for contract interaction)
cd next_frontend
npm install
npm run devcd java_backend
./gradlew bootRun# Verify file registration
sncast call --contract-address 0x06ebf0234be358bd087fdf5165d4b5cf7103fa1d00b8a4edb32b6e61b6d764f0 --function "is_file_registered" --calldata <file_hash>
# Register new file
sncast invoke --contract-address 0x06ebf0234be358bd087fdf5165d4b5cf7103fa1d00b8a4edb32b6e61b6d764f0 --function "register_file" --calldata <file_hash> <filename> <file_type> <file_size>zk-auth-cairo/
βββ next_frontend/ # Next.js frontend application
βββ java_backend/ # Spring Boot backend API
βββ cairo/ # Cairo smart contracts
βββ local_resources/ # Documentation and resources
βββ docker-compose.yml # Container orchestration
cd next_frontend
npm run dev # Development server
npm run build # Production build
npm run lint # Code lintingcd java_backend
./gradlew bootRun # Run application
./gradlew build # Build project
./gradlew test # Run tests# Interact with deployed contract
sncast call --contract-address 0x06ebf0234be358bd087fdf5165d4b5cf7103fa1d00b8a4edb32b6e61b6d764f0 --function <function_name> --calldata <args>
# For contract development/testing (optional)
cd cairo
scarb build # Compile contracts
snforge test # Run tests- Upload sensitive documents with cryptographic verification
- Immutable proof of existence and timestamp
- Creator attribution and ownership tracking
- Track creation and modification history
- Verify file integrity across distributed systems
- Establish priority claims for intellectual property
- Timestamp research submissions
- Prevent plagiarism disputes
- Establish publication priority
- Immutable Records: Files cannot be modified after registration
- Cryptographic Hashes: SHA-256 file fingerprinting
- Zero-Knowledge Proofs: Privacy-preserving verification
- Decentralized Storage: No single point of failure
- Timestamp Integrity: Block-level time verification
import { Contract, Provider } from 'starknet';
const contractAddress = '0x06ebf0234be358bd087fdf5165d4b5cf7103fa1d00b8a4edb32b6e61b6d764f0';
const provider = new Provider({ sequencer: { network: 'sepolia-alpha' } });
// Verify file registration
const contract = new Contract(abi, contractAddress, provider);
const isRegistered = await contract.is_file_registered(fileHash);from starknet_py.net.full_node_client import FullNodeClient
from starknet_py.contract import Contract
client = FullNodeClient(node_url="https://starknet-sepolia.public.blastapi.io/rpc/v0_8")
contract = await Contract.from_address(contract_address, client)
result = await contract.functions["verify_file"].call(file_hash)- File Registration: ~0.0001-0.0005 ETH
- File Verification: Free (read-only)
- Account Setup: ~0.001 ETH (one-time)
- Fork the repository
- Create 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
- Multi-signature verification
- Advanced file metadata support
- Mainnet deployment (when ready)
This project is licensed under the MIT License - see the LICENSE file for details.
- Starknet Foundation for ZK infrastructure
- OpenZeppelin for security patterns
- Cairo community for development tools
π Live Demo: View Contract on Starkscan