Quick Start Guide
Get your first zero-knowledge proof up and running in under 5 minutes. This guide walks you through installation, authentication, and your first verification.
Prerequisites
- Node.js 18+ or Python 3.9+
- A GitDigital API key (get one at cash.app/$GitDigital)
- Basic familiarity with Web3 concepts
Choose your preferred language and install the GitDigital SDK.
TypeScript / JavaScript
npm install @gitdigital/sdk
# or
yarn add @gitdigital/sdk
# or
pnpm add @gitdigital/sdk
Python
pip install gitdigital-python
Rust
[dependencies]
gitdigital = "0.1"
Set up your API credentials and initialize the GitDigital client.
TypeScript
import { GitDigital } from '@gitdigital/sdk';
const client = new GitDigital({
apiKey: process.env.GITDIGITAL_API_KEY,
network: 'mainnet' // or 'testnet'
});
// Verify your connection
const status = await client.health();
console.log(status); // { status: 'ok', version: '2.1.0' }
Python
from gitdigital import GitDigital
client = GitDigital(
api_key=os.getenv("GITDIGITAL_API_KEY"),
network="mainnet"
)
status = client.health()
print(status) # {'status': 'ok', 'version': '2.1.0'}
Rust
use gitdigital::{GitDigital, Config};
let client = GitDigital::new(Config {
api_key: std::env::var("GITDIGITAL_API_KEY")?,
network: "mainnet".to_string(),
});
let status = client.health().await?;
Create a zero-knowledge proof for age verification. This example proves a user is over 18 without revealing their birthdate.
TypeScript
// Define the verification request
const request = {
user_address: "0x742d35Cc6634C0532925a3b844Bc9e7595f",
claim: "age_over_18",
circuit: "age_verification_v2",
options: {
zk_format: "groth16" // or 'plonk', 'stark'
}
};
// Generate the proof
const result = await client.identity.prove(request);
console.log(result);
// {
// proof: "0x8a7f9c3d...",
// public_signals: ["1", "1234567890"],
// verification_time_ms: 47,
// block_number: 19876543
// }
Performance: Proof generation typically completes in 40-80ms depending on circuit complexity and network conditions.
Submit the proof to a smart contract for on-chain verification. This allows your protocol to trustlessly verify the claim.
Solidity Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@gitdigital/contracts/ZKVerifier.sol";
contract AgeGated {
ZKVerifier public verifier;
constructor(address _verifier) {
verifier = ZKVerifier(_verifier);
}
function claimAgeOver18(
uint256[8] memory proof,
uint256[2] memory pubSignals
) public {
// Verify the ZK proof on-chain
bool valid = verifier.verify(proof, pubSignals);
require(valid, "Invalid proof");
// User is verified as over 18
verifiedUsers[msg.sender] = true;
}
}
Gas Costs: On-chain verification is gas-intensive (~300k gas for Groth16). Consider batching verifications or using off-chain verification for high-frequency use cases.
Next Steps
You've completed your first zero-knowledge verification. Here's where to go from here:
Explore the SDK
Dive deeper into the SDK with the SDK Reference documentation. Learn about all available circuits, batching, and advanced features.
Understand Pricing
GitDigital uses a metered pricing model based on API credits. Check the Metered Pricing guide to understand costs and optimize your usage.
Compliance Integration
For DeFi protocols requiring regulatory compliance, explore the Compliance Framework documentation for automated KYC/AML integration.