Skip to content

Management canister API for threshold key derivation (vetKD)#3763

Merged
mraszyk merged 12 commits intomasterfrom
fspreiss/vetkd-system-api
Jun 2, 2025
Merged

Management canister API for threshold key derivation (vetKD)#3763
mraszyk merged 12 commits intomasterfrom
fspreiss/vetkd-system-api

Conversation

@mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Nov 15, 2024

Proposes two new system APIs for the prospective threshold key derivation (vetKD) feature in the management canister.

Notes

  • The API is designed so that it allows for implementing the scheme referred to as An aggregatable vetBLS scheme (2) in the related talk at the Real World Crypto Symposium (RWC) 2023.
  • The APIs are designed to be similar to the ones for threshold ECDSA.
  • Information regarding usage of vetKD keys is not included in the interface spec on purpose. The idea is that the relevant information will later be provided in the Internet Computer Developer Docs.

Alternatives considered

We considered the following alternative API, where one would have two sets of API pairs: one pair for threshold key derivation, and a second one for threshold BLS signatures.

  // Threshold key derivation
  vetkd_public_key : (record {
    canister_id : opt canister_id;
    key_id : record { curve : vetkd_curve; name : text };
  }) -> (record { public_key : blob; });
  vetkd_encrypted_key : (record {
    derivation_id : blob;
    key_id : record { curve : vetkd_curve; name : text };
    encryption_public_key : blob;
  }) -> (record { encrypted_key : blob; });
  // Threshold BLS signature
  bls_public_key : (record {
    canister_id : opt canister_id;
    derivation_path : vec blob;
    key_id : record { curve : vetkd_curve; name : text };
  }) -> (record { public_key : blob; });
  sign_with_bls : (record {
    message : blob;
    derivation_path : vec blob;
    key_id : record { curve : vetkd_curve; name : text };
  }) -> (record { signature : blob; });

This alternative was discarded, however, because there is a concern that not all possible future use cases can be covered with this split API approach.

TODOs

  • Determine if we should specify further constraints on input data (e.g., max size of derivation_id, etc.)

@mraszyk mraszyk added the interface-spec Changes to the IC Interface Specification label Nov 18, 2024
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Nov 19, 2024
…ints (#2633)

This PR defines names and arguments of the new functions:

- ReshareChainKey
- VetKdPublicKey
- VetKdEncryptedKey

A corresponding interface spec PR can be found
[here](dfinity/portal#3763). For now, all
functions remain unimplemented.

In addition, we implement routing of these methods by calling
`route_idkg_message` with the correct `MasterPublicKeyId`. This function
will be renamed and tested for the vet KD case in a follow up PR.
DFINITYManu pushed a commit to dfinity/ic that referenced this pull request Nov 19, 2024
…ints (#2633)

This PR defines names and arguments of the new functions:

- ReshareChainKey
- VetKdPublicKey
- VetKdEncryptedKey

A corresponding interface spec PR can be found
[here](dfinity/portal#3763). For now, all
functions remain unimplemented.

In addition, we implement routing of these methods by calling
`route_idkg_message` with the correct `MasterPublicKeyId`. This function
will be renamed and tested for the vet KD case in a follow up PR.
@fspreiss fspreiss changed the title System API for threshold key derivation (vetKD) Management canister API for threshold key derivation (vetKD) Jan 27, 2025
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Mar 13, 2025
Performs the following renamings in the vetKD API in accordance with the
[latest
changes](dfinity/portal@add1c71)
in the [spec PR](dfinity/portal#3763):
* `derivation_id` --> `input`
* The name `derivation_id` often caused confusion and `input` is a more
standard name in the context of key derivation schemes.
* `derivation_domain`
([previously](#4049)
`derivation_path`) --> `context`
* The main use case for the derivation domain/path is to do domain
separation, i.e., to specify the context in which the derived keys are
to be used. Given this, directly calling it context seems beneficial in
that it makes the meaning of the field more clear and intuitive, and
thus the API easier to use.
* `vetkd_derive_encrypted_key` --> `vetkd_derive_key`
* Although the fact that the returned key is encrypted is relevant in
that it ensures that nodes cannot see the key in clear text, this can be
considered an implementation detail. Also, the name
`vetkd_derive_encrypted_key` is somewhat long. In any case, in the
returned struct the (single) field is still called `encrypted_key`, so
it is still explicit that the returned key is encrypted.
* `encryption_public_key` --> `transport_public_key`
* Everyone everywhere (in publications, slides, demos, etc.) called this
"transport public key". The reason this was not called
transport_public_key in the API so far was because the containing API
method was called `vetkd_derive_encrypted_key` and the name
`encryption_public_key` should have made it clear that it is this very
public key under which the _encrypted key_ is encrypted. Now that we are
removing the part `encrypted_` from the API name, this reason is
obsolete and we are free to call it `transport_public_key`.
@lwshang
Copy link
Contributor

lwshang commented May 1, 2025

The merged PR #4110 introduced the system API for vetKD cost, including a reference to the management canister endpoint.

I noticed that the names for both the system API and the management canister endpoint were updated in this PR. Could you please ensure the documentation reflects these changes to avoid any inconsistencies?

https://github.com/dfinity/portal/blame/d21d728fce42875832202d46c4410172514dfe3d/docs/references/ic-interface-spec.md#L1549
https://github.com/dfinity/portal/blame/d21d728fce42875832202d46c4410172514dfe3d/docs/references/ic-interface-spec.md#L2140-L2147
https://github.com/dfinity/portal/blame/d21d728fce42875832202d46c4410172514dfe3d/docs/references/ic-interface-spec.md#L7985-L7989

@mraszyk
Copy link
Contributor Author

mraszyk commented May 2, 2025

The merged PR #4110 introduced the system API for vetKD cost, including a reference to the management canister endpoint.

I noticed that the names for both the system API and the management canister endpoint were updated in this PR. Could you please ensure the documentation reflects these changes to avoid any inconsistencies?

https://github.com/dfinity/portal/blame/d21d728fce42875832202d46c4410172514dfe3d/docs/references/ic-interface-spec.md#L1549 https://github.com/dfinity/portal/blame/d21d728fce42875832202d46c4410172514dfe3d/docs/references/ic-interface-spec.md#L2140-L2147 https://github.com/dfinity/portal/blame/d21d728fce42875832202d46c4410172514dfe3d/docs/references/ic-interface-spec.md#L7985-L7989

@fspreiss It seems you renamed the API from derive_encrypted_key to derive_key in this PR incl. the system API to get the cost. Could you please perform this renaming in this spec PR, too?

@fspreiss
Copy link
Contributor

fspreiss commented May 8, 2025

@fspreiss It seems you renamed the API from derive_encrypted_key to derive_key in this PR incl. the system API to get the cost. Could you please perform this renaming in this spec PR, too?

Done.

@fspreiss fspreiss marked this pull request as ready for review May 13, 2025 14:44
@fspreiss fspreiss requested a review from a team as a code owner May 13, 2025 14:44
@fspreiss fspreiss requested a review from andreacerulli May 13, 2025 14:44
Copy link
Contributor

@Dfinity-Bjoern Dfinity-Bjoern left a comment

Choose a reason for hiding this comment

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

Thanks @mraszyk and @fspreiss – please proceed in sync with mainnet release.

@mraszyk mraszyk enabled auto-merge (squash) June 2, 2025 20:22
@mraszyk mraszyk merged commit 8453be2 into master Jun 2, 2025
8 checks passed
@mraszyk mraszyk deleted the fspreiss/vetkd-system-api branch June 2, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interface-spec Changes to the IC Interface Specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants