docs: vetKeys concept and encryption guide#158
Merged
Conversation
Bump dfinity/examples submodule from 954d208 to d4ea422. The vetkeys examples (password_manager, encrypted_notes_dapp_vetkd, basic_ibe, basic_timelock_ibe, encrypted_chat, basic_bls_signing, password_manager_with_metadata) are now canonical under rust/vetkeys/ in this repo. Update all docs links that pointed to github.com/dfinity/vetkeys/tree/main/examples/... to their new paths at github.com/dfinity/examples/tree/master/rust/vetkeys/... Also add links to new examples (password_manager_with_metadata, basic_timelock_ibe) in the encryption guide, and separate the library and examples links in Next steps.
- Rust: replace unused `use candid::Principal` import with inline `candid::Principal` usage; add `caller_context()` that prefixes the domain separator with the caller's principal bytes; use it in both `get_public_key` and `get_encrypted_vetkey` so each caller's keys are cryptographically isolated - Motoko: same pattern via `callerContext()` using mo:core Array/Blob - Frontend Step 2: replace `TransportSecretKey.fromSeed` + `.publicKey()` with `.random()` + `.publicKeyBytes()` — `.publicKeyBytes()` returns the Uint8Array the canister endpoint expects; `.publicKey()` returns a DerivedPublicKey object and would produce incorrect Candid encoding - Update surrounding prose and Common mistakes to match
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.
Summary
docs/concepts/vetkeys.md: new concept page explaining the vetKD protocol, the V/E/T/K properties, the transport key flow, use cases (encrypted storage, DKMS, IBE, timelock, BLS, VRF), API overview with key names and cycle costs, and current statusdocs/guides/security/encryption.mdx: new how-to guide covering the 4-step key derivation flow (backend canister setup in Motoko and Rust, transport key generation, vetKey decryption, AES-GCM encryption), theEncryptedMapshigher-level pattern, IBE, common mistakes, and local testingencryption.md→encryption.mdxto support Motoko/Rust language tabsCloses #112, closes #113
Notes
vetkdicskill and portal source material (9 files undervetkeys/)mo:coreimports (notmo:base)icpCLI commands throughoutnpm run build): 153 pages, 0 errorsSync recommendation
informed by dfinity/portal docs/building-apps/network-features/vetkeys/(introduction, api, encrypted-onchain-storage, dkms, identity-based-encryption, timelock-encryption);dfinity/icskills vetkdThe portal content is the authoritative upstream reference but targets a different audience and uses JSX components incompatible with Starlight. These pages are hand-written syntheses that track the portal for factual accuracy. Review the portal vetkeys section when bumping the
portalsubmodule.