Skip to main content
Stellar The AttestProtocol Stellar contract leverages Soroban smart contracts to provide efficient attestation services with deterministic storage keys and native Stellar integration.

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:
Process:
  1. Caller authorizes the transaction
  2. Generate deterministic schema UID using SHA-256 hash of definition
  3. Store schema data using DataKey::Schema(uid)
  4. Emit schema registration event
  5. Return generated schema UID

Attestation Operations

Direct Attestation Create attestations where the attester is the subject:
Flow:
  1. Validate schema exists and caller authorization
  2. Generate unique attestation UID
  3. Call resolver contract if specified
  4. Store attestation with DataKey::AttestationUID(uid)
  5. Emit attestation created event
  6. Return attestation UID
Delegated Attestation Gas-less attestations via signed requests:
Benefits:
  • 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
Retrieve Attestation Query attestations by UID:
Revoke Attestation Invalidate existing attestations:

Delegated Operations

BLS Key Registration Register BLS public key for delegated signing:
Get Attester Nonce Retrieve nonce for replay attack prevention:

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

Fee: 100 XLM registration fee for enhanced trust and spam prevention

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:
Use Cases:
  • 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
These events are indexed by the Horizon indexer for efficient querying and real-time monitoring.

Network Information

Deployment Addresses

Network Configuration

Testnet Setup:
Mainnet Setup:

Development

Build and Deploy

Testing

Comprehensive test suites are available in each contract directory for validation of all operations.

Next Steps

Solana
Compare with the Anchor-based Solana implementation

Contract Source

View the complete Soroban contract source