Contract Architecture
AttestProtocol on Stellar consists of two main Soroban smart contracts:Protocol Contract
The main attestation protocol contract handles core attestation operations:Authority Contract
Handles authority registration with payment verification and resolver functionality:Data Structures
Storage Key System
Deterministic storage keys for efficient data organization:Attestation
Complete attestation record with support for delegated operations:Schema
Schema structure with authority and resolver support:Authority
Authority registration and metadata:Delegated Operations
Support for gas-less transactions through delegated signing:BLS Public Key
BLS12-381 key for advanced cryptographic operations:Core Operations
Schema Registration
Register new attestation schemas with validation rules:- Caller authorizes the transaction
- Generate deterministic schema UID using SHA-256 hash of definition
- Store schema data using
DataKey::Schema(uid) - Emit schema registration event
- Return generated schema UID
Attestation Operations
Direct Attestation Create attestations where the attester is the subject:- Validate schema exists and caller authorization
- Generate unique attestation UID
- Call resolver contract if specified
- Store attestation with
DataKey::AttestationUID(uid) - Emit attestation created event
- Return attestation UID
- Users don’t need native tokens for gas
- Any party can submit on behalf of the attester
- BLS signature verification ensures authenticity
- Nonce prevents replay attacks
Delegated Operations
BLS Key Registration Register BLS public key for delegated signing:Storage Architecture
Persistent Storage
Soroban’s persistent storage for long-term data retention:Storage Benefits
- Persistent State: Data survives contract upgrades
- Efficient Queries: Direct key-based lookups
- Deterministic Keys: Predictable storage locations
- Gas Optimization: Minimal storage operations
Authority System
The Authority contract manages authority registration with payment verification:Payment-Gated Registration
Authority Registration
After payment confirmation, register as an authority:Authority Verification
Check if an address is a registered authority:Resolver Integration
Schemas can specify optional resolver contracts for custom validation logic:Resolver Methods
The Authority contract implements the resolver interface:- Payment verification before attestation
- Custom authorization logic
- Conditional attestation rules
- Integration with external systems
Error Handling
Comprehensive error types for all contract operations:Events
The contracts emit events for all major operations:- Schema Registration:
schema_registered - Attestation Created:
attestation_created - Attestation Revoked:
attestation_revoked - Authority Registered:
authority_registered - Payment Received:
payment_received - Fees Withdrawn:
levy_withdrawn
Network Information
Deployment Addresses
| Network | Contract Address | Status |
|---|---|---|
| Testnet | CB7QHNAXAEAQCAIBAEAQCAIBAEAQCAIBAEAQCAIBAEAQCAIBAE | Active |
| Mainnet | TBD | Planned |