Repository navigation
feat: support the secp256r1 ECDSA curve; release ic-cdk-management-canister v0.3.0 - #716
Merged
Merged
Conversation
Bump `ic-management-canister-types` from 0.10 to 0.11, which adds the `Secp256r1` variant to `EcdsaCurve`. It selects threshold ECDSA on the NIST P-256 curve. `ic-cdk-management-canister` re-exports `EcdsaCurve`, so `ecdsa_public_key`, `sign_with_ecdsa` and `cost_sign_with_ecdsa` accept the new curve unchanged. The e2e `ecdsa` test now covers both curves. That needs a PocketIC server with secp256r1 keys (dfinity/ic#11741), so the `pocket-ic` pin moves to release-2026-10-08_03-33-base, the first release tag that contains it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clippy 1.99 reports `redundant_field_names` on the code that darling's `FromMeta` derive generates for the `#[darling(multiple)]` field `guard` of `ExportAttributes` (rust-lang/rust-clippy#17525). Every package fails `cargo clippy -- -D warnings`, because each one builds `ic-cdk-macros`. darling has merged a fix that allows the lint in its generated impls (TedDriggs/darling#441), but has not released it, and its latest releases move to syn v3. Allow the lint in the `export` module until then. An `#[allow]` on the struct would not reach the derived impl. Co-Authored-By: Claude Opus 5.5 <[email protected]>
eichhorl
marked this pull request as ready for review
October 8, 2026 12:29
|
✅ No security or compliance issues detected. Reviewed everything up to b2ab060. Security Overview
Detected Code Changes
|
Breaking: `ic-management-canister-types` 0.10 -> 0.11, which adds the `Secp256r1` variant to `EcdsaCurve`. Only this crate depends on `ic-management-canister-types`, and its `ic-cdk` 0.20.3 dependency is already published, so it is released alone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
lwshang
approved these changes
Oct 8, 2026
lwshang
enabled auto-merge (squash)
October 8, 2026 12:45
lwshang
pushed a commit
to dfinity/developer-docs
that referenced
this pull request
Nov 16, 2026
## Summary - The scheme table on the chain-key cryptography page gets a `secp256r1` (NIST P-256) row. Its use cases are ones that need P-256 specifically: - X.509 certificates. WebPKI accepts ECDSA only on the NIST curves (the CA/Browser Forum Baseline Requirements permit P-256, P-384 and P-521). - JSON Web Tokens signed with ES256 ([RFC 7518, section 3.4](https://www.rfc-editor.org/rfc/rfc7518#section-3.4)). `sign_with_ecdsa` returns r and s as 32-byte big-endian values, which is the JWS signature encoding as is. - VAPID web push, which requires ES256 ([RFC 8292, section 2](https://www.rfc-editor.org/rfc/rfc8292#section-2)). - The key derivation paragraph names SLIP-10 for P-256, matching the `ecdsa_public_key` section of the spec from #394. - The deployed keys table and the cycle costs table list `(secp256r1, test_key_1)` and `(secp256r1, key_1)` next to the `secp256k1` keys. The fees are the same, because `ic0.cost_sign_with_ecdsa` prices a signature by the subnet that holds the key, not by the curve ([`system_api.rs`](https://github.com/dfinity/ic/blob/1b4cc653e3fe941b55cb2c136a92121d01483fd5/rs/embedders/src/wasmtime_embedder/system_api.rs#L4398-L4429)). - `.sources/upstream.json` pins `ic-cdk-management-canister` at 0.3.0. That release moves to `ic-management-canister-types` 0.11, which adds `EcdsaCurve::Secp256r1` (dfinity/cdk-rs#716) and a `million_round_instructions_total` field to `SubnetMetricsResult`. None of the HTTPS outcall pages and examples the pin covers use either, so no page changes. Closes #425 ## Mainnet state Both keys are enabled for signing on the subnets the pages name: - `(secp256r1, test_key_1)`: generated on `2fq7c` ([144212](https://dashboard.internetcomputer.org/proposal/144212)), reshared to `fuqsr` ([144325](https://dashboard.internetcomputer.org/proposal/144325)) and enabled for signing there ([144327](https://dashboard.internetcomputer.org/proposal/144327)). - `(secp256r1, key_1)`: generated on `pzp6e` ([144331](https://dashboard.internetcomputer.org/proposal/144331)), backed up to `uzr34` ([144488](https://dashboard.internetcomputer.org/proposal/144488)) and enabled for signing on `pzp6e` ([144490](https://dashboard.internetcomputer.org/proposal/144490)). Rust canisters get `EcdsaCurve::Secp256r1` from `ic-cdk-management-canister` 0.3.0, and PocketIC 16.1.0 holds the same keys for tests. The offline key derivation guide stays as it is: `@dfinity/ic-pub-key` v1.0.2 supports only `secp256k1` and `ed25519`. ## Tests `node scripts/validate.js` passes on both pages. `npm run build` was not run locally (Node 18 here; Astro needs 22.12), so the CI build is the check.
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
Support threshold ECDSA on the NIST P-256 curve.
ic-management-canister-types0.11 adds theSecp256r1variant toEcdsaCurve.ic-cdk-management-canisterre-exportsEcdsaCurve, so bumping the dependency is the whole change.ecdsa_public_key,sign_with_ecdsaandcost_sign_with_ecdsaaccept the new curve unchanged. The curve'su32encoding foric0.cost_sign_with_ecdsa(1) comes from the types crate.Changed
ic-management-canister-typesbumped from0.10to0.11. The newEcdsaCurvevariant breaks code that matches on it exhaustively. The other change in0.11, a new field ofSubnetMetricsResult, does not reach users of this crate, which does not re-export that type.No mainnet key uses the new curve yet. NNS proposal 144212 generates
(secp256r1, test_key_1)on subnet2fq7c, but does not enable signing.Related: the interface spec change is dfinity/developer-docs#394, the implementation is dfinity/ic#11573, and PocketIC gained the keys in dfinity/ic#11741.
Release
This PR also cuts
ic-cdk-management-canisterv0.3.0 (from 0.2.0; the major bump reflects the breaking change above). It is the only crate that depends onic-management-canister-types, and itsic-cdk0.20.3 dependency is already on crates.io, so it is released alone.cargo publish -p ic-cdk-management-canister --dry-runpasses.Clippy on Rust 1.99
This PR also allows
clippy::redundant_field_namesinic-cdk-macros/src/export.rs. Clippy 1.99, the stable toolchain CI now installs, flags the code that darling'sFromMetaderive generates forExportAttributes(rust-lang/rust-clippy#17525). That failscargo clippy -- -D warningsfor every package, onmainas well. darling has merged the same allow into its generated impls (TedDriggs/darling#441) but not released it, and its newer releases need syn 3. The comment next to the allow says to remove it once darling ships the fix.How Has This Been Tested?
ecdsae2e test now callsecdsa_public_keyandsign_with_ecdsaon both curves withtest_key_1. PocketIC holdssecp256r1keys since feat(PocketIC): support threshold ECDSA keys over secp256r1 ic#11741. Thepocket-icpin therefore moves fromrelease-2026-09-03_04-41-basetorelease-2026-10-08_03-33-base, the first release tag that contains it.secp256r1ecdsa_public_keycall (Unknown variant field). So the new iteration does exercise the new curve.cargo test --all-targets --no-fail-fast,cargo test --doc,cargo fmt --all -- --checkandRUSTDOCFLAGS="-D warnings" cargo doc, plus both clippy commands from CI (cargo hack clippy --feature-powerset --no-dev-depsandcargo clippy --tests --benches, with-D warnings) on Rust 1.99.0. Without the allow, both clippy commands fail onmaintoo.Checklist:
🤖 Generated with Claude Code