π₯οΈ
Best Viewed on Desktop
The technical documentation and app previews are optimized for desktop viewing.
β Back to Homeπ
Smart Contracts
Eight Solidity contracts (V11). 4,336+ lines of auditable code. Deployed and verified on Sepolia testnet.
ContractDescriptionLinesRole
ZKSentinelV10.solCore pool V11 β deposits (standard/V11/stealth/batch), withdrawals (direct/relayer/partial), shielded transfers, migration, PoI compliance, selective disclosure, Merkle tree (20 levels), verifier timelock (48h)1,406Core
Groth16Verifier.solsnarkJS-generated Groth16 verifier for withdraw_dual_v9_relayer circuit. 5 public signals. BN254 pairing. vkey embedded.197Verifier
Halo2Verifier.solOn-chain Halo2 verifier for ZKML biometric inference. KZG commitments on BN254. Batch inversion + multi-opening scheme.1,563Verifier
AssociationVerifier.solsnarkJS-generated Groth16 verifier for association_set_membership circuit (PoI). 2 public signals: [commitment, associationSetRoot].176Verifier
PartialWithdrawVerifier.solGroth16 verifier for partial_withdraw_v1 circuit. 8 public signals including withdrawAmount, changeCommitment, denomination.~200Verifier
SelectiveDisclosureVerifier.solGroth16 verifier for selective_disclosure_v1 circuit. 7 public signals: poolRoot, associationSetRoot, auditNonce, min/max amount/timestamp.~200Verifier
ZentinelTreasury.solFee collection with RBAC (ADMIN, FEE_MANAGER, PAUSER, DEPOSITOR). 48h timelock governance. Fee range 0.1%-5%. Gnosis Safe destination. ETH + ERC20.537Finance
Hasher.solPoseidonβ hash wrapper for Merkle tree. On-chain interface matching circomlibjs generated contract.57Utility
Key Interfaces (from ZKSentinelV10.sol)
ZKSentinelV10.sol β real function signaturesSolidity
// βββββββββββββββ DEPOSITS βββββββββββββββ
// Standard deposit (V11 format: Diamond facets)
function deposit(bytes32 _commitment) external payable;
// V11 deposit with amount binding (leaf = Poseidonβ(commitment, amount))
// Required for partial withdrawals
function depositV11(bytes32 _commitment) external payable;
// Stealth deposit β hides intended recipient
function depositStealth(bytes32 _commitment, bytes32 _ephemeralPubKey) external payable;
// Batch deposit β multiple commitments in 1 TX (anti-fingerprint)
function batchDeposit(bytes32[] calldata _commitments, bytes32[] calldata _ephemeralPubKeys) external payable;
// βββββββββββββββ WITHDRAWALS βββββββββββββββ
// Standard withdrawal (Groth16 + optional Halo2 ZKML + optional PoI)
function withdraw(
uint256[2] calldata _pA, uint256[2][2] calldata _pB, uint256[2] calldata _pC,
bytes calldata _halo2Proof, uint256[] calldata _zkmlInstances,
bytes32 _root, bytes32 _nullifierHash,
address payable _recipient, bytes calldata _complianceData
) external;
// Gasless withdrawal via relayer (proof bound to relayer + fee)
function withdrawViaRelayer(
uint256[2] calldata _pA, uint256[2][2] calldata _pB, uint256[2] calldata _pC,
bytes calldata _halo2Proof, uint256[] calldata _zkmlInstances,
bytes32 _root, bytes32 _nullifierHash,
address payable _recipient, address payable _relayer,
uint256 _relayerFee, bytes calldata _complianceData
) external;
// βββββββββββββββ PARTIAL WITHDRAWAL (V11) βββββββββββββββ
// Withdraw portion, change commitment stays in pool
function partialWithdraw(
uint256[2] calldata _pA, uint256[2][2] calldata _pB, uint256[2] calldata _pC,
bytes32 _root, bytes32 _nullifierHash,
address payable _recipient, address payable _relayer,
uint256 _fee, uint256 _withdrawAmount,
bytes32 _changeCommitment, bytes calldata _complianceData
) external;
// βββββββββββββββ SELECTIVE DISCLOSURE βββββββββββββββ
// On-chain verification of compliance proof for auditors
function verifyComplianceProof(
uint256[2] calldata _pA, uint256[2][2] calldata _pB, uint256[2] calldata _pC,
bytes32 _poolRoot, bytes32 _associationSetRoot,
uint256 _auditNonce,
uint256 _minAmount, uint256 _maxAmount,
uint256 _minTimestamp, uint256 _maxTimestamp
) external returns (bool valid);
// βββββββββββββββ SHIELDED TRANSFER βββββββββββββββ
// Internal pool-to-pool transfer (nullify old commitment β insert new)
function shieldedTransfer(
uint256[2] calldata _pA, uint256[2][2] calldata _pB, uint256[2] calldata _pC,
bytes calldata _halo2Proof, uint256[] calldata _zkmlInstances,
bytes32 _root, bytes32 _nullifierHash, bytes32 _newCommitment
) external;Events
ZKSentinelV10.sol β events (real)Solidity
event Deposit(bytes32 indexed commitment, uint32 indexed leafIndex, uint256 timestamp, uint256 denomination); event Withdrawal(address indexed recipient, bytes32 nullifierHash, address indexed relayer, uint256 relayerFee, uint256 denomination); event StealthDeposit(bytes32 indexed commitment, uint32 indexed leafIndex, bytes32 ephemeralPubKey, uint256 timestamp, uint256 denomination); event StealthWithdrawal(address indexed recipient, bytes32 nullifierHash, bytes32 ephemeralPubKey, address indexed relayer, uint256 relayerFee, uint256 denomination); event ShieldedTransfer(bytes32 oldNullifierHash, bytes32 indexed newCommitment, uint32 indexed newLeafIndex, uint256 timestamp); event PartialWithdrawal(address indexed recipient, bytes32 indexed nullifierHash, uint256 withdrawAmount, uint256 changeAmount, bytes32 changeCommitment, uint32 changeLeafIndex); event ComplianceProofVerified(bytes32 indexed poolRoot, bytes32 indexed associationSetRoot, uint256 auditNonce, bool valid); event ComplianceVerified(bytes32 indexed nullifierHash, bytes32 associationRoot);
Source Code
βΉοΈ Contract Architecture
Fee flow: User deposits β ZKSentinelV10 β 97% stays in pool β 3% to ZentinelTreasury β forwarded to Gnosis Safe multi-sig. Relayer fees capped at 10% of denomination, deducted from user's withdrawal amount.
β
Verified on Sepolia
All contracts are verified and readable on Sepolia Etherscan. The Groth16, Association, PartialWithdraw, and SelectiveDisclosure verifiers are auto-generated by snarkJS with vkeys embedded at compile time. Contract addresses in the Deployments section.