Skip to content

Commit ab39ae1

Browse files
docs(common): move protocol stuff (#340)
1 parent 51527d3 commit ab39ae1

20 files changed

Lines changed: 121 additions & 212 deletions

docs/introductions/architecture_overview.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/introductions/fhevm-components.md

Lines changed: 0 additions & 92 deletions
This file was deleted.

docs/introductions/introduction-overview.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/introductions/litepaper.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/introductions/repositories.md

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ layout:
3232

3333
### **Set up your development environment**
3434

35-
Use the official Hardhat template from Zama that includes all necessary configurations and dependencies to start developing confidential smart contracts.
35+
Use the official Hardhat template from Zama that includes all necessary configurations and dependencies to start
36+
developing confidential smart contracts.
3637

3738
<a href="https://github.com/zama-ai/fhevm-hardhat-template" class="button secondary">Clone the template</a>
3839
{% endstep %}
@@ -41,8 +42,7 @@ Use the official Hardhat template from Zama that includes all necessary configur
4142

4243
### Write your first confidential smart contract
4344

44-
Use the provided contract examples, like `MyCounter`, to begin. A basic counter contract might look
45-
like this:
45+
Use the provided contract examples, like `MyCounter`, to begin. A basic counter contract might look like this:
4646

4747
```solidity
4848
// SPDX-License-Identifier: BSD-3-Clause-Clear
@@ -64,17 +64,17 @@ contract MyCounter is ZamaConfig {
6464
}
6565
```
6666

67-
<a href="https://docs.zama.ai/doc-ui/IoEzE96rh6dKmIRhgam5/solidity-guides/get-started/overview" class="button primary">See the full
68-
Solidity guide</a> {% endstep %}
67+
<a href="https://docs.zama.ai/doc-ui/IoEzE96rh6dKmIRhgam5/solidity-guides/get-started/overview" class="button primary">See
68+
the full Solidity guide</a> {% endstep %}
6969

7070
{% step %}
7171

7272
### Build your frontend with `@zama-ai/relayer-sdk`
7373

7474
Start from Zama's ready-to-use React template.
7575

76-
<a href="https://docs.zama.ai/doc-ui/IoEzE96rh6dKmIRhgam5/sdk-guides" class="button primary">See the full SDK
77-
guide</a> <a href="https://github.com/zama-ai/fhevm-react-template" class="button secondary">Clone the template</a> ;
76+
<a href="https://docs.zama.ai/doc-ui/IoEzE96rh6dKmIRhgam5/sdk-guides" class="button primary">See the full SDK guide</a>
77+
<a href="https://github.com/zama-ai/fhevm-react-template" class="button secondary">Clone the template</a> ;
7878
{% endstep %}
7979

8080
{% step %}
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
## Getting Started
1+
- [Welcome](README.md)
22

3-
- [Welcome to FHEVM[Draft]](README.md)
4-
- [Overview](introduction-overview.md)
3+
## Protocol
54

6-
## Architecture
7-
8-
- [Litepaper](litepaper.md)
9-
- [Overview](architecture_overview.md)
10-
- [FHE on blockchain](fhe-on-blockchain.md)
11-
- [FHEVM components](fhevm-components.md)
12-
- [Encryption, decryption, and computation](d_re_ecrypt_compute.md)
13-
14-
## References
15-
16-
- [Table of all addresses](table_of_addresses.md)
17-
- [Repositories](overview.md)
5+
- [FHE on Blockchain](architecture/overview.md)
6+
- [Coprocessor](architecture/coprocessor.md)
7+
- [Gateway](architecture/gateway.md)
8+
- [KMS](architecture/kms.md)
9+
- [Relayer & Oracle](architecture/relayer_oracle.md)
10+
- [Roadmap](roadmap.md)
1811

1912
## Developer
2013

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Coprocessor
2+
3+
The coprocessor is the compute engine of FHEVM, designed to handle resource-intensive homomorphic operations.
4+
5+
### **Key functions**:
6+
7+
1. **Execution**: Performs encrypted operations (e.g., _add_, _mul_) on ciphertexts using the evaluation key.
8+
2. **Ciphertext management**: Stores and retrieves ciphertexts securely in an off-chain database. Only handles are
9+
returned on-chain.
10+
11+
## **Computation**
12+
13+
Encrypted computations are performed using the **evaluation key** on the coprocessor.
14+
15+
- **How it works**:
16+
1. The smart contract emits FHE operation events as symbolic instructions.
17+
2. These events are picked up by the coprocessor, which evaluates each operation individually using the evaluation
18+
key, without ever decrypting the data.
19+
3. The resulting ciphertext is persisted in the coprocessor database, while only a handle is returned on-chain.
20+
- **Data flow**:
21+
- **Source**: Blockchain smart contracts (via symbolic execution).
22+
- **Processing**: Coprocessor (using the evaluation key).
23+
- **Destination**: Blockchain (updated ciphertexts).
24+
25+
<figure><img src="../.gitbook/assets/computation.png" alt="computation"><figcaption></figcaption></figure>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Gateway
2+
3+
The Gateway acts as the communication hub between the blockchain, the coprocessor, the KMS, and user-facing
4+
applications.
5+
6+
### **Key functions**:
7+
8+
- **API for developers**: Exposes endpoints to submit encrypted inputs, request decryption, and manage user decryption.
9+
- **Proof validation**: Forwards ZKPoKs to the Coprocessor for verification.
10+
- **Off-chain coordination**: Handles smart contract and user decryption workflows in a verifiable and secure manner.
11+
12+
The Gateway abstracts complex cryptographic flows, simplifying developer integration.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Host chain
2+
3+
FHEVM smart contracts are Solidity contracts that interact with encrypted values through symbolic execution.
4+
5+
### **Symbolic execution in Solidity**
6+
7+
- **Handles**: Smart contract operations return handles (references to ciphertexts), rather than directly manipulating
8+
encrypted data.
9+
- **Lazy Execution**: Actual computation is done off-chain by the coprocessor after the contract emits symbolic
10+
instructions.
11+
12+
This allows efficient, gas-minimized interaction with encrypted data, while preserving EVM compatibility.
13+
14+
### **Zero-Knowledge proofs of knowledge (ZKPoKs)**
15+
16+
FHEVM incorporates ZKPoKs to verify the correctness of encrypted inputs and outputs:
17+
18+
- **Validation**: ZKPoKs ensure that inputs are correctly formed and correspond to known plaintexts without revealing
19+
sensitive data.
20+
- **Integrity**: They prevent misuse of ciphertexts and ensure the correctness of computations.
21+
22+
By combining symbolic execution and ZKPoKs, FHEVM smart contracts maintain both privacy and verifiability.

0 commit comments

Comments
 (0)