How hyperledger-identus/sdk-swift works
Project type and purpose
• This is a multi‐module Swift SDK (library) for building Self-Sovereign Identity (SSI) apps on Apple platforms using Atala PRISM.
• It exposes separate “building block” modules (Apollo, Castor, Pollux, Mercury, Pluto) plus an orchestration layer called EdgeAgent.
• It includes core helpers (Core), end-to-end test harness (E2E), documentation (EdgeAgentSDK docs folder), and sample SwiftUI apps (Sample/…).
Top-level file structure and architectural slices
• Core – low-level helpers (JSON, Base64, async/await shims, logging).
• Building blocks (each a separate Swift Package target under EdgeAgentSDK):
– Apollo: cryptographic primitives
– Castor: DID creation & resolution
– Pollux: credential issuance & verification
– Mercury: secure messaging (DIDComm)
– Pluto: portable storage abstraction (CoreData, Keychain)
• EdgeAgent – orchestrates building blocks to present high-level DID/credential API.
• Domain – shared models and helper extensions used by building blocks & EdgeAgent.
• E2E – custom BDD-style test framework + test suites exercising the SDK against a cloud agent.
• Sample – three SwiftUI demo applications showing real-world integration: Challenger app, Wallet demo, Chat app.
• Docs – DocC‐based documentation under EdgeAgentSDK/Sources/EdgeAgentSDK.docc.
Insights from README
• Lists the building blocks and their purposes.
• Emphasizes use of Swift Package Manager, Xcode, target Apple OS versions.
– Core (helpers & logging)
– Domain (shared models)
– Apollo, Castor, Pollux, Mercury, Pluto (building-block modules)
– EdgeAgent (agent orchestration layer)
– E2E Test Framework (BDD runner + test suites)
– Sample Apps (AtalaPRISM Challenger, WalletDemo, DIDChat)
– External Services: Cardano network / cloud-agent (for DID/credential issuance), Mediator service (DIDComm V2)
– Core → Domain → Building Blocks → EdgeAgent → Sample Apps / E2E
– EdgeAgent → each Building Block (invokes crypto, DID, credential, messaging, storage)
– Building Blocks → Domain (use shared models)
– Sample Apps → EdgeAgent API (calls connect, issueCredential, presentProof, etc.)
– E2E → EdgeAgent (scripts exercise agent flows against cloud-agent)
– EdgeAgent & Mercury → Mediator service (for DIDComm)
– EdgeAgent / Castor → Cardano blockchain via cloud-agent
c. Architectural patterns & principles:
– Modular “building-blocks” pattern
– Layered architecture: Core → Domain → Building Blocks → Orchestration → Consumers
– Port & adapter: Pluto abstracts storage, Mercury abstracts transport, enabling pluggability
– Dependency inversion: high-level EdgeAgent depends on low-level building-blocks via protocols
d. Key technologies & frameworks:
– Swift Package Manager targets
– Swift concurrency (async/await, Futures)
– CoreData, Keychain (via Pluto)
– DIDComm V2
– DocC for SDK docs
– Custom BDD test framework (E2E)