Skip to content

Commit

Permalink
Merge branch 'nitrogen' into find-and-replace-helium-nitrogen
Browse files Browse the repository at this point in the history
  • Loading branch information
toml01 authored Oct 28, 2024
2 parents c1c5820 + 1d0821e commit 7f71723
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 72 deletions.
13 changes: 6 additions & 7 deletions docs/devdocs/Fhenix Testnet/Connecting-To.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 3

Fhenix Nitrogen is the first publicly available FHE-based blockchain, and it is now live! Follow the instructions to connect to Fhenix Nitrogen Testnet.

## Configuring MetaMask
## Configuring MetaMask

1. Open MetaMask in your browser and click on the Ethereum network.
2. Click **Add Network.**
Expand All @@ -15,13 +15,12 @@ Fhenix Nitrogen is the first publicly available FHE-based blockchain, and it is
4. Fill out the network details form. To add a custom network, fill in the following fields:
1. **Network Name: Fhenix Nitrogen**
2. **New RPC URL: https://api.nitrogen.fhenix.zone**
3. **Chain ID:** 8008135
4. **Currency Symbol: tFHE**
3. **Chain ID:** 8008148
4. **Currency Symbol: FHE**
5. **Block Explorer URL: https://explorer.nitrogen.fhenix.zone**
5. Once you fill out all the details, click **Save**.
6. Now you are ready to switch to Fhenix Nitrogen Testnet. Tokens are available from the testnet faucet. Start building!


## API endpoints

<table>
Expand All @@ -38,7 +37,7 @@ Fhenix Nitrogen is the first publicly available FHE-based blockchain, and it is
</tr>
<tr>
<td>Chain ID</td>
<td>8008135</td>
<td>8008148</td>
</tr>
<tr>
<td>Websocket</td>
Expand All @@ -49,7 +48,7 @@ Fhenix Nitrogen is the first publicly available FHE-based blockchain, and it is

## Explorer

* [https://explorer.nitrogen.fhenix.zone](https://explorer.nitrogen.fhenix.zone)
- [https://explorer.nitrogen.fhenix.zone](https://explorer.nitrogen.fhenix.zone)

## Faucet

Expand All @@ -61,4 +60,4 @@ You may receive 0.1 tokens once every five minutes. If you need more tokens, ple
The Nitrogen testnet is connected to the Sepolia testnet. You can use the bridge to move tokens between the two networks.
If you require more tokens, you can use the bridge to move tokens from Sepolia to Nitrogen.

* [https://bridge.nitrogen.fhenix.zone/](https://bridge.nitrogen.fhenix.zone/)
- [https://bridge.nitrogen.fhenix.zone/](https://bridge.nitrogen.fhenix.zone/)
29 changes: 16 additions & 13 deletions docs/devdocs/Fhenix Testnet/Details/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ title: 🆕 Changelog

Here you can find a list of changes between different versions of the Fhenix Testnet(s) as we evolve and grow.

### Nitrogen

### Nitrogen - Latest Version
TBD

* Added `eaddress` as a native type that can be found in FHE.sol directly
* Added support for large integer sizes: `euint64`, `euint128`, `euint256`. Not all operations are supported for each type
at this time. See [Types and Operators](../../Writing%20Smart%20Contracts/Types-and-Operators.md) for more information.
* Added support for solidity compiler version 0.8.25 and up
* Performance has been greatly increased for all data types
* Performance has been greatly increased for select operations
* All client-side libraries and toolkits have been upgraded and will require an update to version 0.2 to work with Nitrogen - FhenixJS, Remix plugin & hardhat plugins.
* Refactored gas prices for FHE operations to better reflect the operational cost of the operation. See [Gas and Benchmarks](../../Writing%20Smart%20Contracts/Gas-and-Benchmarks.md) for more information.
* Blocks are now posted to the Sepolia Testnet with support for EIP-4844 blobs.
* Refactored gas cost for transaction data to be more in line with Ethereum.
* LocalFhenix - Added support for `Console.log` functionality to allow debug logs during contract execution.
* Many bug fixes and other improvements.
### Helium

- Added `eaddress` as a native type that can be found in FHE.sol directly
- Added support for large integer sizes: `euint64`, `euint128`, `euint256`. Not all operations are supported for each type
at this time. See [Types and Operators](../../Writing%20Smart%20Contracts/Types-and-Operators.md) for more information.
- Added support for solidity compiler version 0.8.25 and up
- Performance has been greatly increased for all data types
- Performance has been greatly increased for select operations
- All client-side libraries and toolkits have been upgraded and will require an update to version 0.2 to work with Helium - FhenixJS, Remix plugin & hardhat plugins.
- Refactored gas prices for FHE operations to better reflect the operational cost of the operation. See [Gas and Benchmarks](../../Writing%20Smart%20Contracts/Gas-and-Benchmarks.md) for more information.
- Blocks are now posted to the Sepolia Testnet with support for EIP-4844 blobs.
- Refactored gas cost for transaction data to be more in line with Ethereum.
- LocalFhenix - Added support for `Console.log` functionality to allow debug logs during contract execution.
- Many bug fixes and other improvements.

### Frontier

Expand Down
4 changes: 2 additions & 2 deletions docs/devdocs/Fhenix Testnet/Fhenix-T-FHE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ To read more about different FHE schemes, see our [FHE Overview Section](./FHE-O

## Fhenix Nitrogen Testnet

The current Fhenix Nitrogen Testnet is the first public iteration of the Fhenix protocol. It is still an early build, and it has bugs (unfortunately) and many features that are still under development.
The current Fhenix Nitrogen Testnet is the second public iteration of the Fhenix protocol. It is still an early build, and it can potentialy has bugs (unfortunately) and there are still features that are still under development.

There are many challenges ahead and many problems to solve. However, we are excited to be working on this project, because it is potentially an innovative and disruptive technology in the blockchain space.
There are still challenges ahead. However, we are excited to be working on this project, because it is potentially an innovative and disruptive technology in the blockchain space.

What we write here is not set in stone. We are still considering the best way to move forward, and we are excited to have you here with us as we embark on this journey. Please let us know if you have any suggestions, ideas or comments. Feedback is always welcome. We are looking for ways to improve and for people to join us and contribute.
6 changes: 2 additions & 4 deletions docs/devdocs/Fhenix Testnet/Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please refer to the [Arbitrum documentation](https://docs.arbitrum.io/build-dece

### EVM Compatibility

Fhenix is fully EVM compatible, up to and including the Cancun Upgrade.
Fhenix is fully EVM compatible, up to and including the Cancun Upgrade.
This means that any contract that runs on Ethereum should run on Fhenix as well. We support Solidity compiler 0.8.26.

### Public Endpoints
Expand All @@ -37,7 +37,7 @@ We have public endpoints available for the Nitrogen Testnet, which can be used:
</tr>
<tr>
<td>Chain ID</td>
<td>8008135</td>
<td>8008148</td>
</tr>
<tr>
<td>Websocket</td>
Expand Down Expand Up @@ -78,5 +78,3 @@ The following contracts are deployed on Ethereum Sepolia and may be used by deve
</td>
</tr>
</table>


37 changes: 15 additions & 22 deletions docs/devdocs/FhenixJS/Fhenix-JS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,23 @@ sidebar_position: 1
title: Installation & Basics
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## Installation

To get started with fhenix.js, you need to install it as a dependency in your JavaScript project. You can do this using npm (Node Package Manager) or Yarn. Open your terminal and navigate to your project's directory, then run the following:


<Tabs>
<TabItem value="yarn" label="yarn">
```bash
yarn add fhenixjs
```
</TabItem>
<TabItem value="npm" label="npm">
```
npm install fhenixjs
```
</TabItem>
<TabItem value="pnpm" label="pnpm">
```
pnpm add fhenixjs
```
</TabItem>
<TabItem value="yarn" label="yarn">
```bash yarn add fhenixjs ```
</TabItem>
<TabItem value="npm" label="npm">
``` npm install fhenixjs ```
</TabItem>
<TabItem value="pnpm" label="pnpm">
``` pnpm add fhenixjs ```
</TabItem>
</Tabs>

## Usage
Expand All @@ -35,14 +28,14 @@ When initializing a new Fhenix Client we need to inject it with a provider - thi
ethers, hardhat, web3js, etc.

```javascript
import { FhenixClient } from 'fhenixjs';
import { JsonRpcProvider } from 'ethers';
import { FhenixClient } from "fhenixjs";
import { JsonRpcProvider } from "ethers";

// initialize your web3 provider
const provider = new JsonRpcProvider('https://api.nitrogen.fhenix.zone');
const provider = new JsonRpcProvider("https://api.nitrogen.fhenix.zone");

// initialize Fhenix Client
const client = new FhenixClient({provider});
const client = new FhenixClient({ provider });

// to encrypt data for a Fhenix contract
let encrypted = await client.encrypt(5, EncryptionTypes.uint8);
Expand Down
7 changes: 3 additions & 4 deletions docs/devdocs/FhenixJS/Network Keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
sidebar_position: 5
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

#### Network Encryption Key

Each Fhenix instance uses its own Encryption Key. This key is special, and allows users to encrypt their data in such a way that will match the encryption of all the other data on the network.

:::note[**Did You Know?**]
The public key we refer to here is a _**global key**_ that is used to encrypt data being sent to the network. It is not the same as the _transactional public key_ that is used by fhenix.js to unseal data!
The public key we refer to here is a _**global key**_ that is used to encrypt data being sent to the network. It is not the same as the _transactional public key_ that is used by fhenix.js to unseal data!
:::

If you're using fhenix.js you don't need to worry about this, as the public key fetching is already done automatically by the library.
Expand Down
4 changes: 2 additions & 2 deletions docs/devdocs/Setting Up Your Environment/Foundry.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 🛠️ Foundry

This tool will allow you to simulate development on the Fhenix network including Solidity native testing.
The tool uses Foundry Cheatcodes to represent the execution of our Fhenix native precompiles.
Please be aware that the operations performed by using this template only simulate the behavior of real FHE operations, and will probably not be a good representation of performance, gas, etc.
The tool uses Foundry Cheatcodes to represent the execution of our Fhenix native precompiles.
Please be aware that the operations performed by using this template only simulate the behavior of real FHE operations, and will probably not be a good representation of performance, gas, etc.

The code is pretty new, and may contain bugs or edge-cases that we have not tested, so your feedback is very important for us! If you have any issues, comments or requests please open an issue
in the Fhenix Foundry Template [Repository](https://github.com/FhenixProtocol/fhenix-foundry-template).
Expand Down
1 change: 0 additions & 1 deletion docs/devdocs/Setting Up Your Environment/Remix.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ To get up and running with Remix, you should follow a few easy steps:
2. Import `FHE.sol` from your contract
3. Optionally, use the Fhenix Remix Plugin to make your life a bit easier


## 1. Add Fhenix to Metamask

Follow the instructions in the [Fhenix Nitrogen Testnet](../Fhenix%20Testnet/Connecting-To.md) to add Fhenix to Metamask.
Expand Down
16 changes: 8 additions & 8 deletions docs/devdocs/Tools and Utilities/Fhenix-Hardhat-Plugin.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 👷 Fhenix Hardhat Plugin
# 👷 Fhenix Hardhat Plugin

Fhenix Hardhat Plugin is designed to extend your Hardhat environment with additional capabilities focused on Fhenix. It integrates seamlessly with your Hardhat projects to provide a local Fhenix environment, including customized network configuration and utilities for managing funds and permits within your blockchain applications.

Expand Down Expand Up @@ -48,20 +48,20 @@ import "fhenix-hardhat-docker";

The plugin automatically adds a `localfhenix` network configuration to your Hardhat project. This configuration is designed for local development and includes settings such as gas estimates, accounts, and the local network URL.

This network is chosen as the default once the plugin is imported.
This network is chosen as the default once the plugin is imported.
If you want to use a different network, simply add `--network <custom_network>` to your hardhat commands, or set it as the default.

If you want to use Fhenix Nitrogen Testnet (or a custom Fhenix network), you can add a new network configuration to your `hardhat.config.js` file:

```typescript
const config: HardhatUserConfig = {
networks: {
fhenixNitrogen: {
url: "https://api.nitrogen.fhenix.zone",
chainId: 8008135,
accounts: mnemonic,
},
networks: {
fhenixNitrogen: {
url: "https://api.nitrogen.fhenix.zone",
chainId: 8008148,
accounts: mnemonic,
},
},
};

export default config;
Expand Down
13 changes: 5 additions & 8 deletions docs/devdocs/Tools and Utilities/Fhenix-Remix-Plugin.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🎧 Fhenix Remix Plugin

Fhenix created a plugin to ease the interaction with the contracts.
Fhenix created a plugin to ease the interaction with the contracts.

#### Adding the Plugin

Expand All @@ -11,26 +11,23 @@ Set the `Plugin Name` value to be `Fhenix` and the `URL` value to be `https://re

#### Key Features

* 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.
* Encrypt numbers
* Show permit information of a contract (to manually interact with it)

- 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.
- Encrypt numbers
- Show permit information of a contract (to manually interact with it)

#### Using the Plugin

After deploying a contract (the plugin is only aware of contracts that are deployed while it is active), MetaMask will request that you sign a message. This message is a permit that allows you to interact with the contract from the plugin.
After the message is signed, the contract will be saved to the list.
After the message is signed, the contract will be saved to the list.

![](/img/interact-info-1.webp)


1. Select the contract you wish to interact with.
2. Remove the selected contract from the list
3. Click to encrypt a number - If the field has a defined type (inEuint8, inEuint16, or inEuint32), it will automatically encrypt it correctly. If the field is of a generic bytes type, you will be prompted to select the required encryption.
4. Autofilled "permission" type - The field detects the unique type and fills it for you based on the created permit.
5. Autofilled "publicKey" - If a publicKey field is detected, it will be auto-filled with the public key from the permit.


#### Additional Tools

![](/img/tools-info.webp)
Expand Down
2 changes: 1 addition & 1 deletion docs/devdocs/Tutorials/Basic/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We'll be making use of the FHE library and Fhenix Nitrogen Testnet to enable thi

You can find all the completed code in our [example project repository](https://github.com/FhenixProtocol/erc20-tutorial-code). You can just skip there if you just want to see the final code.

[//]: # (This example focuses on Javascript. If you're more of a python fan, check out the workshop available here: [https://github.com/zama-ai/ethcc23-workshop]&#40;https://github.com/zama-ai/ethcc23-workshop&#41;)
[//]: # "This example focuses on Javascript. If you're more of a python fan, check out the workshop available here: [https://github.com/zama-ai/ethcc23-workshop](https://github.com/zama-ai/ethcc23-workshop)"

## What We'll Be Building

Expand Down

0 comments on commit 7f71723

Please sign in to comment.