# Threshold Key Derivation - Privacy on the IC

**URL:** <https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560>\
**Category:** Developers\
**Tags:** Discussing, privacy\
**Created:** [November 14, 2022, 2:14pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560 "2022-11-14T14:14:11Z")\
**Posts on this page:** 19\
**Page:** 12

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [May 21, 2025, 1:39pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/223 "2025-05-21T13:39:27Z")

</div>

@andrea @kristofer

I noticed that in `ic-cdk v0.18`, `vetKey` uses `context: blob` instead of `derivation_path: vec blob`. How is `derivation_path` converted to `context`? I haven’t found any documentation on this yet.

> <https://github.com/dfinity/cdk-rs/blob/main/ic-management-canister-types/src/lib.rs#L1091>

---

<div class="post-metadata">

**Author:** ![franzstefan](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@franzstefan](https://forum.dfinity.org/u/franzstefan)\
**Post date:** [May 22, 2025, 7:38am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/224 "2025-05-22T07:38:17Z")

</div>

Hello! As we have now [created](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/215) and backed up a test key, which will be enabled soon, I wanted to give a quick update regarding some more minor changes to the vetKD API that we did in order to simplify it even further. Similar to the [previous API adaptations](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/173), functionally there are no changes. The API changes are as follows:

- Renamed field `derivation_id` to `input`

- Changed field `derivation_path: vec blob` to `context: blob`

- Renamed API `vetkd_derive_encrypted_key` to `vetkd_derive_key`

- Renamed field `encryption_public_key` to `transport_public_key`

The changes are reflected in the [spec PR](https://github.com/dfinity/portal/pull/3763/files), which will be merged as soon as the new test key is enabled.

Most vetKD-related examples have been updated accordingly already (see [dfinity/examples/pull/1144](https://github.com/dfinity/examples/pull/1144) and [dfinity/examples/pull/1145](https://github.com/dfinity/examples/pull/1145)), the remaining ones will be updated shortly. The chainkey-testing-canister was updated as well (see [chainkey-testing-canister/pull/10](https://github.com/dfinity/chainkey-testing-canister/pull/10)) and it was re-deployed.

---

<div class="post-metadata">

**Author:** ![franzstefan](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@franzstefan](https://forum.dfinity.org/u/franzstefan)\
**Post date:** [May 22, 2025, 7:40am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/225 "2025-05-22T07:40:47Z")

</div>

@zensh, I just posted an update regarding some recent API changes [here](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/224), which also explains the change from `derivation_path` to `context`. Let us know if you have further questions.

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [May 29, 2025, 7:05am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/226 "2025-05-29T07:05:45Z")

</div>

@franzstefan @kristofer

After reviewing the [basic\_timelock\_ibe](https://github.com/dfinity/vetkeys/tree/main/examples/basic_timelock_ibe) example, I found that anyone can obtain the vetkey for any auction.  
If encrypted bid data is accessible, the bid price can be decrypted—a malicious node provider could exploit this.  
I believe this example is misleading and inappropriate for developers.

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [May 29, 2025, 10:46am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/227 "2025-05-29T10:46:36Z")

</div>

I used `test_key_1` on the mainnet—`vetkd_public_key` succeeded, but `vetkd_derive_key` failed with the error: `'SignCostError(InvalidKeyName)'` .  
The canister uses **ic-cdk v0.18**.

---

<div class="post-metadata">

**Author:** ![tkachenko](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tkachenko](https://forum.dfinity.org/u/tkachenko)\
**Post date:** [May 30, 2025, 7:33am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/228 "2025-05-30T07:33:08Z")

</div>

@zensh Can you please describe the steps describing what a malicious party would need to do in order to get unauthorized access to a vetKey in that example? I believe the only function in that example that retrieves vetKeys is invoked by a timer, so the conditions for retrieving vetKeys are quite limited and there is no canister APIs either allowing to derive vetKeys directly.

---

<div class="post-metadata">

**Author:** ![tkachenko](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tkachenko](https://forum.dfinity.org/u/tkachenko)\
**Post date:** [May 30, 2025, 7:35am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/229 "2025-05-30T07:35:51Z")

</div>

The `test_key_1` is created and backed up, but it’s not yet enabled. IIRC we wanted to create a proposal ~~next Monday~~ today s.t. the key can be enabled latest next Monday if the proposal is accepted. cc: @franzstefan

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [May 30, 2025, 11:51am UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/230 "2025-05-30T11:51:22Z")

</div>

> [@tkachenko](#):
>
> Can you please describe the steps describing what a malicious party would need to do in order to get unauthorized access to a vetKey in that example?

Sorry, my mistake—I just realized **IbeCiphertext** is an asymmetric encryption algorithm. Client users don’t need the vetkey; instead, they encrypt data using a public key. This is a great feature!

---

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://forum.dfinity.org/u/andrea)\
**Post date:** [May 30, 2025, 12:17pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/231 "2025-05-30T12:17:11Z")

</div>

Bare in mind that there are some necessary changes related to the public key derivation that are being rolled out with the latest release, so you may need to retrieve again your public keys once the rollout has finished (expected next Monday).

Out of curiosity, Do you have any existing use cases in mind? We would be happy to hear about those and provide support if needed.

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [May 30, 2025, 12:55pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/232 "2025-05-30T12:55:30Z")

</div>

In our use case, we employ vetkey to encrypt and protect the TEE’s root key. This root key is randomly generated inside the TEE during its initial service setup.

> **[GitHub - ldclabs/ic-tee: 🔐 Make Trusted Execution Environments (TEEs) work...](https://github.com/ldclabs/ic-tee)**
>
> 🔐 Make Trusted Execution Environments (TEEs) work with the Internet Computer.

Additionally, in [dMsg.net](http://dMsg.net), all user keys will also be protected by vetkey.

---

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://forum.dfinity.org/u/andrea)\
**Post date:** [May 30, 2025, 1:31pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/233 "2025-05-30T13:31:29Z")

</div>

We submitted the proposal to enable the test key on subnet `fuqsr`: [Subnet Management - fuqsr (Application) - #49 by andrea](https://forum.dfinity.org/t/subnet-management-fuqsr-application/33655/49)

---

<div class="post-metadata">

**Author:** ![ZackDS](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zackds/32/40368_2.png) [@ZackDS](https://forum.dfinity.org/u/ZackDS)\
**Post date:** [May 30, 2025, 1:53pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/234 "2025-05-30T13:53:20Z")

</div>

You might want to check out [this](https://github.com/dfinity/ic/commit/06bdd95d1b2ff67f8735e0daff7c9813ec2e866e) from the current release. Btw love the work you did with ic-tee.

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [May 30, 2025, 2:06pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/235 "2025-05-30T14:06:11Z")

</div>

The purposes differ: IC’s TEE runs ICP nodes, while our ic-tee executes applications - specifically backend services that can’t be implemented with canisters.

---

<div class="post-metadata">

**Author:** ![zensh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zensh/32/15359_2.png) [@zensh](https://forum.dfinity.org/u/zensh)\
**Post date:** [June 2, 2025, 11:47pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/236 "2025-06-02T23:47:13Z")

</div>

> [@tkachenko](#):
>
> The `test_key_1` is created and backed up, but it’s not yet enabled. IIRC we wanted to create a proposal ~~next Monday~~ today s.t. the key can be enabled latest next Monday if the proposal is accepted.

Just tried it, `test_key_1` is working now—only `ic-cdk v0.18` left.

---

<div class="post-metadata">

**Author:** ![shipstone](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/shipstone/32/19378_2.png) [@shipstone](https://forum.dfinity.org/u/shipstone)\
**Post date:** [September 1, 2025, 5:49pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/237 "2025-09-01T17:49:22Z")

</div>

We’re seeing an unusual vetKD problem arising from a project for sharing encrypted files:

I am getting `vetkd\_proper.js:98 (xed out) Proper VetKD key derivation failed: Error: Failed to derive encrypted key: vetKD system unavailable: IC0536: Management canister has no method ‘vetkd\_encrypted\_key’  
at deriveFileKey (vetkd\_proper.js:55:13)  
at async Proxy.uploadFile (index.js:897:27)  
at async Proxy.handleFileSelect (index.js:987:5)  
index.js:973 Upload error: Error: VetKD\_DERIVATION\_FAILED: Failed to derive encrypted key: vetKD system unavailable: IC0536: Management canister has no method ‘vetkd\_encrypted\_key’  
at deriveFileKey (vetkd\_proper.js 26)  
at async Proxy.uploadFile (index.js:897:27)  
at async Proxy.handleFileSelect (index.js:987:5)

Is this live? do we need to pick a specific subnet?

---

<div class="post-metadata">

**Author:** ![franzstefan](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@franzstefan](https://forum.dfinity.org/u/franzstefan)\
**Post date:** [September 1, 2025, 7:44pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/238 "2025-09-01T19:44:08Z")

</div>

> Is this live? do we need to pick a specific subnet?

@shipstone, yes, the vetKeys feature is live, and you don’t need to target a specific subnet, as requests are automatically routed to the correct subnet that holds the master key.

> vetKD system unavailable: IC0536: Management canister has no method ‘vetkd\_encrypted\_key’

The problem seems to be that you are using an outdated name for the key derivation function (`vetkd_encrypted_key`). We made some minor modifications to the vetKD API before the feature went live (see [this](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/173) and [this](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/224)), so as to make the API simpler and easier to understand. The new name is `vetkd_derive_key`. You find a detailed description of the new API [here](https://internetcomputer.org/docs/building-apps/network-features/vetkeys/api).

---

<div class="post-metadata">

**Author:** ![nokemono](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nokemono/32/20112_2.png) [@nokemono](https://forum.dfinity.org/u/nokemono)\
**Post date:** [December 11, 2025, 10:07pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/240 "2025-12-11T22:07:00Z")

</div>

In the current VetKeys design, can the canister see the plaintext of the decrypted data?

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [December 11, 2025, 10:42pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/241 "2025-12-11T22:42:19Z")

</div>

No, VetKeys are end-to-end, so basically you encrypt data on client A, store it in canister B and then fetch it and decrypt it on client C.

The VetKeys API provides a way to generate private key material with access control from a canister towards multiple clients. For example, everyone who’s a member of a group chat can request the same private key material to encrypt and decrypt the messages within the group chat.

---

<div class="post-metadata">

**Author:** ![kristofer](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kristofer/32/11135_2.png) [@kristofer](https://forum.dfinity.org/u/kristofer)\
**Post date:** [December 11, 2025, 10:47pm UTC](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560/242 "2025-12-11T22:47:26Z")

</div>

Adding to message by @sea-snake. It is also entirely possible and many times advisable to decrypt to plaintext in the canister. It depends on the usecase. If you for instance do a voting app where all votes are revealed after a certain point in time or a poker game where everyones hands are revealed at the same time, then decryption in the canister is the way to go.

[Previous page](https://forum.dfinity.org/t/threshold-key-derivation-privacy-on-the-ic/16560.md?page=11)
