Skip to content

docs: add message passing unification discussion specs#39

Open
Joxess wants to merge 12 commits intomainfrom
feat/message-passing-specs
Open

docs: add message passing unification discussion specs#39
Joxess wants to merge 12 commits intomainfrom
feat/message-passing-specs

Conversation

@Joxess
Copy link
Collaborator

@Joxess Joxess commented Apr 15, 2025

Opening this PR to consolidate part of the latest discussions around cross-chain messaging, and to continue discussing what a unified API could look like. This draft is also meant to spark collaboration on the most relevant contrasts we've encountered, especially the differentiation between attributes and hooks. This collaborative effort is open for discussion and contributions.


The payload is an opaque `bytes` value. The Extra Data encodes optional logic or metadata (such as low-level calls) that the underlying messaging protocol should process during delivery.

### Hooks
Copy link
Collaborator

Choose a reason for hiding this comment

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

The main question I want to discuss regarding hooks is how using a hook differs from having the sender just invoke these functions before sendMessage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As we covered on the last call, the gateway itself invokes the hook, so the hook knows it’s running in the exact context of the message being sent. That gives us real atomicity and keeps extensions permissionless.

```solidity
interface IMessageRecipient {
function receiveMessage(
bytes32 messageId, // Unique ID supplied by the destination gateway
Copy link
Collaborator

Choose a reason for hiding this comment

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

@cjcobb23 wants to discuss bytes32 vs bytes for this parameter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Still open for discussion, from our perspective, bytes32 is cheaper and is what most tooling expects, so a protocol can still hash a string into a bytes32.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that a bare-bones gateway in current ERC-7786 doesn't need to handle attributes, it can return false in supportsAttributes and have require(attributes.length == 0) within sendMessage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments