feat: DIDComm v2 support#2698
feat: DIDComm v2 support#2698tarunvaddeSoul wants to merge 33 commits intoopenwallet-foundation:mainfrom
Conversation
- DIDComm v2 envelope service with ECDH-1PU+A256KW and ECDH-ES - OOB 2.0 and DidCommOutOfBandInvitationV2 - DidCommV2Service in DID document resolution - Peer DID num algo 2 recipient key fingerprint support for v2 - acceptDidCommV2, sendDidCommV2, autoCreateConnectionOnFirstMessage config - Demo scripts alice:v2 and faber:v2 Signed-off-by: Tarun Vadde <tarun@soulverse.us>
- Use did:key for skid/kid so recipients can resolve via tryParseKidAsPublicJwk - Fix Ed25519/X25519 fingerprint matching in DID exchange and OOB receiver lookup - Support NewDidCommV2Service (DIDCommMessaging) in document resolution - Default acceptDidCommV2 and sendDidCommV2 to true - Guard Ed25519->X25519 conversion against invalid key bytes Signed-off-by: Tarun Vadde <tarun@soulverse.us>
…olution - Extend peer DID fallback to did:peer:4 long form (in addition to did:peer:2) - Apply fallback for both requester and responder when recipient keys are empty - Export didToNumAlgo4DidDocument from core for peer DID parsing - Use NewDidCommV2Service type for v2 service handling Signed-off-by: Tarun Vadde <tarun@soulverse.us>
- Add recipientKeys type assertion in DidCommMessageSender peer DID fallback - Extract toX25519 helper in DidCommDidExchangeResponseHandler for cleaner Ed25519/X25519 validation Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
…e*Handlers Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <tarun@soulverse.us>
Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
… and timing Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
…ts and time while building V2 plain text Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Protocol and message version restrictions: - Add supportedDidCommVersions to message types; restrict Message Pickup and Mediation to v1 connections - Enforce version compatibility in DidCommMessageSender Module and API configuration: - Replace acceptDidCommV2/sendDidCommV2 with didcommVersions array (default ["v1"]) - Add peerDidNumAlgoForV2OOB; default to did:peer:4, support did:peer:2 for legacy deployments - Add optional didcommVersion to DidCommConnectionRecord (default v1); outbound envelope version derived from connection V2 envelope and conversion: - Add v2 OOB invitations with optional ourDid for stable connection lookup - Support decorators (e.g. threading) in v1/v2 conversion (normalize, plaintextBuilder) Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
|
Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Signed-off-by: Tarun Vadde <142969534+tarunvaddeSoul@users.noreply.github.com>
Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Add support for BasicMessage 2.0 (https://didcomm.org/basicmessage/2.0/) over both DIDComm v1 and v2 envelopes, per spec. - Add DidCommBasicMessageV2 message class with toV2Plaintext() for v2 packing - Add BasicMessageV2Handler and DidCommBasicMessageService.createMessageV2/saveV2 - Extend DidCommBasicMessagesModuleConfig with protocols: ['1.0' | '2.0'] - When protocols includes 2.0, DidCommBasicMessagesApi uses BM 2.0 - BM 2.0 fields: content, created_time (Unix epoch), optional lang - BM 2.0 works over v1 envelope (v1-style plaintext) and v2 envelope (body, type, id) - Add DidCommBasicMessageV2StateChanged event for received BM 2.0 messages - plaintxtBuilder uses toV2Plaintext() for messages that implement it Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Implement Message Pickup protocol 3.0 per https://didcomm.org/messagepickup/3.0/ for DIDComm v2 connections (mediation 2.0, pickup v3). Protocol: - Add DidCommMessagePickupV3Protocol with PIURI https://didcomm.org/messagepickup/3.0 - Message types: status-request, status, delivery-request, delivery, messages-received, live-delivery-change (all with return_route: all) - Handlers: StatusRequestV3, StatusV3, DeliveryRequestV3, MessageDeliveryV3, MessagesReceivedV3, LiveDeliveryChangeV3 - Optional recipient_did in status-request/delivery-request; required limit in delivery-request; base64 attachments in delivery; message_id_list in messages-received API and module: - DidCommMessagePickupApi: pickupMessages, setLiveDeliveryMode, deliverMessages, deliverMessagesFromQueue with protocolVersion 'v3' and recipientDid for v3 - DidCommMessagePickupModule registers DidCommMessagePickupV3Protocol - Pickup v3 restricted to DIDComm v2 (assertDidCommV2Connection) Live mode: - processLiveDeliveryChange saves/removes live session by sessionId; responds with status including live_delivery and message_count - When live_delivery is true on non-persistent transport (no sessionId), send problem report with code e.m.live-mode-not-supported per spec Tests: - protocol/v3/__tests__/pickup-v3-protocol.test.ts for v3 protocol and live-delivery-change (including problem report when sessionId missing) - Existing pickup/MessagePickupApi/MessagePickupModule tests unchanged Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
Add full Coordinate Mediation 2.0 support in Credo-ts, including mediator/recipient coordination, key registration, and routing behavior aligned with DIF messaging expectations. - Introduce Coordinate Mediation 2.0 message types and models: mediate-request, mediate-grant, mediate-deny, keylist-update, keylist-update-response, keylist-query, and keylist - Implement mediator-side services and handlers for: processing Forward (routing 2.0/forward) and coordinating delivery strategies, handling keylist updates/queries, and emitting state/keylist events - Implement recipient-side services and handlers for: provisioning mediation v2, awaiting grants, and issuing keylist updates (v2) - Update routing/mediation integration paths used by DIDComm v2 sender/receiver flow (including v2 routing DID and Forward message handling) - Add/extend tests covering mediation v2 messaging + message pickup v3 interoperability - Update Drizzle storage adapters and mediation record typing to support mediation v2 fields Signed-off-by: Tarun Vadde <vaddeofficial@gmail.com>
|
@tarunvaddeSoul this PR has been closed in favour of #2704 which uses a local branch and allows to create PR-releases to test before merging. You can create new PRs targetting |
Changes
application/didcomm-encrypted+jsondidcommVersions: ['v1', 'v2']andconnection.didcommVersionfor version selectionbasicMessages.protocols: ['1.0', '2.0']for protocol selection;toV2Plaintext()for v2 packingKnown gaps
assertDidCommV1Connection)Demo