← Back to home

Luban the Paymaster

A customized paymaster that allows user to hold asset on one EVM chain and use it to sponsor transactions on all other EVM chains

Screenshots

Luban the Paymaster screenshot 1
Luban the Paymaster screenshot 2
Luban the Paymaster screenshot 3

Problem Statement

Luban the Paymaster operates by utilizing a custom paymaster - CrosschainPaymaster.sol - designed for Account Abstraction wallets, in conjunction with a unique JSON-RPC method, eth_checkCrossChainBalance. Here's a step-by-step breakdown of how it works:User Balance on Hosting Chain: The user needs to maintain a balance only on the hosting chain. This is achieved by depositing assets into the AccountEscrow.sol singleton contract on that chain. The deposit can be any ERC20 token or ETH.User Transaction on Transacting Chain: When a user wants to transact on a different chain, they submit a UserOperation with the paymasterAndData field pointing to the CrosschainPaymaster.sol address on the target chain, along with the chain ID of the hosting chainBalance Check: The bundler initiates a JSON-RPC eth_checkCrossChainBalance call to verify if the user has sufficient balance in the AccountEscrow.sol on the hosting chain. If the balance is adequate, the CrosschainPaymaster.sol sponsors the transaction. If not, the UserOperation is discarded.Transaction Flow: The UserOperation then follows the regular transaction flow. The key difference is that during the postOp phase, CrosschainPaymaster.sol initiates a cross-chain transfer call to deduct the user's deposit from the AccountEscrow.sol.Universal Application: This pattern is applicable to any transactions, swap, smart contract wallet deployment, adjust liquidity positions on AMMs.In the future, it's conceivable that a user would only need to maintain assets on a single EVM chain. These assets could then be used to sponsor transactions on all other EVM chains, as long as Luban is there to facilitate the process. This should be the pattern for future cross-chain transactions.

Solution

There are three major components:dumb bundler - a rust bundler implementation that implements all of the Json-RPC methods according to the ERC4337 spec, and a new Json-RPC method eth_checkCrossChainBalanceAccountEscrow.sol - a singleton contract that allows users to deposit any erc20 tokens to sponsor transaction on other evm chains. One can imagine AccountEscrow will be deployed on all EVM chains in the future, where user could use any EVM chain to be the hosting chain to sposor transaction on other chainsCrossChainPaymaster.sol - a customized pay master on the transacting chain that pulls user's deposits from the hosting chain through cross chain protocols

Hackathon

ETHGlobal Waterloo

2024

Prizes

  • 🏆

    🤝 Polygon — Best Public Good with AA

  • 🏆

    💸 Hyperlane — Most Innovative Use Case

  • 🏆

    🥇 XDC Foundation — Best Use

Contributors