Paymaster

New Interface for Paymaster Validation

RIP-7560 requires the following interface to be implemented in the Paymaster:

function validatePaymasterTransaction(uint256 version, bytes32 txHash, bytes transaction) external returns (bytes context, bytes32 validationData);

The return data should be in the following format. Here, validUntil and validAfter are in uint48 format, as in ERC-4337. Note that the sequence of validationData and context is different from ERC-4337.

[Return data]
MAGIC_VALUE_PAYMASTER <20 bytes>, validUntil <6 bytes>, validAfter <6 bytes>, 64 <constant, 32 bytes>, length <32 bytes>, context <variable>

The context data in the return value has a length limit of MAX_CONTEXT_SIZE, which is currently set to 65536 and can be changed via a hard fork.

New Interface for Paymaster Post-Operation

Additionally, RIP-7560 requires the following interface for Paymaster post-operation:

function postPaymasterTransaction(bool success, uint256 actualGasCost, bytes context) external;

Paymaster providers need to modify or add to their Paymaster interfaces accordingly. For both functions, msg.sender is AA_ENTRY_POINT.

Last updated