$ show openwallet-foundation/acapy
ACA-Py is a production-ready, open-source Self-Sovereign Identity (SSI) agent that implements the Hyperledger Aries ecosystem. It acts as a server-side agent for issuers, holders, and verifiers of decentralized digital credentials. The system supports multiple verifiable credential formats including AnonCreds (CL signatures), W3C Verifiable Credentials with Linked Data Proofs (Ed25519, BBS+, ECDSA secp256r1), and SD-JWT. It implements DIDComm v1 and v2 messaging protocols for secure peer-to-peer communication, along with a comprehensive set of Aries protocols for credential issuance, presentation, DID exchange, mediation, routing, and revocation. The architecture is built as a modular Python application using aiohttp for HTTP/WebSocket transport. It follows a controller pattern where external business logic interacts via a REST API and receives asynchronous webhook notifications. Core components include a dependency injection system (InjectionContext), an event bus for internal pub/sub, a plugin registry for extensibility, protocol-specific handlers for each DIDComm message type, a wallet abstraction layer supporting multiple backends (Askar, Kanon, Indy), a database manager with SQLite and PostgreSQL backends, and a DID resolver framework supporting multiple DID methods (did:key, did:indy, did:web, did:peer, did:webvh). The agent is configured via YAML files, environment variables, or CLI arguments. Key entry points include the 'aca-py' CLI command (start, provision, upgrade) and the admin REST API. The server listens for DIDComm messages over HTTP and WebSocket, processes them through protocol handlers, and persists state in the configured database. External systems interact via the admin API for credential management, DID operations, and configuration. The agent supports multi-tenant deployments with wallet isolation, mediation/routing for scalability, and integration with Indy ledgers for schema and credential definition registration. External dependencies include native cryptographic libraries: aries-askar for secure storage, anoncreds for anonymous credentials, indy-credx for Indy credential exchange, indy-vdr for Indy ledger interaction, and ursa-bbs-signatures for BBS+ signatures. It also depends on didcomm-messaging for DIDComm v2 support, pyld for JSON-LD processing, and psycopg for PostgreSQL connectivity. The project is maintained by the OpenWallet Foundation and follows an LTS release model with active community contributions.
The LLM identified 5 files worth highlighting for reuse:
Implements a lightweight dependency injection container with scoped providers (ClassProvider, InstanceProvider, CachedProvider, StatsProvider). Supports binding interfaces to implementations, lazy initialization, and caching. Could be extracted as a standalone DI library for any Python application.
Provides an asynchronous event bus for internal pub/sub communication. Supports event filtering, multiple handlers per event, and async/await patterns. Reusable as a generic event system for decoupled component communication.
An in-memory cache implementation with TTL support and key-level locking for concurrent access. Uses a dictionary with expiration checks and a threading lock per key. Could be extracted as a simple caching utility for any Python project.
Provides RepeatSequence and RepeatAttempt classes for executing operations with configurable retry logic, including exponential backoff, max attempts, and delay between retries. Reusable as a generic retry utility for any async or sync operation.
Defines the BaseDIDResolver abstract class with regex-based DID method matching, caching of resolved DID documents, and a chain-of-responsibility pattern for resolver selection. Could be extracted as a base for implementing custom DID resolvers in any identity framework.