Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update the docs to fhevm06 #612

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

docs: update the docs to fhevm06 #612

wants to merge 14 commits into from

Conversation

poppyseedDev
Copy link
Contributor

@poppyseedDev poppyseedDev commented Nov 21, 2024

Closes #531
Closes #523
Closes #529
Closes #533
Closes #497
Closes #527
Closes #528
Closes #243
Closes #521
Closes #520
To discuss #522

This PR significantly improves the developer documentation to make it more developer-friendly by addressing gaps, adding clarity, and enhancing usability. The following changes have been introduced:

Key Improvements

  • Developer-Focused Enhancements: Concepts that were previously unexplained are now clarified.
  • Reorganization: Sections have been rearranged for better flow and readability.
  • Visual Aids: Diagrams are added to simplify complex ideas.
  • Expanded Examples: New and updated code examples are provided to illustrate key concepts.

Section Updates

Welcome to fhEVM

  • No changes.

Getting Started

  • Quick Overview:

    • Key concepts and features are now consolidated here for easier access.
    • The list of repositories has been moved to this section.
    • Includes a reference to the whitepaper (pending an update).
  • Get Started:

    • DevNet details have been streamlined and replaced with Ethereum deployment instructions.
  • Create a Smart Contract:

    • Updated the Hardhat guide to ensure compatibility with fhEVM v0.6.
    • Formatting improvements.

Fundamentals

Focuses on explaining core concepts and critical features with clear explanations and examples.

  • Architecture Overview:

    • Provides a high-level understanding of fhEVM architecture.
    • No code examples, focusing instead on concepts.
  • Encryption, Decryption, Re-encryption, and Computation:

    • Explains these fundamental concepts with accompanying diagrams for better understanding.
  • Access Control List (ACL):

    • High-level overview without detailed code.

Configuration

Practical guidance on setting up and configuring smart contracts for encrypted operations.

  • First Smart Contract:

    • Includes a simple counter contract example with detailed explanations.
  • Supported Types:

    • Lists all supported encrypted types.
  • Operations on Encrypted Types:

    • Detailed documentation of all supported operations on encrypted types.
  • Encryption:

    • Encrypted input implementation with a code example.
  • Decryption:

    • Provides a code example for decryption.
  • Decryption in Depth:

    • Explains advanced considerations and edge cases for decryption.
  • Re-encryption:

    • Includes code examples demonstrating re-encryption workflows.
  • ACL Examples:

    • Detailed ACL implementations and use cases with code examples.

Guides

Focuses on supplemental concepts and best practices for smart contract development.

  • Smart Contracts:

    • Topics include common pitfalls, conditional statements, FHE branching, random number generation, gas estimation, and error handling.
  • Frontend:

    • Covers frontend-related topics, including application building, Node.js integration, CLI usage, and handling common Webpack errors.

Tutorials

  • See All Tutorials:
    • Provides a centralized list of tutorials.

References

  • Smart Contracts - fhEVM API:

    • Updated for the latest version.
  • Frontend - fhevmjs Library:

    • No updates yet.

Developer

  • Contributing:

    • Added a link to the bounty program.
  • Development Roadmap:

    • Updated to reflect the latest milestones.
  • Feature Request and Bug Report:

    • Links updated for improved usability.
  • Release Notes:

    • Unchanged.

Future TODOs

  • Update the whitepaper to the latest version.
  • Expand deployment instructions for Sepolia.
  • Upgrade the Remix guide to match the latest version.
  • Update the frontend development section.

@poppyseedDev poppyseedDev marked this pull request as ready for review November 22, 2024 18:32
docs/fundamentals/first_step/acl_examples.md Outdated Show resolved Hide resolved
docs/fundamentals/first_step/acl_examples.md Outdated Show resolved Hide resolved
docs/fundamentals/first_step/acl_examples.md Show resolved Hide resolved
docs/fundamentals/first_step/acl_examples.md Show resolved Hide resolved
docs/fundamentals/first_step/configure.md Outdated Show resolved Hide resolved
docs/guides/gas.md Show resolved Hide resolved
docs/getting_started/ethereum.md Outdated Show resolved Hide resolved
docs/getting_started/ethereum.md Show resolved Hide resolved
docs/getting_started/ethereum.md Outdated Show resolved Hide resolved
docs/getting_started/repositories.md Outdated Show resolved Hide resolved
To simplify matters, a number of functions automatically generate temporary access (using `TFHE.allowTransient` under the hood) for the contract that calls the function. This applies to:
- **`allow`**: Grants permanent access to an address.
- **`allowThis`**: Grants the current contract access to manipulate the ciphertext.
- **`allowTransient`**: Grants temporary access to an address for the current transaction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to link to the explanation of what is transient storage https://eips.ethereum.org/EIPS/eip-1153

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's mentioned a bit above (line 41)

| Transient | Temporary access during a transaction. | Transient storage (EIP-1153) | Calling external functions or computations with ciphertexts. Use when wanting to save on gas costs. |


---

In the next section, we will dive deeper into encryption, re-encryption, and decryption processes, including how they interact with the KMS and Gateway services. For more details, see [Decrypt and re-encrypt](./d_re_ecrypt_compute.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this link broken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be

docs/fundamentals/first_step/configure.md Outdated Show resolved Hide resolved
docs/guides/error_handling.md Show resolved Hide resolved
docs/tutorials/see-all-tutorials.md Outdated Show resolved Hide resolved
docs/tutorials/see-all-tutorials.md Outdated Show resolved Hide resolved
@immortal-tofu
Copy link
Collaborator

Regarding whitepaper, we agree on keeping the previous whitepaper and adding fhevm-whitepaper-v2.pdf next to it

@poppyseedDev poppyseedDev changed the title Update the docs to fhevm06 docs: update the docs to fhevm06 Nov 25, 2024
- [Quick overview](getting_started/overview.md)
- [Key concepts and features](getting_started/key_concepts.md)
- [Repositories](getting_started/repositories.md)
- [Whitepaper](https://github.com/zama-ai/fhevm/blob/main/fhevm-whitepaper.pdf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove all absolute references for pages/files.

Copy link
Contributor Author

@poppyseedDev poppyseedDev Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUMMARY.md is a bit weird, these are actually relative links, but they are written in such a way, because this represents the sidebar of Gitbook. Gitbook has sometimes some compatibility issues with Markdown, but I think this should work.

@immortal-tofu
Copy link
Collaborator

Run npm run prettier to fix prettier issue (and install prettier in VSCode ;))

@poppyseedDev
Copy link
Contributor Author

@yuxizama ready for your review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants