A Soroban smart contract SDK for Stellar anchors. Handles attestation management, SEP-6 deposit/withdrawal flows, SEP-10 JWT authentication, anchor routing, rate limiting, and transaction state tracking — all in a no_std Rust library compiled to WASM.
- Registers and revokes attestors with SEP-10 JWT verification
- Submits and retrieves on-chain attestations with replay attack protection
- Normalizes SEP-6 deposit, withdrawal, and transaction status responses across anchors
- Verifies SEP-10 EdDSA JWTs on-chain using stored Ed25519 public keys
- Routes requests across multiple anchors by reputation, fees, and settlement time
- Caches anchor metadata and stellar.toml capabilities with TTL-based expiry
- Tracks transaction state transitions with full audit logging
- Propagates request IDs and tracing spans across operations
- Enforces rate limits and configurable retry/backoff strategies
- Validates anchor domain endpoints and response schemas
src/ # Core library
lib.rs # Public API surface
contract.rs # Soroban contract (attestations, sessions, quotes, routing)
sep6.rs # SEP-6 deposit/withdrawal normalization
sep10_jwt.rs # SEP-10 JWT verification (EdDSA, no_std)
domain_validator.rs # Anchor domain/endpoint validation
errors.rs # Stable error codes
rate_limiter.rs # Rate limiting
response_validator.rs # Response schema validation
retry.rs # Retry with exponential backoff
transaction_state_tracker.rs
deterministic_hash.rs # Canonical SHA-256 payload hashing
tests/ # Integration and unit tests
configs/ # Example anchor configurations (JSON + TOML)
examples/ # Rust and shell usage examples
scripts/ # Build, validation, and deploy scripts
docs/ # Feature and guide documentation
test_snapshots/ # Snapshot fixtures for deterministic tests
cargo build --releaseFor WASM output (Soroban deployment):
cargo build --release --target wasm32-unknown-unknown --no-default-features --features wasmcargo test# Deploy to testnet
anchorkit deploy --network testnet
# Register an attestor
anchorkit register --address GANCHOR123... --services deposits,withdrawals,kyc
# Submit an attestation
anchorkit attest --subject GUSER123... --payload-hash abc123...
# Check environment setup
anchorkit doctor// SEP-6: normalize a raw anchor deposit response
let response = initiate_deposit(raw)?;
// SEP-10: verify an anchor JWT on-chain
contract.verify_sep10_token(token, issuer);
// Submit an attestation (replay-protected)
let id = contract.submit_attestation(issuer, subject, timestamp, payload_hash, sig);
// Route across anchors by lowest fee
let best = contract.route(options);
// Track transaction state
tracker.transition(tx_id, TransactionStatus::Completed);Anchor configs live in configs/ as JSON or TOML. Validate them with:
./scripts/validate_all.shSchema reference: config_schema.json
MIT