Repository navigation
VC KeyPackage handling - #2067
Merged
Merged
Conversation
Add the key_package operation secret and per-index seed derivation (KeyPackageSeedContext), the KeyPackageInfo, KeyPackageUpload, and RetainedKeyPackageMaterial types, the leaf_node_source select on DerivationInfoTBE, upload validation, and the assemble and process helpers.
Add the RetainedKeyPackageMaterial storage entity with its batch write, single read and delete, epoch-liveness query, and guarded epoch-state deletion, across the storage trait and the memory and sqlite providers, with the sqlite migration.
Embed and read the DerivationInfo on commit and update leaves, inject the derived leaf encryption keypair, and carry the (GroupId, GroupEpoch) emulation binding.
Add KeyPackageBuilder::build_vc_batch and KeyPackage::new_from_vc_keys to build a batch of virtual-client KeyPackages whose init and leaf keys derive from per-index seeds.
Let a sibling emulator join a higher-level group via a virtual client's KeyPackage: look up the retained material by KeyPackageRef, derive the keys from the stored seed, and validate against the leaf's DerivationInfo.
Unit and integration tests for KeyPackage building, upload processing, Welcome joins, and the storage epoch-liveness behavior.
boxdot
reviewed
Jun 18, 2026
raphaelrobert
requested changes
Jun 18, 2026
raphaelrobert
left a comment
Member
There was a problem hiding this comment.
This looks good in general. I found a few nits. It would also be good to have a PR description for posterity.
raphaelrobert
approved these changes
Jun 19, 2026
raphaelrobert
left a comment
Member
There was a problem hiding this comment.
Thanks for making the changes!
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.
Adds KeyPackage building and Welcome processing for virtual clients (behind
virtual-clients-draft), so a virtual client can publish KeyPackages that a sibling recovers and uses to join higher-level groups.KeyPackageBuilder::build_vc_batchallocates onekey_packageoperation generation per batch, derives a per-KeyPackage seed (and from it the init and leaf encryption keys) for each index, and embeds an encryptedDerivationInfoin each leaf underVC_COMPONENT_ID. Returns aVcKeyPackageBatchwith the generation and the built bundles.assemble_vc_key_package_uploadbuilds and retains the key material for a received KeyPackage upload message.find_and_validate_vc_own_leaflocates the joined leaf by its derived encryption key, decrypts the leaf'sDerivationInfo, and checks the embedded(leaf_index, generation, key_package_index)against the retained material.