Building Powerful Applications

Garaga's cryptographic primitives enable a wide range of powerful applications on Starknet. This page showcases what you can build and links to production-ready implementations.


Validity Rollups & L2 Solutions

Verify SNARK proofs on Starknet to build trustless bridges and rollup solutions.

How It Works

  1. Off-chain: Execute computation and generate a ZK proof (Groth16 or Honk)

  2. On-chain: Verify the proof using Garaga's optimized verifier contracts

  3. Result: Trustless verification of arbitrary computation

Example: Cross-Chain Bridge

use garaga::groth16::{Groth16Proof, verify_groth16_proof};

#[starknet::contract]
mod Bridge {
    #[storage]
    struct Storage {
        processed_proofs: LegacyMap<felt252, bool>,
    }

    #[external(v0)]
    fn process_deposit(
        ref self: ContractState,
        proof_with_hints: Span<felt252>,
        deposit_hash: felt252,
    ) -> Result<(), felt252> {
        // Verify the proof that a deposit occurred on the source chain
        let public_inputs = verify_groth16_proof(proof_with_hints)?;

        // Check the deposit hash matches
        assert(*public_inputs.at(0) == deposit_hash, 'Invalid deposit');

        // Process the deposit...
        Result::Ok(())
    }
}

Real-world usage: Teams use Garaga to verify proofs from RISC Zero and SP1 zkVMs, enabling trustless verification of arbitrary Rust programs on Starknet.


Privacy-Preserving Applications

Build applications where users can prove statements without revealing underlying data.

Use Cases

Application
What's Proven
What's Hidden

Private Voting

Vote is valid and counted

Who voted for whom

Anonymous Credentials

User meets criteria

User's identity

Confidential Transfers

Balance is sufficient

Transfer amount

Private Auctions

Bid is valid

Bid amount

Implementation with Noir

Noir makes it easy to write privacy-preserving circuits:

Then verify on Starknet with a single function call.


Verifiable Randomness (drand)

Generate provably fair random numbers using the drand distributed randomness beacon.

Why drand?

  • Unpredictable: Random values can't be known before they're generated

  • Unbiasable: No single party can influence the output

  • Publicly verifiable: Anyone can verify the randomness is legitimate

Example: On-Chain Lottery

Use the maintained drand verifier contract via library call:


Signature Verification at Scale

Verify signatures from external systems (Bitcoin, Ethereum, Solana) on Starknet.

Supported Signature Schemes

Scheme
Curves
Use Case

ECDSA

SECP256K1, SECP256R1, BN254, BLS12-381

Bitcoin, Ethereum, WebAuthn

Schnorr

All Weierstrass curves

BIP340 (Taproot), general use

EdDSA

Ed25519

Solana, general use

Example: Multi-Chain Message Verification


zkVM Proof Verification

Verify proofs from zkVMs like RISC Zero and SP1 to enable trustless execution of arbitrary programs.

Architecture

Getting Started

See the maintained contracts:


Time-Lock Encryption (Coming Soon)

Time-lock encryption allows you to encrypt data that can only be decrypted at a specific future time, using drand's distributed randomness.

Use Cases

  • Sealed-bid auctions: Bids are encrypted until the auction ends

  • Scheduled reveals: Information released at a predetermined time

  • Fair launches: Token distributions with time-locked claiming


Build Your Own

The primitives above can be combined to create novel applications:

Combination
Application

Groth16 + Signatures

Cross-chain asset bridges

Noir + drand

Private lotteries with verifiable randomness

zkVM + MSM

Verifiable ML inference

EdDSA + Groth16

Solana → Starknet bridges

Need help? Join our Telegram community to discuss your use case.

Last updated

Was this helpful?