Magpie: Utilizing Cross-chain Messaging for a Better DeFi Experience.

Magpie Protocol
4 min readOct 26, 2022

--

Let’s think about the history of moving cross-chain within crypto, there’s not much. The space is relatively new and it’s not exactly been smooth sailing, with the many bridge exploits and general unfriendliness of trying to use all the different bridges just to get to another chain. This is where cross-chain messaging comes in and helps us fly over all the muck.

Think about this, at one point in time a few countries used pigeons, actual birds, to send messages. People will do anything to communicate, but remember, just ’cause we’re birds here at Magpie doesn’t mean we’re homing pigeons, rather, consider us an omen pigeon, as we see the future of DeFi. Caw caw, sorry, haha, let’s move on.

We’re here to talk about crypto, so what does the above have to do with that? It’s to show that sending messages or data to others, securely & efficiently, has been a catalyst to push forward technology and push people to continually innovate in strange ways, you know, like with the pigeons.

So we know that messaging connects everything, people and data alike, it’s how we communicate all over the world every single day. It’s just as important in blockchain, but it may help you to think of transactions on the blockchain as messages, which issue commands to change the state of the blockchain (a state transition) if the conditions set by the protocol of the blockchain are met.

Rather than being forced into only interacting with one chain, as it was in the past, users and developers want to expand upon this, to not be limited by one chain, increasing both scalability and connectivity.

Well, messages are at the core of both of those, and we know that a pigeon can’t do it, they simply won’t fit into the blockchain, so we’ve got to come up with something else, and that something else would be cross-chain messages.

So what are Cross-chain messages and how does Magpie utilize them?

To simplify it, a cross-chain message is similar to a regular blockchain transaction, as it starts off as one, but, once it is verified and executed it creates a message to send a command to execute on a different chain.

Essentially this means that we can start a transaction on Avalanche and end it on Binance Smart Chain, making things much easier for you.

To accomplish this, we use the cross-chain messaging layer created by Wormhole, which connects twenty chains and Stargate, to efficiently and securely send messages to these other chains so that you can get your assets quickly, and without the need to go to a bridge.

Wormhole

Wormhole is a decentralized message-transfer protocol. Utilizing its Core Layer contract deployed on almost twenty of the most used and top blockchains, messages can be sent and verified cross-chain.

To give you an idea on how it works, we’ll show an example of how Magpie works with it, breaking it down into a few simple steps:

  1. Select the tokens and chains you would like to swap from and to.
  2. Magpie Protocol then publishes a message containing information to complete a cross-chain swap on the target chain through Wormhole Core Bridge.
  3. This message generates a Verified Action Approval (VAA). Once a quorum is reached on this message among 19 Wormhole guardian nodes, each which independently sign messages, are spread across the globe, and each has their own set of security requirements.
  4. Our relayer queries Wormhole Guardian Node and gets the VAA and completes the cross chain swap for you, receiving your chosen asset on the chosen target chain.

Stargate

Stargate is an Omnichain Interoperability Protocol designed for lightweight message transfer across chains. Magpie utilizes Stargate’s stablecoin liquidity pools deployed on multiple chains in order to facilitate our quick & efficient order routing.

How does it work? When you initiate a cross-chain swap through Magpie, our aggregator swaps the tokens into Stargate’s liquidity pools on one chain, sends a message to the destination chain, and then swaps out from the liquidity pool on the new chain for your requested assets. Within these steps is proof of validation on both the original and destination chain.

Cross-chain messaging is incredibly important to utilizing multi-chain to the fullest, and Magpie is here to make all of the above as easy as possible for you.

With us, it’s just a couple of clicks to do all of that.

So don’t forget, if you need help in DeFi, give us a caw, excuse us, we mean give us a call, or you know, join our Discord here and while you’re at it, don’t forget to sign up for our Alpha test waitlist.

--

--

Magpie Protocol

Future of cross-chain exchange infrastructure. Chain-Agnostic & Non-custodial liquidity aggregation protocol.