You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document explains one of the key components of the Zama Protocol - The Key Management Service (KMS), responsible for the secure generation, management, and usage of encryption keys needed to enable confidential smart contracts. 
3
+
This document explains one of the key components of the Zama Protocol - The Key Management Service (KMS), responsible for the secure generation, management, and usage of FHE keys needed to enable confidential smart contracts.
4
4
5
5
## What is the KMS?
6
6
7
-
The KMS is a decentralized network of MPC (Multi-Party Computation) nodes that:
7
+
The KMS is a decentralized network of several nodes (also called "parties") that run an MPC (Multi-Party Computation) protocol:
8
8
9
-
-Generate global FHE keys
10
-
- Decrypt ciphertexts securely
9
+
-Securely generate global FHE keys
10
+
- Decrypt ciphertexts securely for public and user-targeted decryptions
11
11
- Support zero-knowledge proof infrastructure
12
12
- Manage key lifecycles with NIST compliance
13
-
- Provide public and user-targeted decryptions
14
13
15
14
It works entirely off-chain, but is orchestrated through the Gateway, which initiates and tracks all key-related operations. This separation of powers ensures strong decentralization and auditability.
16
15
17
16
## Key responsibilities
18
17
19
-
### FHE key generation
18
+
### FHE threshold key generation
20
19
21
-
- The KMS generates a global public/private key pair used across all host chains.
22
-
- This key enables composability—encrypted data can be shared between contracts and chains.
23
-
- The private FHE key is never reconstructed; instead, it is secret-shared among the MPC nodes.
20
+
- The KMS securely generates a global public/private key pair used across all host chains.
21
+
- This key enables composability — encrypted data can be shared between contracts and chains.
22
+
- The private FHE key is never directly accessible by a single party; instead, it is secret-shared among the MPC nodes.
24
23
25
24
The system follows the NIST SP 800-57 key lifecycle model, managing key states such as Active, Suspended, Deactivated,and Destroyed to ensure proper rotation and forward security.
26
25
27
-
- Threshold Decryption via MPC The KMS performs decryption using a threshold protocol—at least a minimum number of MPC\
28
-
parties (e.g., 9 out of 13) must collaborate to decrypt a value.
29
-
- This protects against compromise: no individual party has access to the full key.
30
-
- Supports both:
26
+
### Threshold Decryption via MPC
27
+
28
+
The KMS performs decryption using a threshold decryption protocol — at least a minimum number of MPC parties (e.g., 9 out of 13) must participate in the protocol to robustly decrypt a value.
29
+
- This protects against compromise: no individual party has access to the full key. And adversary would need to control more than the threshold of KMS nodes to influence the system.
30
+
- The protocol supports both:
31
31
- Public decryption (e.g., for smart contracts)
32
-
- User decryption (privately returned, re-encrypted for the user)
32
+
- User decryption (privately returned, re-encrypted only for the user to access)
33
33
34
-
All decryption operations are signed, and the output can be verified on-chain for full auditability.
34
+
All decryption operation outputs are signed by each node and the output can be verified on-chain for full auditability.
35
35
36
36
### ZK Proof support
37
37
38
38
The KMS generates Common Reference Strings (CRS) needed to validate Zero-Knowledge Proofs of Knowledge (ZKPoK) when users submit encrypted values.
39
39
40
-
This ensures encrypted inputs are valid and well-formed.
40
+
This ensures encrypted inputs are valid and well-formed, and that a user has knowledge of the plaintext contained in the submitted input ciphertext.
41
41
42
42
## Security architecture
43
43
44
44
### MPC-based key sharing
45
45
46
-
- The KMS uses 13 MPC nodes, operated by different reputable organizations.
46
+
- The KMS currently uses 13 MPC nodes, operated by different reputable organizations.
47
47
- Private keys are split using threshold secret sharing.
48
-
-Communications between nodes are secured using mTLS with gRPC.
48
+
-Communication between nodes are secured using mTLS with gRPC.
49
49
50
50
### Honest majority assumption
51
51
52
-
- The protocol is robust against malicious actors as long as fewer than 1/3 of the nodes collude.
53
-
-Supports guaranteed output delivery even if some nodes are offline or misbehaving.
52
+
- The protocol is robust against malicious actors as long as at most 1/3 of the nodes act maliciously.
53
+
-It supports guaranteed output delivery even if some nodes are offline or misbehaving.
54
54
55
55
### Secure execution environments
56
56
57
-
Each MPC node can optionally run in Nitro Enclaves to prevent even the node operator from accessing their own key share. This mitigates insider risks (e.g., selling shares, unauthorized reconstruction).
57
+
Each MPC node runs by default inside an AWS Nitro Enclave, a secure execution environment that prevents even node operators from accessing their own key shares.
58
+
This design mitigates insider risks, such as unauthorized key reconstruction or selling of shares.
58
59
59
60
### Auditable via gateway
60
61
61
-
- All operations are broadcast through the Gateway and recorded as blockchain events. -KMS responses are signed, allowing smart contracts and users to verify results cryptographically.
62
+
- All operations are broadcast through the Gateway and recorded as blockchain events.
63
+
- KMS responses are signed, allowing smart contracts and users to verify results cryptographically.
62
64
63
65
### Key lifecycle management
64
66
@@ -73,21 +75,21 @@ The KMS adheres to a formal key lifecycle, as per NIST SP 800-57:
73
75
| Compromised | Flagged for misuse; only decryption allowed. |
74
76
| Destroyed | Key material is deleted permanently. |
75
77
76
-
Key Switching is supported via FHE to move ciphertexts between concrete keys during rotation, maintaining\
77
-
interoperability.
78
+
The KMS supports key switching using FHE, allowing ciphertexts to be securely transferred between keys during rotation. This maintains interoperability across key updates.
78
79
79
80
### Backup & recovery
80
81
81
82
In addition to robustness through MPC, the KMS also offers a custodial backup system:
82
83
83
-
- Each MPC party splits its key share into encrypted fragments and sends them to independent custodians.
84
-
- A quorum of custodians can help restore lost shares, enabling recovery even if multiple MPC parties are taken offline.
85
-
- This ensures business continuity and protection from mass outages .
84
+
- Each MPC node splits its key share into encrypted fragments, distributing them to independent custodians.
85
+
- If a share is lost, a quorum of custodians can collaboratively restore it, ensuring recovery even if several MPC nodes are offline.
86
+
- This approach guarantees business continuity and resilience against outages.
87
+
- All recovery operations require a quorum of operators and are fully auditable on-chain.
86
88
87
89
### Workflow example: Public decryption
88
90
89
91
1. A smart contract requests decryption via an oracle.
90
-
2. The Gateway verifies permissions and emits an event.
91
-
3. KMS parties retrieve the ciphertext, verify it, and run the MPC decryption protocol.
92
-
4. Once a quorum agrees, the result is published (with signatures).
92
+
2. The Gateway verifies permissions (i.e. that the contract is allowed to decrypt the ciphertext) and emits an event.
93
+
3. KMS parties retrieve the ciphertext, verify it, and run the MPC decryption protocol to jointly compute the plaintext and sign their result.
94
+
4. Once a quorum agrees on the plaintext result, it is published (with signatures).
93
95
5. The oracle posts the plaintext back on-chain and contracts can verify the authenticity using the KMS signatures.
0 commit comments