# Abstraction

Although all General Message Passing (GMP) protocols are designed to enable the exchange of cross-chain messages, each one features its own unique interface and interaction mechanism. Significant variations exist primarily in terms of:

* Interface: Different function names, parameter number and format
* Security: Requirement of pre-approvement of the destination address
* Identification: Arbitrary chain Codification (chainId)
* Payment: Native or ERC20 acceptance, exact amount or overpay/refund approaches
* Interaction: Payment or price quoting in advance

In the following example source and destination contracts are interacting with a GMP that:

* Requires a separated payment function with refund
* Uses string format for the message payload
* Uses an arbitrary vendor defined chain ID
* Requires to implement a specific reception interface

![](https://1192098899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCWTn4UpXpsFVDR7MJXv%2Fuploads%2Fgit-blob-9cff918179deda5ef3249171aff0eaffb837cdc3%2FInteraction%20with%20GMP%20A%20Example.png?alt=media)

In this other example source and destination contracts are interacting with a GMP that:

* Requires an initial query for the current operation price
* Uses byte array format for the message payload
* Uses an arbitrary vendor defined chain ID
* Requires to implement a specific reception interface

![](https://1192098899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCWTn4UpXpsFVDR7MJXv%2Fuploads%2Fgit-blob-9c727ce6f1e46fe54789b1023093de3f9646ca57%2FInteraction%20with%20GMP%20B%20Example.png?alt=media)

These variations can be specifically challenging when trying to work with more than one GMP:

![](https://1192098899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCWTn4UpXpsFVDR7MJXv%2Fuploads%2Fgit-blob-925641ae3886520a7222767476fe88c9393db717%2FInteraction%20with%20multiple%20GMPs%20Example.png?alt=media)

This translates to:

* Increased complexity: Users or developers have to deal with all the different details of each GMP implementation. New team members have a steeper learning curve of the protocol.
* Less Flexibility: Switching to a new GMP becomes challenging in the event of a hack or downtime of the current one.
* Difficulty in Maintenance: Since the high-level functionality is tightly coupled with the GMP implementation, a change in GMP interface will require rewriting of all the components and related tests.

## Glacis Abstraction

> The Abstraction functionality of Glacis enables users and developers to engage with any compatible General Message Passing (GMP) solution seamlessly, using a singular, streamlined interaction flow, without the necessity to understand the intricate usage details inherent to each solution.

![](https://1192098899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCWTn4UpXpsFVDR7MJXv%2Fuploads%2Fgit-blob-9edbc799093f51252be121e62e25550cd8a38297%2FGlacis%20Abstraction%20to%20GMP%20A%20Example.png?alt=media)

![](https://1192098899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCWTn4UpXpsFVDR7MJXv%2Fuploads%2Fgit-blob-fb23868dfe863f40dfa4a00299ef27120a065337%2FGlacis%20Abstraction%20to%20GMP%20B%20Example.png?alt=media)

When engaging with multiple GMP protocols, the abstraction layer of Glacis ensures a consistent user interface. This means that regardless of the number or type of GMPs involved, users experience a uniform interaction pattern.

![](https://1192098899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcCWTn4UpXpsFVDR7MJXv%2Fuploads%2Fgit-blob-e537955d51459576372bd0794b2aa03920de14e7%2FGlacis%20Abstraction%20to%20multiple%20GMPs%20Example.png?alt=media)
