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 2 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
49 changes: 49 additions & 0 deletions docs/reference/hooks/polygon-zkevm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# 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
Eth -. "Rollup sync" .-> Polygon

subgraph Destination Polygon zkEvm chain
Recipient
M_D[(Mailbox)]
ISM{PolygonZkEvmISM}
Polygon[(zkEVM Bridge)]

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

Polygon -- "verifyMessageId(messageId)" --> ISM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iiuc the bridge is actually calling onMessageReceived?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was, I totally forgot about this PR.
it was supposed to be in draft. but I think this should be it now.

if we need more documentation with code examples lemme know. this is just for the users or for devs?

end

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