Skip to content

Commit 49427fc

Browse files
authored
Merge branch 'main' into main
2 parents 2e43991 + d379de3 commit 49427fc

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

docs/devdocs/Examples and References/Examples-fheDapps.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ Here you can find a list of some of cool apps that you can use as a reference
3939
<td>This examples will need to be updated when using Fhenix's FHE.sol</td>
4040
</tr>
4141
<tr>
42-
<td>Private Voting</td>
43-
<td><a href="https://www.fhenix.io">TO BE ADDED</a></td>
42+
<td>Confidential Voting</td>
43+
<td><a href="https://github.com/FhenixProtocol/confidential-voting">https://github.com/FhenixProtocol/confidential-voting</a></td>
44+
<td></td>
4445
<td></td>
4546
</tr>
4647
<tr>
@@ -55,4 +56,3 @@ Here you can find a list of some of cool apps that you can use as a reference
5556
</tr>
5657
</tbody>
5758
</table>
58-

docs/devdocs/Solidity API/Utilities.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#### Encrypted Address
44

5-
Encrypting address is not an easy task as we currently only support encrypted uint32s (4 bytes) and address are formed out of 20 bytes.
5+
Encrypting an address is not an easy task as we currently only support encrypted uint32s (4 bytes) and address are formed out of 20 bytes.
66
We created a tool that implements `Eaddress` which is formed by 5 uint32s.
77
This utility allows you to do some operations on encrypted addresses.
88
The tool can be imported from: TBD
@@ -11,10 +11,10 @@ An example of how to use the tool can be found it: TBD
1111
#### Random Number
1212

1313
Confidentiality is a crucial step in order to achieve on-chain randomness. Fhenix, as a chain that implements confidentiality, is a great space to implement and use on-chain random numbers and this is part of our roadmap.
14-
We know that there are some #BUIDLers that are planning to implement dapps that leverage both confidentiality and random numbers so until we will have on-chain true random we are suggesting to use the following implementation as a MOCKUP.
14+
We know that there are some #BUIDLers that are planning to implement dapps that leverage both confidentiality and random numbers so until we will have on-chain true random, we are suggesting to use the following implementation as a MOCKUP.
1515
PLEASE NOTE THAT THIS RANDOM NUMBER IS VERY PREDICTABLE AND CAN'T BE REALLY TRUSTED
1616

17-
```javascript
17+
```solidity
1818
library RandomMock {
1919
function getFakeRandom() internal returns (uint256) {
2020
uint blockNumber = block.number;

docs/devdocs/Tips/Useful-Tips.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ When we are using `FHE.asEuint*(PLAINTEXT_NUMBER)` we are actually using a trivi
88

99
#### Default Value of a Euint
1010

11-
When having a `euint*` variable uninitialized it will be considered as 0. Every FHE function that will receive an unitialized euint* will assume it is `FHE.asEuint*(0)`.
12-
You can assume now that `FHE.asEuint*(0)`is quite oftenly used - Luckily we realized this and decided to have the values of`FHE.asEuint*(0)`pre-calculated on node initialization so when you use`FHE.asEuint\*(0)` we will just return those values.
11+
When having a `euint*` variable uninitialized it will be considered as 0. Every FHE function that will receive an uninitialized euint* will assume it is `FHE.asEuint*(0)`.
12+
You can assume now that `FHE.asEuint*(0)`is used quite often - Luckily we realized this and decided to have the values of`FHE.asEuint*(0)`pre-calculated on node initialization so when you use`FHE.asEuint\*(0)` we will just return those values.
1313

1414
#### Re-encrypting a Value
1515

1616
To explain this tip we will use an example. Let's assume we want to develop a confidential voting and let's say we have 4 candidates.
1717
Assuming that on each vote we increase (cryptographically with FHE.add) the tally, one can just monitor the key in the DB that represents this specific tally and once the key was changes he will know who we voted for.
1818
An ideal solution for this issue is to change all keys no matter who we voted for, but how?!
19-
In order to understand how we will first need to understand that FHE encryption is a non-determenisitic encryption means that encrypting (non-trivial encryption) a number twice will result with 2 different encrypted outputs.
19+
20+
In order to understand how we will first need to understand that FHE encryption is a non-deterministic encryption means that encrypting (non-trivial encryption) a number twice will result with 2 different encrypted outputs.
21+
2022
Now that we know that, we can add 0 (cryptographically with FHE.add) to all of those tallies that shouldn't be changed and they will be changed in the DB!
2123

2224
#### FHE.req() in TXs
@@ -25,7 +27,8 @@ All of the operations are supported both in TXs and in Queries. That being said
2527

2628
#### Performance and Gas Usage
2729

28-
Currently we are supporting a lot of FHE operations. Some of them might take a lot of time to compute, some good examples are: Div (5 seconds for euint32), Mul, Rem, and the time will grow depends on the value types you are using.
30+
Currently we support many FHE operations. Some of them might take a lot of time to compute, some good examples are: Div (5 seconds for euint32), Mul, Rem, and the time will grow depends on the value types you are using.
31+
2932
When writing FHE code we encourage you to use the operations wisely and choose what operation should be used.
3033
Example: Instead of `FHE.mul(ENCRYPTED_UINT_32, FHE.asEuint32(2))` you can use `FHE.shl(ENCRYPTED_UINT_32, FHE.asEuint32(1))` in some cases `FHE.div(ENCRYPTED_UINT_32, FHE.asEuint32(2))` can be replaced by `FHE.shr(ENCRYPTED_UINT_32, FHE.asEuint32(1))`
3134

docs/devdocs/Tools and Utilities/Fhenix-Remix-Plugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ After deploying the contract (The plugin is only aware of contracts that are dep
1515
* Interact with the contract - On contract interaction you should use the values that were encrypted by the plugin for encrypted inputs. For contracts that are returning an output of a sealOutput function, the plugin will already generate a public address and it will decrypt the output for you.
1616

1717
#### Known Issues
18-
* Sometimes the plugin isn't using the correct permit - You should open the `Permit Management` tab and choose another permit and then rechoose the right permit
18+
* Sometimes the plugin isn't using the correct permit - You should open the `Permit Management` tab and choose another permit and then re-choose the right permit
1919
* Sometimes the "Encrypt" button remains unclickable - You can right click on the frame and choose `Reload frame`
2020
* On contract interaction when the contract receives a public key the plugin generate public key which starts with `0x0x` - Remove one of them

docs/devdocs/Writing Smart Contracts/Permissions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To utilize the `Permissioned` contract, you would inherit it in your own contrac
1818

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

21-
```javascript
21+
```solidity
2222
function getSensitiveData(Permission calldata perm) public view onlySender(perm) returns (string memory) {
2323
// Logic to return sensitive data
2424
}

docs/devdocs/Writing Smart Contracts/Returning-Data.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ There are two ways to return encrypted data to the user:
2727

2828
### Sealed Box Encryption
2929

30-
```Javascript
30+
```solidity
3131
import {FHE} from "@fhenixprotocol/contracts";
3232
3333
function sealoutputExample(bytes32 pubkey) public pure returns (bytes memory reencrypted) {

docs/devdocs/Writing Smart Contracts/booleans.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ description: Comparisons on FHE data
99
## Comparisons
1010

1111
Unlike other operations in FHE.sol, comparison operations do not support their respective operators (e.g. `>`, `<` etc.).
12-
This is because solidity expects these operators to return a boolean value, which is not possible with FHE. Intuitively, this is because returning a boolean value would leak information about the encrypted data.
12+
This is because solidity expects these operators to return a boolean value, which is not possible with FHE.
13+
Intuitively, this is because returning a boolean value would leak information about the encrypted data.
1314

1415
Instead, comparison operations are implemented as functions that return an `ebool` type.
1516

0 commit comments

Comments
 (0)