Skip to content

Commit e7034fb

Browse files
committed
docs(common): user decrypt
1 parent 455e0a1 commit e7034fb

File tree

10 files changed

+27
-27
lines changed

10 files changed

+27
-27
lines changed

docs/introductions/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- [Overview](architecture_overview.md)
1010
- [FHE on blockchain](fhe-on-blockchain.md)
1111
- [FHEVM components](fhevm-components.md)
12-
- [Encryption, decryption, re-encryption, and computation](d_re_ecrypt_compute.md)
12+
- [Encryption, decryption, and computation](d_re_ecrypt_compute.md)
1313

1414
## References
1515

docs/introductions/architecture_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The FHEVM architecture provides the foundation for confidential smart contracts
44
core is FHE, a cryptographic technique enabling computations directly on encrypted data, ensuring privacy at every
55
stage. 
66

7-
This system relies on three key types: 
7+
This system relies on three key types:
88

99
- The **public key:** used by users to encrypt their inputs locally.
1010
- The **private key:** required for decryption, securely distributed and managed through a threshold MPC-based Key

docs/introductions/d_re_ecrypt_compute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ User decryption is initiated on the client side using the
115115
- The dApp receives the encrypted ciphertext under the user's public key from the Gateway/Relayer.
116116
- The dApp decrypts the ciphertext locally using the user's private key.
117117

118-
You can read [our re-encryption guide explaining how to use it](solidity-guides/decryption/reencryption.md).
118+
You can read [our user decryption guide explaining how to use it](solidity-guides/decryption/user-decryption.md).
119119

120120
## **Tying It All Together**
121121

docs/introductions/fhevm-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ The KMS is a decentralized threshold-MPC-based service that manages the FHE key
8787

8888
The KMS ensures robust cryptographic security, preventing single points of failure and maintaining public verifiability.
8989

90-
In the next section, we will dive deeper into encryption, re-encryption, and decryption processes, including how they
91-
interact with the KMS and Gateway services. For more details, see
90+
In the next section, we will dive deeper into encryption and decryption processes, including how they
91+
interact with the KMS and relayer services. For more details, see
9292
[Encryption, decryption, and computation](./d_re_ecrypt_compute.md).

docs/solidity-guides/SUMMARY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
- [Access Control List](acl/README.md)
2020
- [ACL examples](acl/acl_examples.md)
2121

22-
## Decryption & Re-encryption
22+
## Public Decryption & User Decryption
2323

24-
- [Decryption](decryption/decrypt.md)
24+
- [User Decryption](decryption/user-decryption.md)
25+
- [Public Decryption](decryption/public-decryption.md)
2526
- [Decryption in depth](decryption/decrypt_details.md)
26-
- [Re-encryption](decryption/reencryption.md)
2727

2828
## Control Flow & Logic
2929

docs/solidity-guides/configure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To utilize encrypted computations in Solidity contracts, you must configure the
99
## Key components configured automatically
1010

1111
1. **FHE library**: Sets up encryption parameters and cryptographic keys.
12-
2. **Relayer**: Manages secure cryptographic operations, including reencryption and decryption.
12+
2. **Relayer**: Manages secure cryptographic operations, including user decryption and public decryption.
1313
3. **Network-specific settings**: Adapts to local testing, testnets (Sepolia for example), or mainnet deployment.
1414

1515
By inheriting these configuration contracts, you ensure seamless initialization and functionality across environments.
@@ -45,9 +45,9 @@ contract MyERC20 is SepoliaZamaFHEVMConfig {
4545
}
4646
```
4747

48-
## ZamaRela.sol
48+
## ZamaConfig.sol
4949

50-
To perform decryption or reencryption, your contract must interact with the **Relayer**, which acts as a secure bridge between the blockchain, coprocessor, and Key Management System (KMS).
50+
To perform public decryption or user decryption, your contract must interact with the **Relayer**, which acts as a secure bridge between the blockchain, coprocessor, and Key Management System (KMS).
5151

5252
**Import based on your environment**
5353

docs/solidity-guides/decryption/decrypt_details.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ You can call the function `FHE.checkSignatures` as such:
6262
The first argument, `requestID`, is the value that was returned in the `requestDecryption`function.
6363
The second argument, `signatures`, is an array of signatures from the KMS signers.
6464

65-
This function reverts if the signatures are invalid.
65+
This function reverts if the signatures are invalid.

docs/solidity-guides/decryption/decrypt.md renamed to docs/solidity-guides/decryption/public-decryption.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Decryption
1+
# Public decryption
22

33
This section explains how to handle decryption in fhevm. Decryption allows plaintext data to be accessed when required for contract logic or user presentation, ensuring confidentiality is maintained throughout the process.
44

55
{% hint style="info" %}
6-
Understanding how encryption, decryption and reencryption works is a prerequisite before implementation, see [Encryption, Decryption, Re-encryption, and Computation](../../introductions/d_re_ecrypt_compute.md).
6+
Understanding how encryption, user decryption, and public decryption works is a prerequisite before implementation, see [Encryption, User Decryption, Public Decryption, and Computation](../../introductions/d_re_ecrypt_compute.md).
77
{% endhint %}
88

99
Decryption is essential in two primary cases:
1010

1111
1. **Smart contract logic**: A contract requires plaintext values for computations or decision-making.
1212
2. **User interaction**: Plaintext data needs to be revealed to all users, such as revealing the decision of the vote.
1313

14-
To learn how decryption works see [Encryption, Decryption, Re-encryption, and Computation](../../introductions/d_re_ecrypt_compute.md).
14+
To learn how decryption works see [Encryption, User decryption, Public decryption, and Computation](../../introductions/d_re_ecrypt_compute.md).
1515

1616
## Overview
1717

@@ -60,7 +60,7 @@ contract TestAsyncDecrypt is SepoliaConfig {
6060

6161
### Next steps
6262

63-
Explore advanced decryption techniques and learn more about re-encryption:
63+
Explore advanced decryption techniques and learn more about user decryption:
6464

6565
- [Decryption in depth](decrypt_details.md)
66-
- [Re-encryption](reencryption.md)
66+
- [User decryption](user-decryption.md)

docs/solidity-guides/decryption/reencryption.md renamed to docs/solidity-guides/decryption/user-decryption.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
This document explains how to perform user decryption. User decryption required when you want a user to access their private data without it being exposed to the blockchain.
44

5-
Re-encryption in FHEVM enables the secure sharing or reuse of encrypted data under a new public key without exposing the plaintext. This feature is essential for scenarios where encrypted data must be transferred between contracts, dApps, or users while maintaining its confidentiality.
5+
User decryption in FHEVM enables the secure sharing or reuse of encrypted data under a new public key without exposing the plaintext. This feature is essential for scenarios where encrypted data must be transferred between contracts, dApps, or users while maintaining its confidentiality.
66

77
{% hint style="info" %}
8-
Before implementing re-encryption, ensure you are familiar with the foundational concepts of encryption, re-encryption and computation. Refer to [Encryption, Decryption, Re-encryption, and Computation](../introductions/d_re_ecrypt_compute.md).
8+
Before implementing user decryption ensure you are familiar with the foundational concepts of encryption, decryption, and computation. Refer to [Encryption, Decryption, and Computation](../introductions/d_re_ecrypt_compute.md).
99
{% endhint %}
1010

1111
## When to use user decryption
@@ -14,11 +14,11 @@ User decryption is particularly useful for **allowing individual users to secure
1414

1515
## Overview
1616

17-
The re-encryption process involves retrieving ciphertext from the blockchain and performing re-encryption on the client-side. In other words we take the data that has been encrypted by the KMS, decrypt it and encrypt it with the users private key, so only he can access the information.
17+
The user decryption process involves retrieving ciphertext from the blockchain and performing user-decryption on the client-side. In other words we take the data that has been encrypted by the KMS, decrypt it and encrypt it with the users private key, so only he can access the information.
1818

1919
This ensures that the data remains encrypted under the blockchain’s FHE key but can be securely shared with a user by re-encrypting it under the user’s NaCl public key.
2020

21-
Re-encryption is facilitated by the **Relayer** and the **Key Management System (KMS)**. The workflow consists of the following:
21+
User decryption is facilitated by the **Relayer** and the **Key Management System (KMS)**. The workflow consists of the following:
2222

2323
1. Retrieving the ciphertext from the blockchain using a contract’s view function.
2424
2. Re-encrypting the ciphertext client-side with the user’s public key, ensuring only the user can decrypt it.
@@ -41,10 +41,10 @@ contract ConfidentialERC20 {
4141

4242
Here, `balanceOf` allows retrieval of the user’s encrypted balance stored on the blockchain.
4343

44-
## Step 2: re-encrypt the ciphertext
44+
## Step 2: decrypt the ciphertext
4545

46-
Re-encryption is performed client-side using the `@fhevm/sdk` library. [Refer to the guide](../../frontend/webapp.md) to learn how to include `@fhevm/sdk` in your project.
47-
Below is an example of how to implement reencryption in a dApp:
46+
User decryption is performed client-side using the `@fhevm/sdk` library. [Refer to the guide](../../frontend/webapp.md) to learn how to include `@fhevm/sdk` in your project.
47+
Below is an example of how to implement user decryption in a dApp:
4848

4949
```ts
5050
import { createInstances } from "../instance";
@@ -63,7 +63,7 @@ await initSigners(); // Initialize signers
6363
const signers = await getSigners();
6464

6565
const instance = await createInstances(this.signers);
66-
// Generate the private and public key, used for the reencryption
66+
// Generate the private and public key, used for the user decryption
6767
const { publicKey, privateKey } = instance.generateKeypair();
6868

6969
// Create an EIP712 object for the user to sign.
@@ -96,4 +96,4 @@ This code retrieves the user’s encrypted balance, re-encrypts it with their pu
9696

9797
- **`instance.generateKeypair()`**: Generates a public-private keypair for the user.
9898
- **`instance.createEIP712(publicKey, CONTRACT_ADDRESS)`**: Creates an EIP712 object for signing the user’s public key.
99-
- **`instance.reencrypt()`**: Facilitates the re-encryption process by contacting the relayer and decrypting the data locally with the private key.
99+
- **`instance.reencrypt()`**: Facilitates the user decryption process by contacting the relayer and decrypting the data locally with the private key.

docs/solidity-guides/inputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This document introduces the concept of encrypted inputs in the fhevm, explaining their role, structure, validation process, and how developers can integrate them into smart contracts and applications.
44

55
{% hint style="info" %}
6-
Understanding how encryption, decryption and reencryption works is a prerequisite before implementation, see [Encryption, Decryption, Re-encryption, and Computation](../introductions/d_re_ecrypt_compute.md)
6+
Understanding how encryption, decryption and reencryption works is a prerequisite before implementation, see [Encryption, Decryption, and Computation](../introductions/d_re_ecrypt_compute.md)
77
{% endhint %}
88

99
Encrypted inputs are a core feature of fhevm, enabling users to push encrypted data onto the blockchain while ensuring data confidentiality and integrity.

0 commit comments

Comments
 (0)