Skip to content

[WIP] Indy ledger#3034

Open
jamshale wants to merge 2 commits intoopenwallet-foundation:mainfrom
jamshale:indy_ledger
Open

[WIP] Indy ledger#3034
jamshale wants to merge 2 commits intoopenwallet-foundation:mainfrom
jamshale:indy_ledger

Conversation

@jamshale
Copy link
Copy Markdown
Contributor

This the WIP branch for the plugin that contains all the indy ledger, anoncreds, endorsement protocol from core acapy. It's targeting the indy removal branch. It attempts to patch all the handlers/routes where indy specific stuff was baked into the core. There is some places this hasn't been fully accomplished.

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
@jamshale
Copy link
Copy Markdown
Contributor Author

From claude helping to summarize the approach and current status...

What's being removed from core acapy (PR #4119)

The file tree shows 247 Python files touched, all deletions or stripping of Indy-specific code. The key modules being gutted or removed entirely are:

  • acapy_agent/indy/ — the whole indy package (holder, issuer, models, credx implementations, verifier, constants)
  • acapy_agent/anoncreds/default/legacy_indy/ — the legacy Indy AnonCreds registry, author, routes, and revocation recovery logic
  • acapy_agent/config/ledger.py — ledger configuration wiring
  • acapy_agent/config/default_context.py — where Indy components get injected into the DI container at startup
  • acapy_agent/did/indy/ — the did:indy manager and routes
  • acapy_agent/commands/provision.py and upgrade.py — Indy-specific provisioning and wallet upgrade paths
  • Various protocol handlers under connections/, holder/, anoncreds/revocation/, and the admin server

In short, it's stripping out the Indy ledger pool, the Indy credential/presentation format handlers, the did:indy DID method, endorsement flows, and schema/cred-def publishing — all things that were historically hardwired into core.


How the plugin (PR #3034) monkey-patches it back in

The plugin's file tree mirrors the deleted modules almost exactly — indy_ledger/indy_ledger/anoncreds/, credential_definitions/, anoncreds/routes/, etc. The approach ACA-Py plugins use is a setup function in __init__.py that gets called at agent startup. Based on what's visible in the tree and how other ACA-Py plugins work, the plugin:

  1. Re-registers Indy components into the DI container — things like the IndyLedger, IndyHolder, IndyIssuer, and IndyVerifier classes that core used to inject automatically, the plugin now injects conditionally at load time via context.inject_or / context.settings.

  2. Patches protocol handler modules — for places where Indy logic was baked directly into core message handlers (e.g. credential issuance managers, presentation managers), the plugin uses Python's module-level attribute replacement — essentially some_core_module.SomeClass = PluginReplacementClass — to swap in Indy-aware versions without modifying core.

  3. Re-registers routes — the plugin adds back the /ledger/, /schemas/, /credential-definitions/, /revocation/ and related endpoints that were stripped from core, via ACA-Py's standard register route hook.

  4. Carries the AnonCreds Indy registry — the anoncreds/registry.py in the plugin re-registers LegacyIndyRegistry as the AnonCreds method for resolving and writing schemas and cred defs to an Indy ledger.


The tricky part — and what's still unfinished

The monkey patching works cleanly for the ledger/schema/cred-def surface, but it gets hairy in the issuance and presentation protocol managers — the V1/V2 credential exchange and present-proof handlers. Those managers have Indy-specific branching logic deeply embedded (checking wallet type, falling back between Indy and AnonCreds format handlers, etc.), and the plugin hasn't fully patched all of those yet. That's the explicit "still WIP" gap jamshale calls out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant