The On-Chain Vesting Certificate Registry transforms the Vesting-Vault from a simple payment tool into a comprehensive "Career Infrastructure" layer for the Stellar developer ecosystem. This registry serves as a central "Source of Truth" for all completed vests, enabling Web3 Job Boards to verify a candidate's "Proof of Work" and "Loyalty."
- Automatic Certificate Registration: When a user completes their 4-year vesting journey, their data is automatically moved to the registry
- Proof of Work Verification: Authorized verifiers can attest to the quality and type of work performed
- Loyalty Scoring: Sophisticated algorithm calculates loyalty based on vesting behavior
- Rich Query Interface: Web3 Job Boards can query certificates by multiple criteria
pub struct CompletedVestCertificate {
pub vault_id: u64,
pub beneficiary: Address,
pub original_vault: Vault,
pub completion_timestamp: u64,
pub total_claimed: i128,
pub total_assets: i128,
pub asset_types: Vec<Address>,
pub loyalty_score: u32, // 0-1000 (1000 = perfect loyalty)
pub proof_of_work_verified: bool,
pub certificate_id: U256,
pub metadata_uri: Option<String>,
}pub struct LoyaltyMetrics {
pub total_vesting_duration: u64,
pub actual_completion_time: u64,
pub early_claims_count: u32,
pub missed_milestones: u32,
pub performance_cliffs_passed: u32,
pub stake_duration: u64,
}pub struct WorkVerification {
pub verified_by: Address,
pub verification_timestamp: u64,
pub work_type: String, // "development", "research", "community", etc.
pub impact_score: u32, // 0-100
pub verification_data: String, // IPFS hash or similar
}The loyalty score is calculated based on multiple factors:
- Timing Bonus: Perfect timing (completing exactly at end_time) gets maximum points
- Early Completion Penalty: Completing significantly early reduces score
- Early Claims Penalty: Claiming before full vesting reduces score
- Milestone Adherence: Missing milestones reduces score
- Staking Bonus: Longer staking duration increases score
Score ranges from 0-1000, where 1000 represents perfect loyalty.
pub struct CertificateQuery {
pub beneficiary: Option<Address>,
pub work_type: Option<String>,
pub min_loyalty_score: Option<u32>,
pub time_range_start: Option<u64>,
pub time_range_end: Option<u64>,
pub verified_only: Option<bool>,
}-
Get all verified certificates for a developer:
let query = CertificateQuery { beneficiary: Some(developer_address), verified_only: Some(true), work_type: None, min_loyalty_score: None, time_range_start: None, time_range_end: None, };
-
Find high-loyalty developers with specific expertise:
let query = CertificateQuery { beneficiary: None, work_type: Some("development".to_string()), min_loyalty_score: Some(900), verified_only: Some(true), time_range_start: None, time_range_end: None, };
The registry automatically registers certificates when:
- A vault's end_time has passed
- All tokens have been claimed
- The certificate hasn't been registered before
This happens in the check_and_register_certificate function called after each claim.
Authorized verifiers can attest to work quality:
- Job boards can verify developer contributions
- Project sponsors can verify work completion
- Community members can verify impact
The registry maintains efficient indexes for:
- Loyalty score ranges (grouped by 100s)
- Completion time (by year)
- Work types
- Beneficiary addresses
- Authorization: Only authorized verifiers can attest to work quality
- Immutable Records: Once issued, certificates cannot be modified
- Duplicate Prevention: Each vault can only generate one certificate
- Verification Integrity: Work verification data is stored immutably
- Efficient Indexing: Uses bucket-based indexing for common queries
- Lazy Registration: Certificates are only created when needed
- Pagination: Query results support pagination for large datasets
- Selective Verification: Only verified certificates show in job board queries
- Developer Reputation: Query certificates to build reputation profiles
- Skill Verification: Filter by verified work types and impact scores
- Loyalty Assessment: Use loyalty scores to assess commitment
- Experience Verification: Verify completion of long-term projects
- Community Impact: Assess contributions through verification data
- Cross-Chain Portability: Export certificates to other chains
- Dynamic Scoring: Machine learning-based loyalty scoring
- Social Features: Developer endorsements and recommendations
- Integration APIs: REST/GraphQL endpoints for external services
- Analytics Dashboard: Insights into developer ecosystem
The certificate registry is implemented as a module within the main vesting contract, sharing storage and authentication mechanisms. It leverages the existing vault infrastructure while adding new functionality for career infrastructure.
All certificate operations emit events for off-chain indexing and real-time updates by web services and job boards.