feat(crypto): CRP-2699 adapt vetKD API to use derivation domain blob instead of path#4049
Merged
fspreiss merged 15 commits intoFeb 26, 2025
Conversation
…instead of path
fspreiss
commented
Feb 21, 2025
randombit
reviewed
Feb 21, 2025
randombit
left a comment
Contributor
There was a problem hiding this comment.
Some questions regarding the derivation itself, otherwise lgtm
eichhorl
approved these changes
Feb 21, 2025
randombit
approved these changes
Feb 25, 2025
Contributor
Author
|
Created CRP-2709 for the potential cleanup of moving of |
github-merge-queue Bot
pushed a commit
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`.
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.
Changes the hierarchical vetKD
derivation_path: vec blobto a non-hierarchicalderivation_domain: blobbecause the vetKD public key derivation algorithm is actually non-hierarchical. This simplifies the API. Callers can still embed hierarchical structure into the derivation domain blob if they wish.The respective change in the IC spec PR is dfinity/portal@3bbb8f4.
The name derivation domain is not set in stone and is up for discussion. One possible alternative is derivation context, but there may be others.
Note that the
SignWithThresholdContextcurrently contains a fieldSignWithThresholdContext::derivation_path: Vec<Vec<u8>>that currently applies no matter if the context relates to ECDSA, Schnorr, or VetKD (based on theSignWithThresholdContext:args: ThresholdArguments). Now that the VetKD variant uses just a blob instead of a vec of blobs, the derivation path is flattened to form the derivation domain. In a later step, we may consider movingSignWithThresholdContext::derivation_pathinto{Ecdsa|Schnorr}Argumentsand addVetKdArguments::derivation_domain, given that not all three arguments don't use the hierarchical derivation path any more. This, however, is not strictly necessary and rather a cleanup action, which would require a multi-step migration because theSignWithThresholdContextis persisted in the state.