Contract Architecture
Core SAS (Starknet Attestation Service) Structure
The Starknet attestation contract implements the SAS (Starknet Attestation Service) interface with comprehensive attestation management:Data Structures
Attestation Structure
Comprehensive attestation data with zero-knowledge friendly design:Attestation Request
Structured request format for attestation creation:Revocation Request
Structured revocation request with value handling:Core Operations
Attestation Creation
Standard Attestation Create attestations with comprehensive validation and zero-knowledge support:UID Generation
Deterministic UID generation using Keccak hash:Attestation Revocation
Revocation with Access Control Revoke existing attestations with comprehensive validation:Storage Architecture
Contract Storage
Efficient storage mapping for attestation data:Schema Registry Integration
Integration with dedicated schema registry contract:Zero-Knowledge Features
Privacy-Preserving Attestations
Confidential Data Handling Support for private attestation data with selective disclosure:STARK-based Verification
Zero-Knowledge Proof Integration Leverage Cairo’s native STARK capabilities:Event System
Comprehensive Event Logging
Track all attestation lifecycle events:Timestamping Services
Data Timestamping
Immutable timestamping for arbitrary data:Error Handling
Comprehensive Error System
Detailed error handling with descriptive error codes:Integration Examples
JavaScript Integration
Using Starknet.js for contract interaction:Cairo Integration
Direct contract-to-contract calls:Network Information
Deployment Status
| Network | Contract Address | Status |
|---|---|---|
| Goerli Testnet | 0x123...abc | Active |
| Sepolia Testnet | 0x456...def | Active |
| Mainnet | TBD | In Development |
Network Configuration
Goerli Testnet:Development Workflow
Build and Deploy
Complete development setup for Cairo contracts:Testing Framework
Comprehensive test suite using Starknet Foundry:Performance Characteristics
Transaction Costs
Optimized for Starknet’s fee structure:- Attestation Creation: ~50,000 steps
- Attestation Revocation: ~30,000 steps
- Schema Validation: ~20,000 steps
- Timestamp Operation: ~15,000 steps
Scalability Features
- Batch Operations: Multiple attestations in single transaction
- Efficient Storage: Optimized storage key design
- Cairo Optimization: Native Cairo performance benefits
- STARK Proof Aggregation: Efficient zero-knowledge operations
Future Enhancements
Planned Features
Advanced Zero-Knowledge Support:- Fully anonymous attestations
- Selective disclosure protocols
- Credential aggregation proofs
- Privacy-preserving queries
- Starknet to Ethereum bridge attestations
- Layer 2 attestation synchronization
- Multi-chain attestation verification
- Visual schema builder
- Attestation analytics dashboard
- Advanced querying capabilities