@veritier/sdk
v0.1.1
Published
Privacy-preserving tiered identity SDK for HashKey Chain.
Readme
@veritier/sdk
Privacy-preserving tiered identity SDK for HashKey Chain.
Overview
Veritier enables both humans and AI agents to prove their compliance credentials on-chain without revealing any personal data — using zero-knowledge proofs and a tiered permission system mapped to real-world regulatory frameworks.
Install
npm install @veritier/sdkQuick Start
import { Veritier, Tier } from "@veritier/sdk";
const veritier = new Veritier({
chainId: 133,
rpcUrl: "https://testnet.hsk.xyz",
contracts: {
identityRegistry: "0x239E5f55e3397816F3EdD62dcf92B8dda1A98E49",
agentRegistry: "0x080c48E4cC03E490df6d78613D12d1e95F8fb54c",
complianceAggregator: "0x022CCD94f6f95CC00b09AA2CB9319931899302D6",
},
circuitArtifacts: {
ageProof: { wasm: "/circuits/age_proof.wasm", zkey: "/circuits/age_proof_final.zkey" },
jurisdictionProof: { wasm: "/circuits/jurisdiction_proof.wasm", zkey: "/circuits/jurisdiction_proof_final.zkey" },
tierProof: { wasm: "/circuits/tier_proof.wasm", zkey: "/circuits/tier_proof_final.zkey" },
},
});
// Check a user's tier
const tier = await veritier.getTier("0x1234...");
console.log(tier); // 0 = Public, 1 = Basic, 2 = Verified, 3 = Institutional
// Check if address meets a tier requirement
const allowed = await veritier.checkTier("0x1234...", Tier.VERIFIED);Features
Identity Management
getTier(address)— Get current tier (0-3)checkTier(address, requiredTier)— Check if address meets tierisVerified(address)— Check if address has any tier > 0verifyAndRegister(proof, signals, tier, signer)— Submit ZK proof on-chain
ZK Proof Generation (browser-compatible)
generateAgeProof(params)— Prove age ≥ thresholdgenerateJurisdictionProof(params)— Prove non-sanctioned jurisdictiongenerateTierProof(params)— Prove tier membershipproofToSolidityCalldata(proof)— Convert to on-chain format
AI Agent Management (ERC-8004)
registerAgent(uri, signer)— Register agent with ERC-721 identitygetAgentTier(agentId)— Get agent's current tiersubmitFeedback(agentId, score, tag, signer)— Rate an agent (-100 to +100)upgradeAgentTier(agentId, newTier, signer)— Upgrade via reputation
HSP Settlement Gate
checkSettlement(from, to, amount)— Verify tier compliance for settlements- Amount thresholds: ≤$1K → Tier 1, ≤$50K → Tier 2, unlimited → Tier 3
Compliance Analytics
getTierDistribution()— Aggregate tier countsgetJurisdictionDistribution()— Regional distribution (privacy-preserving buckets)
Tier System
| Tier | Name | Access | |------|------|--------| | 0 | Public | Read-only | | 1 | Basic | Swaps, transfers < $1K | | 2 | Verified | Lending, LP, agent deployment | | 3 | Institutional | RWA, securities, unlimited |
Protocol Integration
Any DeFi protocol on HashKey Chain can integrate Veritier with 3 lines:
import {TieredAccessGate} from "@veritier/contracts/TieredAccessGate.sol";
contract MyDeFi is TieredAccessGate {
function swap(uint amount) external onlyTier(1) { }
function lend(uint amount) external onlyTier(2) { }
function tokenizeRWA(bytes data) external onlyTier(3) { }
}Deployed Contracts (HashKey Testnet)
| Contract | Address |
|----------|---------|
| IdentityRegistry | 0x239E5f55e3397816F3EdD62dcf92B8dda1A98E49 |
| AgentRegistry | 0x080c48E4cC03E490df6d78613D12d1e95F8fb54c |
| ComplianceAggregator | 0x022CCD94f6f95CC00b09AA2CB9319931899302D6 |
Links
License
MIT — Cayvox Labs © 2026
