Add caip2 and caip10 features to ssi-caips - #707
Open
leoliu-spruce wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
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/caip10feature flags tossi-caips, making non-thiserrordependencies optional and gated behindcaip10(which impliescaip2). - Feature-gated the
caip2andcaip10modules incrates/caips/src/lib.rs. - Updated multiple workspace crates (and the root crate) to depend on
ssi-caipswithfeatures = ["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.
…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
force-pushed
the
acc-1902-ssi-caips-caip2-feature-to-avoid-deps
branch
from
August 24, 2026 14:43
14b4dc1 to
d2e6fe0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Users that only need CAIP-2 blockchain ids had to pull in the whole crate, including
ssi-jwk,linked-dataandxsd-types. Thecaip2module only ever neededthiserror.Every dependency besides
thiserroris now optional and gated behind the newcaip10feature, which impliescaip2. The existing account verification features (eip,ripemd-160,aleo,tezos) implycaip10, anddefaultnow 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-caipsis bumped to 0.4.0Affected: crates depending on
ssi-caipsdirectly and withdefault-features = false. They previously got both modules regardless of features; they now get an empty crate unless they opt in.Migration: