Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docs for polygonZkevm Bridge and hook #40

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/reference/hooks/polygon-zkevm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# PolygonZkevm ISM and hook
Polygon Zkevm have their own bridging interface to transfer assets and messages across the parent and child chain - [zkEVM Bridge](https://docs.polygon.technology/zkEVM/architecture/protocol/zkevm-bridge/). Message ID is passed via this interface to verify the integrity of the message sent across chain using hyperlane messenger.

To provide this security option in Hyperlane we created the hook and ISM combo that can be transparently configured to use the zkEVM bridge.

See the [addresses](../contract-addresses.mdx) page for Hook and ISM addresses.

## How It Works

here's the flow for how the system works (this applies to `L1 <-> L2` and `L2<->L1`) :

the ism verifies if the message has been sent by the hook


```mermaid
flowchart TB
subgraph Origin Ethereum
Sender
M_O[(Mailbox)]
Hook[PolygonZkEvmHook]
Eth[(zkEVM Bridge)]

Sender -- "dispatch(...)" --> M_O
M_O -- "postDispatch(message)" --> Hook
Hook -- "sendMessage(messageId)" --> Eth
end

M_O -. "relay" .-> M_D

subgraph Destination Polygon zkEvm chain
Eth -. "Rollup sync" .-> Polygon

Recipient
M_D[(Mailbox)]
ISM{PolygonZkEvmISM}
Polygon[(zkEVM Bridge)]

M_D -- "verify(..., message)" --> ISM
M_D -- "handle(...)" --> Recipient
ISM -. "interchainSecurityModule()" .- Recipient


ISM -- "claimMessage(messageId)" --> Polygon
Polygon -- "onMessageRecieved(messageId)" --> ISM
end

style Eth fill: #ff0402
style Polygon fill: #ff0402
```