Skip to content

Add caip2 and caip10 features to ssi-caips - #707

Open
leoliu-spruce wants to merge 3 commits into
mainfrom
acc-1902-ssi-caips-caip2-feature-to-avoid-deps
Open

Add caip2 and caip10 features to ssi-caips#707
leoliu-spruce wants to merge 3 commits into
mainfrom
acc-1902-ssi-caips-caip2-feature-to-avoid-deps

Conversation

@leoliu-spruce

@leoliu-spruce leoliu-spruce commented Aug 21, 2026

Copy link
Copy Markdown

Description

Users that only need CAIP-2 blockchain ids had to pull in the whole crate, including ssi-jwk, linked-data and xsd-types. The caip2 module only ever needed thiserror.

Every dependency besides thiserror is now optional and gated behind the new caip10 feature, which implies caip2. The existing account verification features (eip, ripemd-160, aleo, tezos) imply caip10, and default now includes it, so the default build is unchanged.

This is a breaking change for dependents using default-features = false, which previously still got both modules.

Breaking change

ssi-caips is bumped to 0.4.0

Affected: crates depending on ssi-caips directly and with default-features = false. They previously got both modules regardless of features; they now get an empty crate unless they opt in.

Migration:

ssi-caips = { version = "0.4", default-features = false, features = ["caip10"] }

@leoliu-spruce
leoliu-spruce marked this pull request as ready for review August 21, 2026 18:24
@leoliu-spruce
leoliu-spruce requested a lite review from Copilot August 21, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the ssi-caips crate to split CAIP functionality behind new caip2 and caip10 features, allowing consumers that only need CAIP-2 chain IDs to avoid pulling in heavier optional dependencies. It also updates several workspace crates to explicitly enable caip10 so their builds remain unchanged under the workspace’s default-features = false policy.

Changes:

  • Added caip2/caip10 feature flags to ssi-caips, making non-thiserror dependencies optional and gated behind caip10 (which implies caip2).
  • Feature-gated the caip2 and caip10 modules in crates/caips/src/lib.rs.
  • Updated multiple workspace crates (and the root crate) to depend on ssi-caips with features = ["caip10"].

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/verification-methods/Cargo.toml Enables ssi-caips/caip10 explicitly to keep CAIP-10 types available under workspace default-features = false.
crates/ucan/Cargo.toml Enables ssi-caips/caip10 explicitly for UCAN parsing/verification types.
crates/dids/methods/pkh/Cargo.toml Enables ssi-caips/caip10 explicitly for DID PKH CAIP account/chain handling.
crates/dids/methods/ethr/Cargo.toml Enables ssi-caips/caip10 explicitly alongside eip.
crates/caips/src/lib.rs Gates caip2/caip10 modules behind the new features.
crates/caips/Cargo.toml Introduces caip2/caip10 features and makes heavy deps optional behind caip10.
Cargo.toml Updates the root crate dependency on ssi-caips to explicitly enable caip10.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/caips/Cargo.toml
leoliu-spruce and others added 3 commits August 24, 2026 09:41
…res = false)

Users that only need CAIP-2 blockchain ids had to pull in the whole
crate, including `ssi-jwk`, `linked-data` and `xsd-types`. The `caip2`
module only ever needed `thiserror`.

Every dependency besides `thiserror` is now optional and gated behind
the new `caip10` feature, which implies `caip2`. The existing account
verification features (`eip`, `ripemd-160`, `aleo`, `tezos`) imply
`caip10`, and `default` now includes it, so the default build is
unchanged.

Building with `--no-default-features --features caip2` compiles 7 crates
instead of the 177 pulled in by the default feature set.

Workspace crates using the `caip10` module now request the feature
explicitly, since the workspace dependency sets
`default-features = false`.

BREAKING: dependents using `default-features = false` previously still
got both modules, and must now add `features = ["caip10"]`. Dependents
on default features are unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`AleoSignature2021` names `ssi_caips::caip10::BlockchainAccountId`
directly, but the suites crate depends on `ssi-caips` with no features
and only received `caip10` because `ssi-verification-methods/aleo`
happened to forward `ssi-caips/aleo`.

Feature unification made that work, so it compiled, but the suite was
relying on a sibling crate to enable a feature it needs itself. Forward
`ssi-caips/aleo` from the suites `aleo` feature, matching what
`ssi-verification-methods` already does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Gating the `caip2` and `caip10` modules behind features removes public
API from `--no-default-features` builds, which is a major change under
Cargo's 0.x rules.

Bumping here rather than deferring to the next "Bump versions for
release" commit, so this cannot be published as 0.3.1 and silently break
dependents on their next `cargo update`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@leoliu-spruce
leoliu-spruce force-pushed the acc-1902-ssi-caips-caip2-feature-to-avoid-deps branch from 14b4dc1 to d2e6fe0 Compare August 24, 2026 14:43
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