Live Interactive Playground

Try Astree Circuits

Experiment with zero-knowledge proofs on Solana. Select an example, modify the code, and see results instantly.

Age Verification

Prove you are over 18 without revealing your exact age

circuit.ts
import { Circuit, Proof } from '@astree/sdk';

const ageCircuit = new Circuit('age-verification');

// Private input: actual age
const myAge = 25;

// Public input: minimum age requirement
const minAge = 18;

// Generate proof
const proof = await ageCircuit.prove({
  privateInputs: { age: myAge },
  publicInputs: { minAge }
});

// Verify proof on Solana
const isValid = await proof.verify();
console.log('Age verified:', isValid);

Output

✓ Proof generated successfully
✓ Age requirement verified: true
✓ Actual age remains private
✓ Proof size: 128 bytes
✓ Generation time: 0.3s
✓ Solana transaction: 4ZqX7fKMJ8hU9YVwKxN2pL5tR6sW3vB7kC1mD9nE8fG2

💡 Tip: This playground simulates zero-knowledge proof generation. In production, circuits compile to Solana programs with full cryptographic verification.

Ready to Build Your Own?

Install Astree SDK and start building privacy-preserving dApps on Solana.