Smart Contracts

On-chain programs that power Zcrypt's decentralized features

Contract Overview

Zcrypt uses Solana Programs (smart contracts) written in Rust to handle on-chain operations, including ZK proof verification, message anchoring, and token operations.

ZK Verifier

Verifies Zcrypt proofs on-chain

Identity Registry

Manages user identities and public keys

Message Anchor

Stores message hashes for verification

ZK Verifier Program

The core smart contract that verifies Zcrypt proofs on-chain:

#[program]
pub mod zk_verifier {
    pub fn verify_proof(
        ctx: Context<VerifyProof>,
        proof: Vec<u8>,
        public_inputs: Vec<u8>,
    ) -> Result<()> {
        // Verify Zcrypt proof
        let is_valid = verify_stark_proof(&proof, &public_inputs)?;
        
        require!(is_valid, ErrorCode::InvalidProof);
        
        // Update account state
        ctx.accounts.verification.is_verified = true;
        ctx.accounts.verification.timestamp = Clock::get()?.unix_timestamp;
        
        Ok(())
    }
}

Program Addresses

Mainnet

Coming soon...

Devnet

Zcrypt1234...devnet