Protocol Lifecycle
Contract Deployment
Sets nonce, epoch duration (5 days), domain separator, and derives super admin pk.
Admin Setup
Admin_addIssuer→ registers DeFi protocol as approved issuer, returnsissuerPkUtils_initializeContractConfigurations→ sets token metadata, tier thresholds, score weights
User Registration
- User generates Veil ID off-chain from secret key
Scoring_createScoreEntry(veilId)→ creates empty score + accumulator in private state, commits both on-chain
Behavior Accumulation
Repeated over time as user interacts with DeFi protocols:
Scoring_submitRepaymentEvent→ updates accumulator:onTimeCount/lateCount/weightedRepaymentVolumeScoring_submitLiquidationEvent→ updates accumulator:liquidationCount/liquidationPenaltyPointsScoring_submitProtocolUsageEvent→ updates accumulator:distinctProtocols(counted once per unique protocol)Scoring_submitDebtStateEvent→ updates accumulator:activeDebtFlag/riskBand
PoT NFT Minting
NFT_mintPoTNFT() executes the following sequence:
- Triggers lazy epoch update (
computeCurrentEpoch) - Recomputes score from accumulators + config (
recomputeAndPersistScore) - Validates score commitment against on-chain Merkle tree
- Determines trust tier from repayment ratio
- Mints shielded token, stores NFT metadata in
nftRegistry
NFT Verification
NFT_verifyPoTNFT(issuerPk, veilId, challenge, expiresAt, ownershipSecret) called by issuer:
- Checks issuer is registered and approved
- Confirms NFT exists in
nftRegistry - Validates replay-protection challenge
- Verifies ownership commitment
- Auto-revokes if NFT has expired
- Returns
Boolean—true= valid and not expired
NFT Renewal
NFT_renewPoTNFT(token) executes the following sequence:
- Burns old PoT token
- Recomputes score and determines new tier
- Issues new PoT token with updated metadata and extended expiry
Last updated on