Skip to content

Commit

Permalink
docs: add celer section
Browse files Browse the repository at this point in the history
  • Loading branch information
rube-de committed Oct 24, 2024
1 parent 1f1f266 commit d83dee8
Show file tree
Hide file tree
Showing 11 changed files with 147 additions and 68 deletions.
2 changes: 1 addition & 1 deletion docs/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The part also covers other ParaTimes such as the non-confidential
]} />

[Oasis Sapphire]: dapp/sapphire/README.mdx
[Oasis Privacy Layer]: dapp/opl/README.md
[Oasis Privacy Layer]: dapp/opl/README.mdx
[Oasis Emerald]: dapp/emerald/README.mdx
[Oasis Cipher]: dapp/emerald/README.mdx

Expand Down
2 changes: 1 addition & 1 deletion docs/dapp/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ParaTimes, you can also add privacy to your existing dApps running on other,
non-confidential chains, and only use Oasis as a *privacy service*.

The Oasis team prepared a rich cross-chain toolkit called the
[**Oasis Privacy Layer**](opl/README.md). It consists of solidity precompiles
[**Oasis Privacy Layer**](opl/README.mdx). It consists of solidity precompiles
integrating bridges and wrapping the OpenZeppelin ERC2771 contract on top of
Sapphire, demonstrates best practices for writing confidential smart contracts
and working examples for you to explore and extend.
Expand Down
Binary file added docs/dapp/images/opl/celer-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/dapp/images/opl/celer-e2e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion docs/dapp/opl/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ to integrate privacy features into their decentralized applications (dApps)
across multiple EVM-compatible networks.

- **Privacy-First**: OPL leverages the [Sapphire]'s privacy features to ensure
that data remains confidential and transactions are encrypted end-to-end.
that contract data and computation remains confidential.
- **Cross-Chain Compatibility**: OPL is compatible with multiple blockchains
through message bridging protocols, making it easy to integrate privacy
regardless of the chain your dApp is built on.
Expand All @@ -33,6 +33,15 @@ keeping their main logic on their primary chain.

![Oasis Privacy Layer diagram](../images/opl/privacy-layer-diagram.png)

:::info

For how to use use signed messages with the GSN to trigger a cross-chain
messages, please visit our [Gasless Transactions chatper].

:::

[Gasless Transactions chatper]: ../sapphire/gasless.md

### Message Bridges

You can integrate message bridges into your dApps using one of these three methods:
Expand Down
135 changes: 72 additions & 63 deletions docs/dapp/opl/celer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,95 @@ description: A message bridge by Celer

# Celer Inter-Chain Messaging (IM)

**Celer Inter-Chain Messaging (IM)** is a message passing protocol that
facilitates the seamless transfer of any type of generic message, including
function calls, across multiple blockchains via a single source-chain
transaction. Celer IM currently supports message passing between Oasis Sapphire
and all other IM-supported chains. The message-passing support enables
developers to build entirely new privacy-centric dApps or add confidentiality
to existing dApps on popular EVM networks using Sapphire as a privacy layer.

## Monitoring
**Celer IM** offers two design patterns:

The Celer IM Scan API can be used to retrieve status and message details by
providing the globally unique transaction ID from the chain which originated the
message.
- Cross-chain logic execution without fund transfer
- Cross-chain logic execution with accompanying fund transfer

https://api.celerscan.com/scan/searchByTxHash?tx=0x...
This documentation focuses on cross-chain logic execution **without** fund
transfer. For information on using Celer IM with fund transfer, please refer
to the [Celer IM documentation].

For details of the response format, see the [Query IM Tx Status] page of the
Celer-IM documentation. Using this API lets you to check if messages have been
delivered.
[Celer IM documentation]: https://im-docs.celer.network/

[Query IM Tx Status]: https://im-docs.celer.network/developer/development-guide/query-im-tx-status
## Architecture

![Celer IM Architecture](../../images/opl/celer-e2e.png)
*Architecture diagram for Celer IM[^1]*

[^1]: The Celer IM architecture diagram is courtesy of [Celer documentation][celer-architecture].

[celer-architecture]: https://im-docs.celer.network/developer/architecture-walkthrough/end-to-end-workflow

Celer IM’s architecture is composed of several core components that work
together to facilitate secure and reliable cross-chain messaging:

- **MessageBus**: The primary component managing message transmission between
source and destination blockchains. It ensures proper formatting and routing
of messages through the Celer network.
- **State Guardian Network (SGN)**: A decentralized network of validators that
manage the state of cross-chain messages. SGN validators sign off on messages
and coordinate their secure delivery, providing security and availability for
cross-chain interactions.
- **[Executor](#executor)**: An off-chain component that listens to the SGN for
validated messages ready for execution on the destination chain. Once a
message is verified, the Executor sends transactions to the MessageBus on the
destination chain, triggering the execution of the specified logic.

## Executor

The Executor is an essential part of the Celer IM framework. The Executor monitors the Celer *State Guardian Network*(SGN) for messages ready to be submitted (with enough validator signatures) and submits the message execution transactions to the MessageBus contract.
The [Executor][Message Executor] is a crucial part of the Celer IM framework.
It performs two main functions:

It is necessary to run a [Message Executor] which monitors the Celer SGN for cross-chain messages and then submits the proof on-chain to deliver them to the target contract.
- Monitors the Celer State Guardian Network (SGN) for messages ready to be
submitted (with sufficient validator signatures).
- Submits message execution transactions to the MessageBus contract.

To set up an executor, you can either follow this [documentation] to set up your own, or fill out this [form][celer-form] for Celer to set up a hosted executor service for you.
It is necessary a [Message Executor] runs for you dapp. To set up an executor,
you have two options

If you are participating in a Hackathon or Grant, [please fill out the relay
request form](https://form.typeform.com/to/RsiUR9Xz) to be allowed to use the
shared Message Executor.
- Follow the [documentation] to set up your own executor.
- Fill out this [form][celer-form] for Celer to set up a hosted executor
service for you.

In most cases, we recommend dApp developers use the shared executor services provided by the Celer Network team so that you do not need to worry about the executor server configuration and operation.
For Hackathon or Grant participants, we recommend filling out the
[relay request form][celer-form] to use the shared Message Executor.

In most cases, Celer advises dApp developers to use the shared executor
services provided by the Celer Network team to avoid server configuration and
operation concerns.

[Message Executor]: https://im-docs.celer.network/developer/development-guide/message-executor
[documentation]: https://im-docs.celer.network/developer/development-guide/message-executor/integration-guide
[celer-form]:https://form.typeform.com/to/RsiUR9Xz

## Supported Networks

### Mainnets

| Name | Int ID | Hex ID | autoswitch name |
| ---- | ------ | ------ | --------------- |
| Ape | 16350 | 0x3fde | ape |
| Arbitrum Nova | 42170 | 0xa4ba | arbitrum-nova |
| Arbitrum One | 42161 | a4b1 | arbitrum-one |
| Astar | 592 | 0x250 | astar |
| Aurora | 1313161554 | 0x4e454152 | aurora |
| Avalanche | 43114 | 0xa86a | avalanche |
| Binance Smart Chain | 56 | 0x38 | bsc |
| Ethereum | 1 | 0x1 | ethereum |
| Fantom | 250 | 0xfa | fantom |
| Filecoin | 314 | 0x13a | filecoin |
| Milkomeda C1 | 2001 | 0x7d1 | milkomeda |
| Moonriver | 1285 | 0x505 | moonriver |
| Polygon | 137 | 0x89 | polygon |
| Sapphire | 23294 | 0x5afe | sapphire |
| Syscoin | 57 | 0x39 | syscoin |
| Polygon zkEVM | 1101 | 0x44d | polygon-zkevm |
| Optimism | 10 | 0xa | optimism |
| zkSync Era | 324 | 0x144 | zksync-era |

### Testnets

| Name | Int ID | Hex ID | autoswitch name |
| ---- | ------ | ------ | --------------- |
| Arbitrum Testnet | 421611 | 0x66eeb | arbitrum-testnet |
| Avalanche C-Chain Fuji Testnet | 43113 | 0xa869 | avalanche-fuji |
| BSC Testnet | 97 | 0x61 | bsc-testnet |
| ConsenSys zkEVM Testnet | 59140 | 0xe704 | zkevm-testnet |
| Dexalot Testnet | 432201 | 0x69849 | dexalot-testnet |
| Fantom Testnet | 4002 | 0xfa2 | fantom-testnet |
| Filecoin Hyperspace Testnet | 3141 | 0xc45 | filecoin-testnet |
| FNCY Testnet | 923018 | 0xe158a | fncy-testnet |
| Godwoken Testnet | 71401 | 0x116e9 | godwoken-testnet |
| Goerli Testnet | 5 | 0x5 | goerli |
| Polygon Mumbai Testnet | 80001 | 0x13881 | polygon-mumbai |
| Polygon zkEVM Testnet | 1442 | 0x5a2 | zkevm-testnet |
| Sapphire Testnet | 23295 | 0x5aff | sapphire-testnet |
| Scroll Alpha Testnet | 534353 | 0x82751 | scroll-testnet |
| Shibuya Testnet | 81 | 0x51 | shibuya-testnet |

In the following sections we will look at a concrete example on how to build a
confidential, cross-chain DAO-voting dApp from scratch using the Oasis Privacy Layer!
## Fees

The cross-chain messaging process involves fees paid to two parties:

- **SGN Fee**: Paid as `msg.value` to the *MessageBus* contract by
the entity calling `sendMessge`.
- **Executor Fee**: Charged by the Executor for submitting execute message
transactions.

## Monitoring

The Celer IM Scan API can be used to retrieve status and message details by
providing the globally unique transaction ID from the chain which originated the
message.

https://api.celerscan.com/scan/searchByTxHash?tx=0x...

For details of the response format, see the [Query IM Tx Status] page of the
Celer-IM documentation. Using this API lets you to check if messages have been
delivered.

[Query IM Tx Status]: https://im-docs.celer.network/developer/development-guide/query-im-tx-status
54 changes: 54 additions & 0 deletions docs/dapp/opl/celer/networks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: Supported networks on Celer IM
---

# Supported Networks

## Mainnets

| Name | Int ID | Hex ID | autoswitch name |
| ---- | ------ | ------ | --------------- |
| Ape | 16350 | 0x3fde | ape |
| Arbitrum Nova | 42170 | 0xa4ba | arbitrum-nova |
| Arbitrum One | 42161 | a4b1 | arbitrum-one |
| Astar | 592 | 0x250 | astar |
| Aurora | 1313161554 | 0x4e454152 | aurora |
| Avalanche | 43114 | 0xa86a | avalanche |
| Binance Smart Chain | 56 | 0x38 | bsc |
| Ethereum | 1 | 0x1 | ethereum |
| Fantom | 250 | 0xfa | fantom |
| Filecoin | 314 | 0x13a | filecoin |
| Milkomeda C1 | 2001 | 0x7d1 | milkomeda |
| Moonriver | 1285 | 0x505 | moonriver |
| Polygon | 137 | 0x89 | polygon |
| Sapphire | 23294 | 0x5afe | sapphire |
| Syscoin | 57 | 0x39 | syscoin |
| Polygon zkEVM | 1101 | 0x44d | polygon-zkevm |
| Optimism | 10 | 0xa | optimism |
| zkSync Era | 324 | 0x144 | zksync-era |

## Testnets

| Name | Int ID | Hex ID | autoswitch name |
| ---- | ------ | ------ | --------------- |
| Arbitrum Testnet | 421611 | 0x66eeb | arbitrum-testnet |
| Avalanche C-Chain Fuji Testnet | 43113 | 0xa869 | avalanche-fuji |
| BSC Testnet | 97 | 0x61 | bsc-testnet |
| ConsenSys zkEVM Testnet | 59140 | 0xe704 | zkevm-testnet |
| Dexalot Testnet | 432201 | 0x69849 | dexalot-testnet |
| Fantom Testnet | 4002 | 0xfa2 | fantom-testnet |
| Filecoin Hyperspace Testnet | 3141 | 0xc45 | filecoin-testnet |
| FNCY Testnet | 923018 | 0xe158a | fncy-testnet |
| Godwoken Testnet | 71401 | 0x116e9 | godwoken-testnet |
| Goerli Testnet | 5 | 0x5 | goerli |
| Polygon Mumbai Testnet | 80001 | 0x13881 | polygon-mumbai |
| Polygon zkEVM Testnet | 1442 | 0x5a2 | zkevm-testnet |
| Sapphire Testnet | 23295 | 0x5aff | sapphire-testnet |
| Scroll Alpha Testnet | 534353 | 0x82751 | scroll-testnet |
| Shibuya Testnet | 81 | 0x51 | shibuya-testnet |

In the following sections we will look at a concrete example on how to build a
confidential, cross-chain DAO-voting dApp from scratch using the Oasis Privacy Layer!



5 changes: 5 additions & 0 deletions docs/dapp/opl/celer/pingpong-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: PingPong example with Celer IM
---

# Ping Pong Example
2 changes: 1 addition & 1 deletion docs/dapp/opl/opl-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ contract SapphireContract is Enclave {
}
```

### Host Contract
### Home Contract

On the other chain, define your contract which can be called via
`triggerExample` to send a message to the contract on Sapphire using the
Expand Down
2 changes: 1 addition & 1 deletion docs/dapp/opl/router-protocol/pingpong-example.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Router Protocol PingPong example
description: Protocol PingPong example with Router CrossTalk
---

# PingPong Example
Expand Down
2 changes: 2 additions & 0 deletions sidebarDapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const sidebarDapp: SidebarsConfig = {
id: 'dapp/opl/celer/README',
},
items: [
'dapp/opl/celer/networks',
'dapp/opl/celer/pingpong-example',
],
},
{
Expand Down

0 comments on commit d83dee8

Please sign in to comment.