$ show openwallet-foundation/bifold-wallet
This repository is a production-grade, cross-platform mobile wallet for self-sovereign identity (SSI), built with React Native and the Credo-ts agent framework. It supports multiple verifiable credential formats (AnonCreds, W3C VC, SD-JWT, mdoc) and protocols (DIDComm v1, OpenID4VCI, OpenID4VP, ISO 18013-7). The wallet handles the full credential lifecycle: issuance, storage, presentation, refresh, and revocation. It also includes a verifier subsystem for generating and processing proof requests, and an Overlay Capture Architecture (OCA) layer for branded credential display. The architecture is a monorepo managed by Yarn 4, with packages for core UI (`@bifold/core`), credential display formatting (`@bifold/oca`), proof request handling (`@bifold/verifier`), React hooks for agent state (`@bifold/react-hooks`), remote logging (`@bifold/remote-logs`), and platform attestation (`react-native-attestation`, `expo-attestation`). Dependency injection via tsyringe is central, with a large token catalog (`TOKENS`) enabling component and service overrides. The sample app (`samples/app`) demonstrates full integration with Android and iOS native builds. Key entry points include `packages/core/src/App.tsx` (root component), `packages/core/src/container-impl.ts` (DI container setup), and the navigator stacks (`RootStack`, `TabStack`, `OnboardingStack`). Data flows are driven by Credo-ts agent events and OpenID4VC credential metadata, with a background refresh orchestrator that verifies credential status and triggers re-issuance. External dependencies include Credo-ts, Indy VDR, Askar, React Native, and various native modules for biometrics, keychain, and camera. The codebase demonstrates strong engineering practices: comprehensive unit and snapshot tests, localization (en, fr, pt-BR), theming, accessibility, and a modular package structure. However, there are maintenance risks from patched dependencies, legacy OCA code paths, and snapshot brittleness. Overall, it is a well-crafted, reusable foundation for any SSI wallet project.
The LLM identified 4 files worth highlighting for reuse:
Formats credential attributes using OCA overlay bundles. It resolves branding, labels, and metadata for display, supporting multiple overlay versions. This component is isolated within the OCA package and can be reused in any credential display system that uses OCA overlays.
Provides RxJS-based helpers (`recordsAddedByType`, `recordsUpdatedByType`, `recordsRemovedByType`) for subscribing to Credo-ts record events. It is a clean, generic abstraction over agent event streams, reusable in any React Native app using Credo-ts.
Implements a remote logger with console and Loki transports, supporting session IDs, log levels, and auto-disable. It is a standalone, configurable logging module that can be integrated into any application for centralized log aggregation.
Parses AnonCreds credential definition and schema IDs, resolves human-readable names from metadata, and provides a fallback naming waterfall. This utility is self-contained and can be extracted for any AnonCreds-based credential management system.