You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All contract state is managed via the StorageKey enum defined in src/storage.rs. This section documents every variant and its corresponding storage layer.
DataKey Enum Variants
Attestor Management
Variant
Storage
Type
Description
Sep10Key(Address)
Persistent
Bytes
SEP-10 JWT verification key for an attestor; used for cryptographic signature validation
Attestor(Address)
Persistent
bool
Registration flag; true indicates the address is a registered attestor
AttestorRevoked(Address)
Persistent
bool
Revocation marker; present when attestor has been revoked; used to populate issuer_revoked in attestation responses
Endpoint(Address)
Persistent
String
HTTPS endpoint URL for an attestor's discovery or metadata service
Attestation Records
Variant
Storage
Type
Description
Attest(u64)
Persistent
Attestation
Complete attestation record indexed by attestation ID
SubjectCount(Address)
Persistent
u64
Per-subject attestation count; used for pagination and statistics
SubjectAttestation(Address, u64)
Persistent
u64
Per-subject attestation index entry; maps subject + index → attestation ID for efficient retrieval
Used(Bytes)
Persistent
bool
Replay-protection flag; marks a payload hash as consumed to prevent duplicate submissions
Session Management
Variant
Storage
Type
Description
Session(u64)
Persistent
Session
Complete session record indexed by session ID; tracks initiator and state
SessionOpCount(u64)
Persistent
u64
Operation count within a session; incremented on each session operation for audit logging
Audit Logging
Variant
Storage
Type
Description
AuditLog(u64)
Persistent
AuditLog
Audit log entry indexed by log ID; tracks all administrative and operational actions
AuditLogMaxSize
Instance
u64
Configuration: maximum number of audit log entries to retain before pruning oldest entries
Quotes & Pricing
Variant
Storage
Type
Description
Quote(Address, u64)
Persistent
Quote
Quote record indexed by (anchor address, quote ID); contains exchange rate and validity window
LatestQuote(Address)
Persistent
u64
Latest quote ID for an anchor; used to auto-increment quote IDs per anchor
Anchor Services & Metadata
Variant
Storage
Type
Description
Services(Address)
Persistent
AnchorServices
Supported services record for an anchor; lists available deposit/withdrawal endpoints
Health(Address)
Persistent
HealthStatus
Health status snapshot for an anchor; tracks latency, failure count, and availability
AnchorMeta(Address)
Persistent
Metadata object
Routing and operational metadata for an anchor; used for intelligent request routing
Caching (Temporary Storage)
Variant
Storage
Type
Description
MetadataCache(Address)
Temporary
AnchorMetadata
Cached anchor metadata with embedded TTL; expires after configured duration
CapabilitiesCache(Address)
Temporary
CapabilitiesCache
Cached SEP-24 capabilities from anchor's /info endpoint; avoids repeated discovery
TomlCache(Address)
Temporary
StellarToml
Cached stellar.toml entries for an anchor; stored in temporary storage for performance
Span(Bytes)
Temporary
TracingSpan
Tracing span keyed by request-ID bytes; used for distributed tracing and request correlation
Rate Limiting
Variant
Storage
Type
Description
RateLimitState(Address)
Persistent
Sliding-window state
Per-attestor rate-limit state; contains submission count and current window start timestamp
RateLimitOverride(Address)
Persistent
Configuration object
Per-attestor rate-limit configuration override; allows custom thresholds per attestor
Configuration & Instance State
Variant
Storage
Type
Description
MaxPageSize
Instance
u32
Configuration: maximum allowed page size for list operations (e.g., list_attestations)
Instance Storage Keys (Vec)
The following keys are stored in instance storage as Vec<Symbol> because Soroban's instance storage requires this key type:
Key
Type
Description
ADMIN
Address
Current contract administrator; single address with elevated privileges
COUNTER
u64
Global attestation counter; incremented on each new attestation submission
SCNT
u64
Session counter; incremented on each new session creation
QCNT
u64
Quote counter; incremented on each new quote submission
ACNT
u64
Audit log counter; incremented on each audit log entry
AOFF
u64
Audit log offset; tracks the starting index of retained audit entries (for pruning)
ANCHLIST
Vec<Address>
List of all anchor addresses currently being tracked
ATTESTLIST
Vec<Address>
List of all registered attestor addresses; enables enumeration via pagination
HTHRESH
u32
Health failure threshold; number of consecutive failures before anchor deactivation
RPWINDOW
u64
Replay-attack detection window in seconds; defines acceptable timestamp tolerance
Storage Layers
AnchorKit uses three Soroban storage layers:
Persistent: Long-term state (90-day TTL). Use for attestations, sessions, audit logs, and configuration.
Temporary: Short-term cache (24-hour TTL for spans, 30-day for other entries). Use for metadata caches and tracing spans.
Instance: Contract-instance state. Use for global configuration and administrative counters.
Accessing Storage
All storage access goes through the StorageKey enum. To read or write:
Get: env.storage().persistent().get::<_, Type>(&key) or .temporary() or .instance()