Skip to content

Commit

Permalink
Update earlyWin.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoshiya authored Jun 1, 2024
1 parent a168949 commit a2b3d87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/tutorial/earlyWin.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ displayed_sidebar: tutorialSidebar

In this short guide we’ll encrypt plaintext to ciphertext using FHE, demonstrating how simple it is to enable confidentiality in your smart contracts with Fhenix.

1. Define a view function in your contract. For example, to retrieve sensitive data:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
Expand Down Expand Up @@ -44,3 +42,7 @@ In this short guide we’ll encrypt plaintext to ciphertext using FHE, demonstra

First, FHE is imported directly into your contract with a single line of code. Next we establish two numbers or unsigned integers, withhowever the _cipherText number beingwill be encrypted. This means that it will not be publicly accessible from anyone other than the intended viewer. The standard _plaintext unit8 represents a number that is public for all to view. On line 11 we have a setter function that allows us to pass in a new encrypted number that will stay private. On line 21 we have a decrypt function that allows us to view the number that was written to state in the setCipherText function. As you can see there is no requirement for off-chain proof generation or storage.

```solidity
import "@fhenixprotocol/contracts/FHE.sol";
```
We are able to import the FHE precompiles directly into the smart contract with a single line of code. The power of FHE in one single line of copy pasta.

0 comments on commit a2b3d87

Please sign in to comment.