Skip to content

Comments

Add DIDCommV2Service builder methods and update dependencies#187

Merged
dbluhm merged 10 commits intoIndicio-tech:mainfrom
hpretila:main
Feb 15, 2026
Merged

Add DIDCommV2Service builder methods and update dependencies#187
dbluhm merged 10 commits intoIndicio-tech:mainfrom
hpretila:main

Conversation

@hpretila
Copy link
Contributor

@hpretila hpretila commented Feb 15, 2026

This pull request introduces explicit support for DIDCommV2Service generation, which enables DIDComm v2 support for downstream libraries like didcomm-python. It also raises the minimum required Python version to 3.10.

This addition provides methods for when there's a need for a DIDComm V2 service object, as specified in issues decentralized-identity/peer-did-method-spec#64 and more specifically in sicpa-dlab/didcomm-python#104.

Summary of Changes

  • Dependency & Environment Updates:

    • Modified pyproject.toml to raise the minimum Python version from 3.7 to 3.10, as 3.9 is EOL and key testing libraries have dropped support.
    • Updated version constraints for pydantic to >=2.7.0 and adjusted other development dependencies like pytest.
  • Explicit DIDComm V1 and V2 Service Builders:

    • In builder.py, the generic add_didcomm method has been superseded by two new explicit methods: add_didcomm_v1 and add_didcomm_v2. It still does automatic matching, but I have added a deprecation notice and replaced any use of it in the testing with add_didcomm_v1.
    • add_didcomm_v1 creates a DIDCommV1Service, handling recipient_keys, routing_keys, and priority.
    • add_didcomm_v2 creates a DIDCommV2Service with a compliant DIDCommV2ServiceEndpoint.
    • This change provides a clear and unambiguous API for developers to build the exact service type they need.
    • Tests have been updated across the suite to align with the new builder logic.
  • Backwards Compatibility:

    • To avoid immediately breaking existing integrations, ServiceBuilder.add_didcomm is preserved as a compatibility wrapper.
    • It now emits a DeprecationWarning and delegates to either the V1 or V2 builder. Version detection is based on the accept header or an explicit version argument, defaulting to V1 to maintain old behavior.
  • Model Extensions:

    • In service.py, the type attribute for DIDCommV1Service and DIDCommV2Service now supports a List[str], as noted in Permit DIDCommService type to be a list? #83 allowing for service type arrays.
    • init.py has been updated to export the new service symbols (DIDCommV1Service, DIDCommV2Service, DIDCommV2ServiceEndpoint) for direct use.

Key Files Modified

  • pyproject.toml
  • builder.py
  • service.py
  • init.py
  • checks.yml
  • test_doc.py
  • get_uniresolver_examples.py

Breaking Changes

  • Python Version: The minimum required Python version is now 3.10. This is a breaking change for users on Python 3.7, 3.8, or 3.9, and will break the 3.9 test.
  • Deprecation: ServiceBuilder.add_didcomm is now deprecated and will be removed in a future release. Developers should migrate to using add_didcomm_v1 or add_didcomm_v2 explicitly.

Testing

All existing tests have been updated to pass with the new dependency set and builder logic. The changes were validated using pytest in a Python 3.10+ environment.

…e builder to help address sicpa-dlab/didcomm-python#104, and added list support at DIDCommVxService models per Indicio-tech#83.

Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
@hpretila
Copy link
Contributor Author

CC @dbluhm (apologies if wrong person!)

@hpretila hpretila changed the title Add DIDComm v2 Service Builder and update dependencies Add DIDCommV2Service builder methods and update dependencies Feb 15, 2026
Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
Copy link
Member

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! I have a few nitpicks but I don't feel too strongly about them. I'll give you some time to address them but if you don't get around to it, I'll probably merge as is. Thanks!

Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
…3.14.

Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
@dbluhm
Copy link
Member

dbluhm commented Feb 15, 2026

Once this is merged, I'll get a new release out. I'll probably reuse most of your PR description! Thanks for the contribution!

Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
Signed-off-by: H. Pretila <hpretila@users.noreply.github.com>
@hpretila
Copy link
Contributor Author

Thanks so much for taking the time to review my work! 🙇

Copy link
Member

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another pass on a bigger screen! LGTM!

@dbluhm dbluhm merged commit fa357d7 into Indicio-tech:main Feb 15, 2026
7 checks passed
@dbluhm
Copy link
Member

dbluhm commented Feb 15, 2026

https://github.com/Indicio-tech/pydid/releases/tag/v0.5.3
https://pypi.org/project/pydid/0.5.3/

The new release is up 😄

You may also be interested in another project I've worked on: https://github.com/Indicio-tech/didcomm-messaging-python

I wrote it after getting frustrated with SICPA's DIDComm library. It's been long enough that I honestly couldn't tell you what those original frustrations were 😄 These days, I'm not sure there's anyone maintaining the SICPA library but I'm open to contributions on didcomm-messaging-python.

@hpretila
Copy link
Contributor Author

Thanks so much for the pointer -- from what I've gleaned, I'd be keen to have a better read! You've probably gathered that I've been looking around for DIDComm messaging examples. I'm using them to run a few experiments and wrap my head around some of the moving parts. It would help to have something a bit more opinionated and tackles V1 as well.

I know that SICPA's library is specific to DIDComm V2 and doesn't really implement any secrets management or DID resolution/management, which is a bit tricky since -- besides the pain of setting up secrets management -- some of the experiments I'm running depend on agents relying on DIDComm V1 as well. I've got a PR lined up there as well but the org has been pretty inactive in terms of commits recently.

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.

2 participants