Skip to content

feat(core): W3C VC Data Integrity module#2797

Open
rmlearney-digicatapult wants to merge 22 commits into
openwallet-foundation:mainfrom
rmlearney-digicatapult:feature/data-integrity-module
Open

feat(core): W3C VC Data Integrity module#2797
rmlearney-digicatapult wants to merge 22 commits into
openwallet-foundation:mainfrom
rmlearney-digicatapult:feature/data-integrity-module

Conversation

@rmlearney-digicatapult
Copy link
Copy Markdown
Contributor

@rmlearney-digicatapult rmlearney-digicatapult commented May 18, 2026

Summary

This PR adds a new Data Integrity module to core, including proof types, validation, proof processing utilities, cryptosuite registration, proof creation/verification services, and agent/module wiring.

The module provides a standards-aligned foundation for Data Integrity proofs and makes Data Integrity available by default in agent module configuration.

Why
We need a first-class Data Integrity implementation in core so internal (e.g. VC, webvh) and external consumers can:

  • Create and verify Data Integrity proofs consistently
  • Reuse shared proof validation and processing logic
  • Register and resolve cryptosuites through a single registry
  • Access Data Integrity APIs without duplicating proof orchestration logic

What’s Included

  1. Proof model and validation foundation
  • Added Data Integrity proof/document types and proof option builders
  • Added validation/assertion helpers for:
    • Single-proof document flows
    • Proof-set document flows
    • Required proof member checks
  • Added structured Data Integrity error/result model for creation and verification outcomes
  1. Proof-processing utilities
  • Added utilities for:
    • Proof chain handling
    • Parsing/normalization
    • Key resolution helpers
    • Strict dateTimeStamp checks including leap year, time zone as required by spec
  • Centralises reusable spec-oriented processing steps used by services and cryptosuites
  1. Cryptosuite integration
  • Added cryptosuite interfaces and registry
  • Added EdDSA JCS 2022 cryptosuite as first implementation
  • Wired cryptosuite registration into module setup
  1. Service/API and module surface
  • Added proof service and API layer for:
    • Proof creation
    • Single-proof verification (permissive and fail-fast)
    • Proof-set/chain verification orchestration (permissive and fail-fast)
  • Added module public/internal barrels
  • Added module export on core index
  • Registered Data Integrity as a default agent module

This module was built to be conformant with the https://www.w3.org/TR/vc-data-integrity/ specification while preserving separation of responsibilities between different potential callers. For example, @context validation does not occur within the module as this is the responsibility of the VC service during the post-proof flow.

The cryptosuite is fully conformant with the https://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022 standard and the code is fully enumerated with each specification paragraph and line item implemented and a full test suite.

Opinionated elements
I have implemented Javascript normalisation to drop fields containing undefined - this is not within the spec but I do not believe that we should be signing over undefined fields

While power users could access the cryptosuite directly, most services will call via the W3cDataIntegrityProofService. For this reason some of the strict shape-checks live in the calling service, not the cryptosuite.

I have implemented 2 barrels for export - index.ts which will be hooked through @credo-ts/core and internal.ts which will be used by internal credo-ts consumers by direct import. These contain different exports for protecting internal functionality and avoiding complex ecosystem migrations in future.

I have installed json-canonicalize for strict JSON canonicalisation as required by eddsa-jcs-2022

NB
At the moment this module is not wired externally, only instantiated on the base agent. I have local branches where webvh is migrated to use this core data integrity module and W3CV2 uses this module for DiVp and DiVc support. I built these to help shape the implementation and API surface and will push these after merge.

@rmlearney-digicatapult rmlearney-digicatapult requested a review from a team as a code owner May 18, 2026 13:55
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

⚠️ No Changeset found

Latest commit: f9fd975

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rmlearney-digicatapult rmlearney-digicatapult force-pushed the feature/data-integrity-module branch from 78d9560 to 9645977 Compare May 18, 2026 13:55
@rmlearney-digicatapult rmlearney-digicatapult changed the title Feature(core): Data Integrity module feat(core): Data Integrity module May 18, 2026
@rmlearney-digicatapult rmlearney-digicatapult force-pushed the feature/data-integrity-module branch from c20f3e9 to 0378d00 Compare May 18, 2026 14:04
rmlearney-digicatapult and others added 16 commits May 26, 2026 13:29
…ng primitives

Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
…arrels

Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
…et-foundation#2784)

Signed-off-by: Fairuz Rahaman Chowdhury <frcshovon@gmail.com>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
…ion#2599)

Signed-off-by: andres vallecilla <andresfelipe083195@hotmail.com>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
…penwallet-foundation#2798)

Signed-off-by: andres vallecilla <andresfelipe083195@hotmail.com>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
…#2801)

Signed-off-by: andres vallecilla <andresfelipe083195@hotmail.com>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
…2 updates

Bumps the non-breaking-updates group with 1 update in the / directory: [cheqd/cheqd-node](https://github.com/cheqd/cheqd-node).
Bumps the non-breaking-updates group with 1 update in the /.devcontainer directory: devcontainers/javascript-node.

Updates `cheqd/cheqd-node` from 4.2.0 to 4.2.1
- [Release notes](https://github.com/cheqd/cheqd-node/releases)
- [Commits](cheqd/cheqd-node@v4.2.0...v4.2.1)

Updates `devcontainers/javascript-node` from 4-22-bookworm to 4-24-bookworm

---
updated-dependencies:
- dependency-name: cheqd/cheqd-node
  dependency-version: 4.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-breaking-updates
- dependency-name: devcontainers/javascript-node
  dependency-version: 4-24-bookworm
  dependency-type: direct:production
  dependency-group: non-breaking-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
@rmlearney-digicatapult rmlearney-digicatapult force-pushed the feature/data-integrity-module branch from 33bf320 to d9c27c5 Compare May 26, 2026 12:29
@rmlearney-digicatapult rmlearney-digicatapult changed the title feat(core): Data Integrity module feat(core): W3C VC Data Integrity module May 27, 2026
rmlearney-digicatapult and others added 5 commits May 28, 2026 12:40
…ation

Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
Signed-off-by: rmlearney-digicatapult <robert.learney@digicatapult.org.uk>
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.

3 participants