Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

ERC-7533 proposes Public Cross Port (PCP), a mechanism for connecting EVM chains efficiently and allowing multiple bridges to transport the same cross-chain messages.

This article explains the proposal, with additional context and examples.

My other articles cover EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

PCP aims to connect EVM-compatible chains securely and efficiently. Instead of a push model in which a source sends messages separately to each destination, it uses a pull model in which a destination imports message commitments from multiple source chains.

The pull model can reduce dedicated bridge connections and allow batch synchronization, potentially lowering gas costs. PCP also aims to improve security by allowing independent bridge projects to attest to the same source messages.

At the common messaging layer, PCP defines a SendPort contract and an IReceivePort interface. Applications can build token bridges, NFT bridges, and cross-chain swaps on top of this infrastructure.

Application layer (examples) Message bridge layer Port layer
Token cross / NFT cross / Cross swap Message bridge A / Message bridge B SendPort / IReceivePort

The application layer is closest to the end user, while the port layer provides shared infrastructure. Standardizing only the port layer allows projects to differentiate their transport and application implementations while using a common message representation.

Motivation

The explosion of bridge connections between L2 networks

Many L2 networks have official bridges to L1, but direct communication between L2 networks is not always available through a shared mechanism. Suppose ten L2 networks need to communicate with one another. A dedicated directional bridge for every ordered pair requires:

  • 10 × 9 = 90 directional bridge connections.

Operating, auditing, and maintaining so many connections can increase costs and security risks. Separate bridge transactions can also increase users' gas costs.

PCP changes the approach so each chain imports message commitments from other chains. A destination can batch roots from the other nine chains into a single transaction.

Under the proposal's simplified topology, each destination needs one shared ingress:

  • Ten destinations with one ingress each = ten destination-side bridge interfaces.

This reduces the modeled number of ingress connections from 90 to 10. It does not remove the underlying need to observe, authenticate, and transport data from each source chain.

Turning redundant bridges into a security benefit

Many bridges provide overlapping functionality. However, having more bridges does not automatically make an application safer. If the application accepts a message whenever any one bridge approves it, a single compromised bridge may put assets at risk.

A standardized SendPort allows different bridges to transport commitments to the same message set. At the destination, their IReceivePort implementations can be used to verify messages.

For a particular canonical package, the expected commitment is the same regardless of which bridge transports it. An application can compare independent verification results rather than relying on just one bridge.

Security depends on the application's acceptance threshold and the independence and security of the underlying bridges. A shared interface alone does not enforce a threshold or eliminate common failure modes.

Reducing message overhead with a Merkle tree

To encourage bridge participation, PCP uses a hash-based Merkle tree as the SendPort data structure. The idea is to minimize the increase in transport overhead when additional applications submit messages.

A Merkle tree combines individual leaf hashes through a hierarchy of internal hashes into one root. Each cross-chain message is committed to by a leaf. A carrier can transport the root rather than every message in the package.

The root has a fixed size even when the package contains many messages. This allows transport overhead per message to fall as more messages are batched together. The overall system still incurs costs for adding leaves, computing the root, obtaining message data, and verifying inclusion proofs.

Use cases

image.png https://eips.ethereum.org/EIPS/eip-7533

Responsibilities across the three layers

PCP separates the cross-chain ecosystem into three layers.

  1. Port layer: SendPort and IReceivePort. This shared infrastructure defines how cross-chain messages are registered and how their commitments are received and verified.
  2. Message bridge layer: message bridge A, message bridge B, and other carriers. Bridge projects implement this layer. They obtain roots from SendPort, transport them to destination chains, and submit them to their receive ports. Multiple independent bridges can transport the same commitment.
  3. Application layer: token bridges, NFT bridges, cross-chain swaps, and other applications. This layer implements user-facing operations on top of the shared messaging infrastructure.

PCP standardizes the port layer, leaving message transport and application behavior to ecosystem participants. This provides interoperability while retaining implementation flexibility.

Reusing message bridges as a service

Applications can treat the port and message bridge layers as a message delivery service. A message bridge used for cross-chain token transfers can also support an NFT bridge.

An application may also use several message bridges simultaneously. An NFT bridge could reuse verification results from several existing bridges through their IReceivePort implementations.

Shared roots and batch processing allow verification infrastructure to be reused. The proposal aims to minimize incremental transport overhead, but obtaining attestations from additional bridges and checking multiple receive ports may still incur additional fees or gas.

The relationship between token and NFT bridges

The reference implementation combines token-transfer logic with message delivery logic. These responsibilities can also be separated.

An NFT bridge can reuse a message bridge originally built for tokens and can use multiple independent verification results to strengthen its acceptance policy. The Merkle tree and pull model allow transport costs to be amortized across applications.

Specification

image.png https://eips.ethereum.org/EIPS/eip-7533

Cross-chain communication follows this general flow.

Step Description
1. Add messages SendPort collects message commitments and groups them into a Merkle tree.
2. Retrieve and register roots Package carriers obtain roots from source chains and register them with IReceivePort on destination chains.
3. Verify messages A receive port checks message inclusion against a stored root.

Adding messages

PCP recommends deploying one shared SendPort on each chain. Its responsibility is to collect cross-chain message commitments and package them into Merkle trees using a permissionless interface.

  • Anyone can submit a message hash.
  • Bridge carriers retrieve package roots and deliver them to other chains.
  • The submitting address is included in each leaf so applications can distinguish messages originating from different senders.

How SendPort works

  1. An application or bridge contract submits a message hash (msgHash) and destination chain ID (toChainId). For example, it may commit to information about a USDT deposit.
  2. SendPort constructs a leaf from the message hash, submitting contract address, and destination chain ID, and adds it to the pending package.
  3. When a configured size or time threshold is met, a transaction triggers packing, creating a Merkle root and recording it.
  4. A new pending package is opened.

A single shared SendPort is recommended so participating bridges obtain a common source commitment. The contract does not execute automatically merely because time passes; a transaction must trigger packing.

Handling malicious messages

Because addMsgHash() is permissionless, arbitrary or invalid application data can be submitted. SendPort binds the actual msg.sender to the leaf, enabling destination applications to check which address submitted the message.

This helps applications reject unauthorized senders. It does not prevent malicious leaves from being added to the public tree.

Retrieving and registering roots

When SendPort packs a batch, it retains the Merkle root. Package carriers retrieve roots from source chains and register them with IReceivePort contracts on destination chains.

Different carriers may implement their own receive ports.

Characteristics of a root

A single package root can commit to messages from one source chain destined for several different chains.

A carrier may encounter packages containing no messages relevant to a particular destination, or packages that need not be delivered to every destination. Carriers can decide which destinations require a given root.

Why multiple receive ports exist

Rather than appointing one central receive port, PCP allows different bridge projects to deploy independent IReceivePort implementations.

Several carriers can independently transport the same SendPort root and make it available through separate receive ports. Applications can combine their results according to a chosen trust policy.

Verifying cross-chain messages

IReceivePort stores roots transported from source chains. An application can supply the message hash, relevant leaf data, and a Merkle proof to check inclusion.

The root is a cryptographic commitment, not a copy of the underlying messages. The full payload must be available from the source application or another data source; SendPort and its events supply message hashes and leaf-related information rather than necessarily storing the full payload.

Agreement among multiple receive ports

Honest bridges transporting the same canonical source package should obtain the same root.

Situation Interpretation
Many independent receive ports verify the same message The application has corroborating evidence under its configured trust model.
Some receive ports reject the message A bridge may be delayed, misconfigured, unavailable, or compromised.

This resembles threshold-based verification. Requiring agreement among sufficiently independent bridges may reduce dependence on one bridge. The application must define its threshold and handle correlated failures and unavailable attestations.

Data integrity

SendPort retains historical roots and package indices without overwriting them. Receive ports are expected to preserve historical commitments as well.

This supports historical verification, but does not independently guarantee the correctness of a root initially submitted by an untrusted carrier.

ISendPort

ISendPort.sol
pragma solidity ^0.8.0;

interface ISendPort {
    event MsgHashAdded(uint indexed packageIndex, address sender, bytes32 msgHash, uint toChainId, bytes32 leaf);

    event Packed(uint indexed packageIndex, uint indexed packTime, bytes32 root);

    struct Package {
        uint packageIndex;
        bytes32 root;
        bytes32[] leaves;
        uint createTime;
        uint packTime;
    }

    function addMsgHash(bytes32 msgHash, uint toChainId) external;

    function pack() external;

    function getPackage(uint packageIndex) external view returns (Package memory);

    function getPendingPackage() external view returns (Package memory);
}

Events

MsgHashAdded
javascript
event MsgHashAdded(
    uint indexed packageIndex,
    address sender,
    bytes32 msgHash,
    uint toChainId,
    bytes32 leaf
);

Emitted when addMsgHash() adds a message commitment. The event contains the message hash, destination chain, sender, derived leaf, and package index.

Parameters

  • packageIndex
    • Index of the package receiving the message.
  • sender
    • Address submitting the message.
  • msgHash
    • Message hash supplied by the caller.
  • toChainId
    • Destination chain ID.
  • leaf
    • Leaf hash derived from the message hash, sender, and destination chain ID.
Packed
javascript
event Packed(
    uint indexed packageIndex,
    uint indexed packTime,
    bytes32 root
);

Emitted when the pending package is packed into a Merkle tree, whether triggered by adding a message or by an explicit packing call.

Parameters

  • packageIndex
    • Packed package's index.
  • packTime
    • Packing timestamp.
  • root
    • Merkle root derived from the package's leaves.

Structs

Package
javascript
struct Package {
    uint packageIndex;
    bytes32 root;
    bytes32[] leaves;
    uint createTime;
    uint packTime;
}

Represents a batch of cross-chain message commitments. It holds the collected leaf hashes, with the root and packing timestamp set when packing is completed.

Fields

  • packageIndex
    • Package index.
  • root
    • Resulting Merkle root.
  • leaves
    • Array of message leaf hashes.
  • createTime
    • Package creation timestamp.
  • packTime
    • Packing timestamp.

Functions

addMsgHash
javascript
function addMsgHash(bytes32 msgHash, uint toChainId) external;

Adds a cross-chain message hash. The sender is obtained from msg.sender rather than supplied as an argument. The resulting leaf is appended to the pending package.

Parameters

  • msgHash
    • Message payload hash.
  • toChainId
    • Destination chain ID.
pack
javascript
function pack() external;

Packs the current package into a Merkle tree. Adding a message may trigger packing when a threshold is reached. If the package is not packed after the configured interval, a caller can invoke this function explicitly. Packing emits Packed and opens a new pending package.

getPackage
javascript
function getPackage(uint packageIndex) external view returns (Package memory);

Retrieves the package identified by packageIndex. Both previously packed packages and the current pending package can be retrieved.

Parameters

  • packageIndex
    • Index of the requested package.

Return value

  • Package
    • Requested package information.
getPendingPackage
javascript
function getPendingPackage() external view returns (Package memory);

Retrieves the currently accumulating package, allowing callers to inspect its contents before packing.

Return value

  • Package
    • Current pending package.

IReceivePort

IReceivePort.sol
pragma solidity ^0.8.0;

interface IReceivePort {
    event PackageReceived(uint indexed fromChainId, uint indexed packageIndex, bytes32 root);

    struct Package {
        uint fromChainId;
        uint packageIndex;
        bytes32 root;
    }

    function receivePackages(Package[] calldata packages) external;

    function getRoot(uint fromChainId, uint packageIndex) external view returns (bytes32);

    function verify(
        uint fromChainId,
        uint packageIndex,
        bytes32[] memory proof,
        bytes32 msgHash,
        address sender
    ) external view returns (bool);
}

Events

PackageReceived
javascript
event PackageReceived(
    uint indexed fromChainId,
    uint indexed packageIndex,
    bytes32 root
);

Emitted when a carrier registers a root retrieved from another chain's SendPort. It identifies the source chain, package, and root.

Parameters

  • fromChainId
    • Source chain ID.
  • packageIndex
    • Package index.
  • root
    • Merkle root.

Structs

Package
javascript
struct Package {
    uint fromChainId;
    uint packageIndex;
    bytes32 root;
}

Represents a package commitment received from another chain. It contains the source chain ID, package index, and root.

Fields

  • fromChainId
    • Source chain ID.
  • packageIndex
    • Package index.
  • root
    • Merkle root.

Functions

receivePackages
javascript
function receivePackages(Package[] calldata packages) external;

Registers multiple package roots with a receive port. A carrier can submit roots from several source chains in one operation. Each registration emits PackageReceived.

Parameters

  • packages
    • Array of package commitments to register.
getRoot
javascript
function getRoot(uint fromChainId, uint packageIndex) external view returns (bytes32);

Reads the registered root for a specified source chain and package index. Applications can inspect commitments and check consistency.

Parameters

  • fromChainId
    • Source chain ID.
  • packageIndex
    • Package index.

Return value

  • root
    • Stored Merkle root.
verify
javascript
function verify(
    uint fromChainId,
    uint packageIndex,
    bytes32[] memory proof,
    bytes32 msgHash,
    address sender
) external view returns (bool);

Checks whether a message is included in the registered source package. The function uses the root identified by fromChainId and packageIndex, reconstructs the leaf using the message hash, sender, and local chain ID, and verifies the supplied Merkle proof.

Binding the sender to the leaf prevents substitution of a different sender under the same proof. The application must separately decide which sender addresses are authorized.

Parameters

  • fromChainId
    • Chain from which the message originated.
  • packageIndex
    • Relevant package index.
  • proof
    • Merkle inclusion proof.
  • msgHash
    • Message payload hash.
  • sender
    • Source sender address.

Return value

  • bool
    • true if the proof matches the stored root; otherwise false.

Additional considerations

Conventional push-based messaging

In a simple push model, each source chain has a separate directional connection to each destination. With six chains, each chain sends messages to the other five.

image.png https://eips.ethereum.org/EIPS/eip-7533

The modeled connection count is:

Number of chains Directional connections
N N × (N - 1)

For six chains, 6 × 5 = 30 directional connections.

image.png https://eips.ethereum.org/EIPS/eip-7533

This design has several potential disadvantages:

  • Dedicated connections grow quadratically.
  • Separate bridge operations incur gas costs and operational complexity.
  • Auditing and maintenance may become more demanding.

Reducing dedicated connections with a pull model

PCP uses a pull model: the destination imports commitments from other chains. Carriers can batch several roots into one destination transaction rather than submitting each separately.

image.png https://eips.ethereum.org/EIPS/eip-7533

Under the simplified model of one shared ingress per destination, the connection count becomes:

Number of chains Destination ingress interfaces
N N

For six chains, this model uses six ingress interfaces.

Model Modeled connection count Six chains
Push N × (N - 1) 30
Pull N 6

The pull model has several potential benefits:

  • Destination-side ingress interfaces grow linearly.
  • Batch registration can reduce transaction overhead.
  • Multiple carriers can provide redundant verification.

The number of individual source observations and root commitments does not necessarily fall to N. The model compares dedicated connections with shared destination ingress, not every underlying network operation.

Merkle tree commitments

A Merkle tree makes the pull architecture practical by combining many data items into a single fixed-size root.

text
messages → leaf hashes → internal hashes → root(bytes32)

Whether a package contains one message or a thousand, its Merkle root is 32 bytes.

  • Carriers transport the root as the package commitment.
  • A destination application verifies individual messages using inclusion proofs.
  • The root's size remains fixed as more messages are added.
  • Smaller commitments can reduce transport and registration costs.
  • Proof verification can detect inconsistent message data relative to a trusted root.

This is a compact commitment, not lossless compression of the original data. Original messages and proofs must be obtained separately, and verification costs depend on the tree and application.

Overall design

Dedicated push-based connections can increase rapidly as more chains are added. The pull model batches source commitments at the destination and reduces the need for dedicated ingress interfaces.

Merkle trees support compact commitments, tamper detection against authenticated roots, and message inclusion verification. Together, these mechanisms aim to improve scalability while retaining the security checks required by the application.

Reference implementation

SendPort.sol

SendPort.sol
pragma solidity ^0.8.0;

import "./ISendPort.sol";

contract SendPort is ISendPort {
    uint public constant PACK_INTERVAL = 6000;
    uint public constant MAX_PACKAGE_MESSAGES = 100;

    uint public pendingIndex = 0;

    mapping(uint => Package) public packages;

    constructor() {
        packages[0] = Package(0, bytes32(0), new bytes32[](0), block.timestamp, 0);
    }

    function addMsgHash(bytes32 msgHash, uint toChainId) public {
        bytes32 leaf = keccak256(
            abi.encodePacked(msgHash, msg.sender, toChainId)
        );
        Package storage pendingPackage = packages[pendingIndex];
        pendingPackage.leaves.push(leaf);

        emit MsgHashAdded(pendingPackage.packageIndex, msg.sender, msgHash, toChainId, leaf);

        if (pendingPackage.leaves.length >= MAX_PACKAGE_MESSAGES) {
            console.log("MAX_PACKAGE_MESSAGES", pendingPackage.leaves.length);
            _pack();
            return;
        }

        // console.log("block.timestamp", block.timestamp);
        if (pendingPackage.createTime + PACK_INTERVAL <= block.timestamp) {
            console.log("PACK_INTERVAL", pendingPackage.createTime, block.timestamp);
            _pack();
        }
    }

    function pack() public {
        require(packages[pendingIndex].createTime + PACK_INTERVAL <= block.timestamp, "SendPort::pack: pack interval too short");

       _pack();
    }

    function getPackage(uint packageIndex) public view returns (Package memory) {
        return packages[packageIndex];
    }

    function getPendingPackage() public view returns (Package memory) {
        return packages[pendingIndex];
    }

    function _pack() internal {
        Package storage pendingPackage = packages[pendingIndex];
        bytes32[] memory _leaves = pendingPackage.leaves;
        while (_leaves.length > 1) {
            _leaves = _computeLeaves(_leaves);
        }
        pendingPackage.root = _leaves[0];
        pendingPackage.packTime = block.timestamp;

        emit Packed(pendingPackage.packageIndex, pendingPackage.packTime, pendingPackage.root);

        pendingIndex = pendingPackage.packageIndex + 1;
        packages[pendingIndex] = Package(pendingIndex, bytes32(0), new bytes32[](0), pendingPackage.packTime, 0);
    }

    function _computeLeaves(bytes32[] memory _leaves) pure internal returns (bytes32[] memory _nextLeaves) {
        if (_leaves.length % 2 == 0) {
            _nextLeaves = new bytes32[](_leaves.length / 2);
            bytes32 computedHash;
            for (uint i = 0; i + 1 < _leaves.length; i += 2) {
                computedHash = _hashPair(_leaves[i], _leaves[i + 1]);
                _nextLeaves[i / 2] = computedHash;
            }

        } else {
            bytes32 lastLeaf = _leaves[_leaves.length - 1];
            _nextLeaves = new bytes32[]((_leaves.length / 2 + 1));
            bytes32 computedHash;
            for (uint i = 0; i + 1 < _leaves.length; i += 2) {
                computedHash = _hashPair(_leaves[i], _leaves[i + 1]);
                _nextLeaves[i / 2] = computedHash;
            }
            _nextLeaves[_nextLeaves.length - 1] = lastLeaf;
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

ReceivePort.sol

js
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./IReceivePort.sol";

abstract contract ReceivePort is IReceivePort, Ownable {

    //fromChainId => packageIndex => root
    mapping(uint => mapping(uint => bytes32)) public roots;

    constructor() {}

    function receivePackages(Package[] calldata packages) public onlyOwner {
        for (uint i = 0; i < packages.length; i++) {
            Package calldata p = packages[i];
            require(roots[p.fromChainId][p.packageIndex] == bytes32(0), "ReceivePort::receivePackages: package already exist");
            roots[p.fromChainId][p.packageIndex] = p.root;

            emit PackageReceived(p.fromChainId, p.packageIndex, p.root);
        }
    }

    function getRoot(uint fromChainId, uint packageIndex) public view returns (bytes32) {
        return roots[fromChainId][packageIndex];
    }

    function verify(
        uint fromChainId,
        uint packageIndex,
        bytes32[] memory proof,
        bytes32 msgHash,
        address sender
    ) public view returns (bool) {
        bytes32 leaf = keccak256(
            abi.encodePacked(msgHash, sender, block.chainid)
        );
        return _processProof(proof, leaf) == roots[fromChainId][packageIndex];
    }

    function _processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

BridgeExample.sol

BridgeExample.sol
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./ISendPort.sol";
import "./ReceivePort.sol";

contract BridgeExample is ReceivePort {
    using SafeERC20 for IERC20;

    ISendPort public sendPort;

    mapping(bytes32 => bool) public usedMsgHashes;

    mapping(uint => address) public trustBridges;

    mapping(address => address) public crossPairs;

    constructor(address sendPortAddr) {
        sendPort = ISendPort(sendPortAddr);
    }

    function setTrustBridge(uint chainId, address bridge) public onlyOwner {
        trustBridges[chainId] = bridge;
    }

    function setCrossPair(address fromTokenAddr, address toTokenAddr) public onlyOwner {
        crossPairs[fromTokenAddr] = toTokenAddr;
    }

    function getLeaves(uint packageIndex, uint start, uint num) view public returns(bytes32[] memory) {
        ISendPort.Package memory p = sendPort.getPackage(packageIndex);
        bytes32[] memory result = new bytes32[](num);
        for (uint i = 0; i < p.leaves.length && i < num; i++) {
            result[i] = p.leaves[i + start];
        }
        return result;
    }

    function transferTo(
        uint toChainId,
        address fromTokenAddr,
        uint amount,
        address receiver
    ) public {
        bytes32 msgHash = keccak256(
            abi.encodePacked(toChainId, fromTokenAddr, amount, receiver)
        );
        sendPort.addMsgHash(msgHash, toChainId);

        IERC20(fromTokenAddr).safeTransferFrom(msg.sender, address(this), amount);
    }

    function transferFrom(
        uint fromChainId,
        uint packageIndex,
        bytes32[] memory proof,
        address fromTokenAddr,
        uint amount,
        address receiver
    ) public {
        bytes32 msgHash = keccak256(
            abi.encodePacked(block.chainid, fromTokenAddr, amount, receiver)
        );

        require(!usedMsgHashes[msgHash], "transferFrom: Used msgHash");

        require(
            verify(
                fromChainId,
                packageIndex,
                proof,
                msgHash,
                trustBridges[fromChainId]
            ),
            "transferFrom: verify failed"
        );

        usedMsgHashes[msgHash] = true;

        address toTokenAddr = crossPairs[fromTokenAddr];
        require(toTokenAddr != address(0), "transferFrom: fromTokenAddr is not crossPair");
        IERC20(toTokenAddr).safeTransfer(receiver, amount);
    }
}

These historical examples are reproduced unchanged. They are not a production-ready or independently audited bridge implementation. For example, SendPort requires an external transaction trigger, uses console.log without showing its import, and needs explicit handling of empty packages. The receive port trusts its owner to register correct roots. BridgeExample hashes message fields without a unique transfer identifier, so identical transfers can collide in its replay-tracking scheme. Implementations must resolve these issues and test the actual compiler and dependencies.

Security considerations

Bridge interactions and double payments

Responsibilities of SendPort and bridges

Component Responsibility
SendPort Collects message commitments and packages them into Merkle trees.
Cross-chain bridges Retrieve roots, transport them to other chains, and make them available for verification through IReceivePort.

PCP leaves carrier and root authentication mechanisms to individual projects. Participating bridges can retrieve the same canonical commitments.

A fault in one bridge need not affect another independent bridge. Other carriers can continue operating without competing for exclusive transport rights. Applications accepting a compromised bridge's results, or bridges sharing vulnerable infrastructure, may still be affected.

Implementation recommendations for preventing double payments

Recommendation Purpose
Restrict IReceivePort.receivePackages() Prevent arbitrary parties from registering roots.
Record processed message identifiers Prevent replay and repeated payouts.
Do not trust every sender in the Merkle tree Require application-specific sender authorization.
Why restrict access to IReceivePort.receivePackages()?

This function registers externally supplied roots. If arbitrary callers can register them without adequate authentication, an attacker may submit a fabricated commitment or interfere with root registration.

Implementations must enforce an appropriate root authentication policy, for example restricting submissions to authorized bridge contracts or using verified proofs. Access control alone provides only the security of the authorized party.

Why record processed message hashes?

An inclusion proof may remain valid indefinitely. Without replay protection, the same transfer could be processed more than once.

  1. Verify that the message is included in an authenticated package.
  2. Record the unique message identifier as processed.
  3. Reject subsequent attempts to process the same message.

The identifier should bind the relevant source, destination, application, and unique transfer context. Hashing only the recipient, amount, and token may incorrectly treat two distinct identical transfers as one.

Why not trust every sender in the Merkle tree?

A leaf binds a message hash, sender, and destination chain ID. SendPort is permissionless, so leaves may originate from malicious or irrelevant addresses.

Merkle inclusion is not equivalent to application-level authorization. The receiving application must identify which source senders and messages it accepts.

Cross-chain message impersonation

SendPort is public and permissionless. Anyone can submit a message commitment.

To protect against sender substitution, PCP includes msg.sender in the leaf.

How impersonation attempts are recorded

SendPort constructs a leaf using:

  • msgHash, the hash representing the message payload.
  • toChainId, the intended destination chain ID.
  • sender, the actual msg.sender address.

If an attacker submits a fabricated message, the leaf records the attacker's submitting address. During verification, an application can check that the leaf belongs to the authenticated package and that its sender is an authorized bridge or application contract.

The proposal warns:

Don’t trust all senders in the MerkleTree.

A Merkle proof establishes inclusion in a committed package. Given an authentic root, it establishes that SendPort packaged the leaf, but does not establish that its sender is trustworthy. That determination belongs to the receiving application and its verification policy.

Message ordering

SendPort records messages in their source-chain insertion order, but PCP does not guarantee their destination execution order.

Source and destination execution order may differ

Suppose a user performs two transfers:

  1. Transfer 10 ETH from chain A to chain B.
  2. Transfer 20 USDT from chain A to chain B.

SendPort records the commitments in that order. At chain B, either withdrawal order may occur:

  • Withdraw 20 USDT first, followed by 10 ETH.
  • Withdraw 10 ETH first, followed by 20 USDT.

The execution order depends on the destination application and its use of the receive port.

Application design considerations

  • Do not rely on source transaction order being preserved automatically.
  • Assume that messages from the same user may be processed in a different order.
  • When ordered execution is required, such as for sequential state transitions, enforce explicit sequence numbers or equivalent application-level rules.

PCP provides a mechanism for proving message inclusion, not a guarantee of destination execution ordering. Applications with order-dependent logic must handle that requirement separately.

Citation

George (@JXRow), Zisu (@lazy1523), "ERC-7533: Public Cross Port [DRAFT]," Ethereum Improvement Proposals, no. 7533, October 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7533.

Conclusion

ERC-7533 proposes common port interfaces and Merkle commitments to support cross-chain messaging between EVM-compatible chains. Several bridges can transport commitments to the same source messages, while authentication, acceptance policies, replay protection, and execution remain responsibilities of the relevant implementations.

If you have questions, feel free to contact me on Twitter.

Twitter @cardene777

You can also find my work on the following sites.