The essence of Polymer

The essence of Polymer

Welcome to the next post in the series about Polymer, Cosmos, IBC, and general bridging technologies. Previously we presented how the IBC works. This time we are introducing the Polymer from Polymer Labs in more detail.

What is Polymer, in one sentence?

Polymer Protocol enables IBC packets transfer cross chains (ie. rollup chains) that do not natively support the IBC protocol.

Does it mean that the Polymer is competing directly with Cosmos?

No, the Polymer is built on top of the Cosmos SDK. It is compatible with Cosmos Hub, which talks through standard IBC protocol. Polymer integrates with chains that are not compatible with IBC. Therefore it can be seen as an additional interoperability enabler for the Cosmos ecosystem, which means that more chains will become part of the Cosmos realm through the machinery brought by the Polymer.

Is that the only problem the Polymer is trying to solve?

No, IBC communication has an inherent bottleneck: a number of transactions that can be transferred between connected blockchains. If there is a surge of IBC transactions on chain A that want to go to chain B simultaneously, the standard IBC protocol will be overloaded, and a significant delay will be added to processing the relayed messages.

The other side of this problem is interconnected blockchains’ different block generation times. This means that a “faster” blockchain will produce more blocks simultaneously, and a “slower” blockchain will need to make significantly more work to acknowledge a larger volume of blocks.

Solving this problem is another crucial contribution of Polymer.

What is the key innovation of the Polymer?

A notion of a roll-up IBC, a protocol to improve the throughput of transactions that a single IBC channel can handle. Moreover, it should also integrate with several L1/L2s+, so many IBC “connectors” running natively inside targeted State Machines should be developed.

How does Polymer work?

  1. A user interacts with the Source Contract on Blockchain A and initiates an IBC transaction.
  2. Source Contract on Blockchain A using a Dispatch Contract creates an IBC message dedicated to a Destination Contract running on Blockchain B.
  3. The outcome of that message is stored on the source chain (Blockchain A).
  4. The Blockchain A Rollup Relayer, which is running off-chain, monitors the Blockchain A chain for IBC messages. The Relayer must have a valid account on Polymerase to sign and broadcast transactions. It is also responsible for constructing valid proof for the IBC message.
  5. Then the Blockchain A Rollup Relayer relays messages to the Polymer chain (aka Polymerase), sending them to the Blockchain A Rollup Module (a Cosmos SDK module).
  6. The Blockchain A Rollup Module (part of the Polymerase chain) verifies IBC messages, with the support of Blockchain A Light Clients, converts source chain transactions to standard IBC packets, and relays them to (standard) IBC Module.
  7. The IBC Module (Cosmos SDK module running on Polymerase) updates the IBC consensus state, which then is read by the IBC Relayer (off-chain).
  8. The IBC Relayer (off-chain) routes IBC packets from the source to the destination. When the destination IBC chain is on the Polymer solution, the IBC message goes through the Polymerase to the Blockchain B Roll-up Module. Otherwise, it is relayed to the destination IBC module (for example, to Cosmos Hub).
  9. The Blockchain B Roll-up Relayer reads IBC packets from the Blockchain B Roll-up Module, batches them together, and generates a proof.
  10. Then the Blockchain B Roll-up Relayer sends the proof to the Dispatch Contract on Blockchain B.
  11. The rolled IBC messages (a Merkle proof) reach the Dispatch Contract, which needs to check if a minimal set of validators signs the proof.
  12. The Executor (off-chain) reads IBC packets and forwards their payloads to the Destination Contract, which must validate and process packets to execute the logic of the contract.
  13. Finally, the Destination Contract outputs a state change that effectively settles the transaction initiated on the Source Chain.

That’s it. We hope that we have successfully been able to describe on a high-level the inner workings of the Polymer. We know that there are a lot of hidden complexities and innovations that we will try to expose in the upcoming posts. But before we do that, we will try to switch our attention to other bridging solutions. Stay tuned.

Read more