eth_signUserOperation method allows you to sign an ERC-4337 UserOperation using your client’s MPC key without broadcasting it to the network. The signed UserOperation can then be submitted through a separate backend such as Pimlico or a custom bundler endpoint.
Prerequisites
Before usingeth_signUserOperation, ensure that:
- Your organization has Account Abstraction enabled. See the Account Abstraction guide for setup instructions.
- Your client was created with
isAccountAbstracted: truevia the Create a new client endpoint. - Your client has a wallet created and backed up.
Signing a UserOperation
Use therequest method with the eth_signUserOperation RPC method. The params array takes a single object with standard Ethereum transaction fields.
The
chainId must be a CAIP-2 compliant Chain ID for a supported Account Abstraction network.Transaction Parameters
The params object supports the following fields:Response
The method returns aPortalProviderResponse where result is a hex-encoded JSON string containing the signed UserOperation. You can decode this result and submit it to a bundler of your choice.