Skip to content

Commit

Permalink
Update Use Cases (#26)
Browse files Browse the repository at this point in the history
* Update Usecases

* update xacount

* xdao

* order xclearing part.1

* change the usecase from helix bridge v2 to v3

* update

* update

* update

* update

---------

Co-authored-by: fisher <[email protected]>
  • Loading branch information
hackfisher and fisher authored Apr 12, 2024
1 parent 2d08da9 commit d461426
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 46 deletions.
3 changes: 0 additions & 3 deletions docs/msgport/user-cases/abstract-account.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/msgport/user-cases/multichain-dao-governance.md

This file was deleted.

25 changes: 25 additions & 0 deletions docs/msgport/user-cases/order-xclearing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Order XClearing

Many use cases involve order clearing, such as order book DEXs, swap DEXs, equivalent swap, NFT markets, and more. These use cases can all be extended to cross-chain scenarios. Helix Bridge is one such example. It is a third-party token bridge that allows users to perform cross-chain swaps with liquidity relayers, serving as permissionless order takers and makers, essentially facilitating order based cross-chain equivalent swap.

For example, [Helix Bridge](https://helixbridge.app/) leverages [Msgport](../overview.md) to do settements after users taking orders of liquidity relayer. Msgport can deliver messages indicating that whether liquidity relayer fullfill user's order successfullly or not, where truth of messages are verified by the underlining message protocols Msgport are integrating.

!!! Quote
The advantage of using `Msgport` is that it is very easy to switch between different low-level message layers without making big changes to the code. — Helix Bridge

## Helix Bridge Introduction

Compared to [xToken bridge](./xtoken.md), Helix Bridge stands out for its exceptionally low cross-chain fees, enabled by its capacity for batch clearing through Msgport after accumulating several orders.

The Helix Bridge protocol introduces a permissionless system for liquidity relayers to place orders. When users swap tokens between two chains, they select an order from a liquidity relayer offering favorable terms, including fees and transfer limits. The tokens are then sent to the Helix Bridge contract, where they await being fullfilled by relayer on target chain. Upon detecting a swap event, the liquidity relayer's node initiates the transfer of an equivalent amount of tokens to the user on the target chain, using a clearing contract that records the order match. To clear and withdraw funds from the source chain, the liquidity relayer merely needs to send a message through Msgport from the target chain to clear their matched orders.

Should a liquidity relayer fail to fulfill the order promptly, a "slasher" can step in to complete the order. This action is recorded in the clearing contracts. Slashers can trigger a claim against the liquidity relayer's penalty reserve by sending penalty-related clearing messages. Settlement occurs when the liquidity relayer attempts to withdraw from the penalty reserve, also through a message-sending process.

![msgport-token-bridge-1](../../images/msgport-token-bridge-1.png)

## Summary
Msgport plays a pivotal role in Helix Bridge by enabling efficient batch clearing and communication for liquidity relayers, leading to significantly reduced cross-chain fees. It allows for the seamless execution of orders and the swift resolution of disputes through the intervention of "slashers" when orders are not fulfilled as expected. Beyond token swaps, the flexibility and efficiency of Msgport can be extended to a wide range of use cases in cross chain orders senarios.

## Reference

1. https://docs.helixbridge.app/helixbridge/liquidity_node_v3
19 changes: 18 additions & 1 deletion docs/msgport/user-cases/overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Overview

Welcome to the Darwinia msgport user cases chapter! This chapter aims to guide you through cross-chain capabilities by integrating Darwinia services. It covers various use cases like bridging, abstract accounts, and DAO governance. We encourage your contributions and welcome your proposals. Let's explore the possibilities together!
Welcome to the Msgport Use Cases Chapter! This section is meticulously crafted to guide you through the multifaceted realm of cross-chain functionalities unlocked by integrating Msgport services.

When discussing use cases in the context of cross-chain technologies, the prefix "X" or "x" is often used to denote "cross-chain" aspects of a feature or tool. This nomenclature helps in quickly identifying functionalities that are designed to work across different blockchain networks, facilitating interoperability and seamless integration.

As we explore this area, we'll look into different scenarios that highlight the capabilities of cross-chain technology, among others:

- [Order XClearing](./order-xclearing.md):
Helix Bridge is a third-party token bridge designed to facilitate cross-chain swaps between users and liquidity relayers, operating on a permissionless basis for both order takers and makers. Through the integration of Msgport, Helix Bridge enhances its cross-chain clearing capabilities, ensuring efficient and seamless cross chain transactions for all participants involved.

- [XToken](./order-xclearing.md): XToken is a cross-chain token issuance and mapping tool.

- [XAccount](./xaccount.md): Exploring the concept of cross-chain accounts and their significance in a decentralized environment.

- [XDAO](./xdao.md): An examination of decentralized autonomous organizations operating across multiple chains, fostering a new era of governance.

Each topic is designed to expand your knowledge and inspire innovation in the cross-chain space. We highly value your insights and contributions and warmly invite you to propose additional use cases for inclusion. Together, let's embark on a journey to explore the vast potential and unlock new possibilities in the world of cross-chain technology!

Your proposals and contributions are the keystones that enrich this guide. Let's explore the possibilities together and chart new territories in the cross-chain universe!
36 changes: 0 additions & 36 deletions docs/msgport/user-cases/token-bridge.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/msgport/user-cases/xaccount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# XAccount

XAccount, representing Cross-Chain Abstract Account, embodies a pioneering approach to account abstraction at the cross-chain level. This innovative concept introduces the creation of a counterpart account on the target chain for an existing account on the source chain, which remains under the exclusive control of the original address on the source chain.

The XAccount DApp significantly simplifies and enhances the user experience by adopting this design of cross-chain abstract accounts. As a refined iteration of Msgport’s cross-chain functionalities, XAccount is meticulously crafted to streamline the process for users involved in cross-chain transactions, making it more accessible and user-friendly.

The user interface for the XAccount DApp will be available shortly. In the meantime, you can get a preview of the XAccount design through its [protocol implementation and contracts](https://github.com/darwinia-network/darwinia-msgport/tree/main/src/xAccount). It is also seamlessly integrated with the [Safe Modules](https://docs.safe.global/advanced/smart-account-modules), developed on the most secure abstract account framework.
7 changes: 7 additions & 0 deletions docs/msgport/user-cases/xdao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# XDAO

XDAO represents Multi-Chain DAO Governance, with DAO standing for Decentralized Autonomous Organizations. Msgport empowers DAOs to establish unified governance mechanisms across multiple chains.

Organizations like Uniswap, which may operate DApps across several chains, find their governance tokens distributed across different blockchains. Typically, a DAO conducts voting with its governance token on a single chain, making decisions on proposals that, once approved, are to be implemented across other chains. This scenario presents two main challenges: firstly, enabling governance tokens on other chains to participate in the voting, and secondly, implementing proposals across these diverse chains.

To tackle the first challenge, the DAO's governor contract within voting systems (e.g. [Tally](https://www.tally.xyz/explore)) can be modified to enable cross-chain delegation or the configuration of votes via Msgport. As for the second challenge, proposals can be executed on different chains by creating and utilizing an [xAccount](./xaccount.md). This approach significantly simplifies decision-making and coordination for DAOs, eliminating the complexity of managing operations on multiple chains independently.
15 changes: 15 additions & 0 deletions docs/msgport/user-cases/xtoken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#XToken

XToken is a cross-chain token issuance and mapping tool. It can be used by issuers on the source/target chains to deploy and construct cross-chain bridge mappings for tokens. Additionally, it serves as a tool for custodian issuers to deploy Custodian DApps, enabling users to cross-chain the mapped tokens supported by that DApp.

Msgport can be utilized by XToken to facilitate cross-chain issuance after the original token has been locked on the source chain, or to carry out cross-chain unlocking after the xToken has been burned on the target chain.

References:

1. [XToken](https://xtoken.helixbridge.app/)

2. [XToken Docs](https://docs.helixbridge.app/helixbridge/mapping_token)

3. [XToken Contracts](https://github.com/helix-bridge/contracts/tree/master/helix-contract/contracts/xtoken)

4. [XToken Monorepo](https://github.com/helix-bridge/xtoken-monorepo)
7 changes: 4 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ nav:
- Supported Network: 'msgport/networks.md'
- User Cases:
- Overview: 'msgport/user-cases/overview.md'
- Token/Asset Bridge: 'msgport/user-cases/token-bridge.md'
- Cross Chain Abstract Account: 'msgport/user-cases/abstract-account.md'
- Multi Chains DAO Governance: 'msgport/user-cases/multichain-dao-governance.md'
- Order XClearing: 'msgport/user-cases/order-xclearing.md'
- XToken: 'msgport/user-cases/xtoken.md'
- XAccount: 'msgport/user-cases/xaccount.md'
- XDAO: 'msgport/user-cases/xdao.md'
- Tutorial:
- Pangolin > Sepolia Remix Demo: 'msgport/tutorial/remix-demo.md'
- Pangolin > Sepolia Script Demo: 'msgport/tutorial/script-demo.md'
Expand Down

0 comments on commit d461426

Please sign in to comment.