Obsqra.fi Documentation

v0.2.6

Obsqra.fi is a privacy-preserving DeFi treasury protocol that combines zero-knowledge proofs, verifiable AI, and DAO governance to enable trustless capital management. This documentation covers the technical architecture, smart contracts, and integration guides.

What is Obsqra.fi?

Traditional DeFi protocols face a fundamental tension: users want yield optimization, but on-chain transparency exposes their positions to front-running, copy-trading, and privacy violations. DAOs managing treasuries face an additional challenge: how do you delegate capital allocation to AI systems while maintaining verifiable governance?

Obsqra.fi solves these problems through three integrated innovations:

ZK Privacy

ZK Privacy Pools

Groth16 SNARKs • Poseidon Hash

Break deposit→withdrawal links with ZK proofs. Commitments stored on-chain, ownership proven cryptographically without revealing which deposit is yours.

Technical details →
Verifiable AI

Verifiable AI

Commit-Reveal Pattern

AI commits allocation decisions on-chain before execution. Every rebalance has an immutable audit trail. Can't change reasoning after the fact.

How it works →
DAO Constraints

DAO Constraints

On-Chain Policy Enforcement

Hard limits enforced by smart contracts. Safe recommendations auto-execute. Risky ones require governance vote. AI can't override DAO policy.

View constraints →

System Architecture

Obsqra.fi is a layered system where each layer has specific responsibilities. The frontend handles user interactions and ZK proof generation. Smart contracts manage state and verification. The AI service provides risk analysis and allocation recommendations.

Layer 1: Frontend Layer (Next.js)
Deposit UI
Commitment generation
Withdraw UI
Proof generation
Dashboard
Portfolio view
Layer 2: Smart Contract Layer (Solidity)
PoolController
Deposits and withdrawals
StrategyRouter
Multi-protocol routing
Groth16Verifier
ZK proof verification
Layer 3: AI Service Layer (Python)
Risk Model
Protocol scoring
Allocator
Optimization engine
Data Fetcher
DefiLlama/CoinGecko
Layer 4: DeFi Protocol Layer
Aave
Lending
Lido
Staking
Compound
Lending

How It Works

Deposit Flow

When you deposit, your funds enter a privacy pool where they become indistinguishable from other deposits. The system generates a cryptographic commitment that only you can redeem.

👤User

Generates secret + nullifier

🔢Poseidon Hash

Creates commitment

📜Contract

Stores commitment

💰Strategy

Funds deployed to DeFi

Withdrawal Flow

To withdraw, you generate a ZK proof that you know the secret for a valid commitment, without revealing which one. The contract verifies the proof and releases funds.

👤User

Provides secret + nullifier

snarkjs

Generates Groth16 proof

Verifier

Validates proof on-chain

💸Transfer

Funds sent to recipient

Privacy Model

Obsqra.fi provides transaction privacy, not total anonymity. The goal is to break the link between deposits and withdrawals while maintaining protocol transparency for auditing and compliance.

Data
Deposit amount
Visibility
Public
Reason
On-chain event for TVL tracking
Data
Depositor address
Visibility
Hidden
Reason
Only commitment hash stored
Data
Withdrawal recipient
Visibility
Public
Reason
Required for fund transfer
Data
Deposit-withdrawal link
Visibility
Hidden
Reason
ZK proof provides unlinkability
Data
Pool TVL
Visibility
Public
Reason
Aggregate balance visible
Data
AI recommendations
Visibility
Public
Reason
Committed on-chain for audit
Data
Individual positions
Visibility
Hidden
Reason
Cannot determine who owns what
ℹ️
Privacy vs Anonymity
Obsqra.fi provides privacy (hiding the link between deposit and withdrawal) but not anonymity (hiding that you used the protocol). Both deposit and withdrawal transactions are visible on-chain, but they cannot be connected to each other.

Current Status

NetworkAnvil (31337)
ZK ProofsGroth16 (~5s)
Strategies3 Mock
AI ServiceLive Data
⚠️
Testnet Only
Obsqra.fi is currently deployed on a local Anvil testnet for development and demonstration. The strategy adapters are mocks that simulate DeFi protocol behavior. Do not use with real funds.

Quick Links