Paymaster API

What is a Paymaster ?

Paymasters are smart contracts designed to facilitate transaction sponsorship.

They allow third parties to sponsor the gas fees for transactions, enabling users to interact with the blockchain without having to pay for gas themselves.

This can be particularly useful for onboarding new users, running promotional campaigns, or supporting decentralized applications where the end-user experience is improved by abstracting away transaction costs.

How to sponsor transactions

To authorize the sponsorship of a given contract address, you need to add it to your sponsored addressesed in the dashboard. From there, we will accept sponsoring transactions targeting this contract.

At the end of each month, you will receive an invoice with the total amount of gas fees covered. This fee is then billed through the payment method in your Cometh Connect account.

With Cometh Connect, there is no overhead on the price you pay. Depending on your license type, you have a max number of transactions you can sponsor each month.

Have a look at the "Gasless with Paymaster" section of the SDK documentation to see how to integrate it seamlessly.

Go Gasless

Endpoints

We support multiple chains for the paymaster services, you just need to modify the chainId and apiKey to your network. Here the list of our current supported networks.

URL

https://paymaster.cometh.io/CHAIN_ID?apikey=API_KEY

Example for Arbitrum Sepolia : https://paymaster.cometh.io/421614?apikey=API_KEY

pm_sponsorUserOperation

Submit a UserOperation to the paymaster. If approved for sponsorship, it returns the paymasterAndData along with updated gas values

Request

{
    "jsonrpc": "2.0",
    "id": 13,
    "method": "pm_sponsorUserOperation",
    "params": [
        {
            "sender": "0x8Fb8E6461F278c1651cb0Be92f27817e7Af128D9",
            "nonce": "0x09",
            "callData": "0x7bb374280000000000000000000000004fbf9ee4b2af774d4617eab027ac2901a41a7b5f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000406661abd00000000000000000000000000000000000000000000000000000000",
            "callGasLimit": "0x0",
            "verificationGasLimit": "0x0",
            "preVerificationGas": "0x0",
            "maxFeePerGas": "0xe4e1c00",
            "maxPriorityFeePerGas": "0x7270e00",
            "signature": "0xecececececececececececececececececececececececececececececececec"
        },
        "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
    ]
}

Response

{
	"jsonrpc": "2.0",
	"id": 13,
	"result": {
		"paymaster": "0xc49d6e93bB127A2FDf349FAdBD90De6853Bf40ff",
		"paymasterData": "0x0000000000000000000000000000000000000000000000000000000067108be20000000000000000000000000000000000000000000000000000000000001234bbdf2f2f5c456f14c1c72a3fb87c73a64dc8157caa5a8243213f4e0beab664335c31160514ee572b2006e78b77dee3749303d737f3ecf58b27cbeddf24120bac1c",
		"paymasterPostOpGasLimit": "0x01",
		"paymasterVerificationGasLimit": "0x0927c0",
		"hash": "0x2a079aad99c4d17456e487153e689bcedbb55707146b597172b05ab6721cf2b5",
		"signature": "0xbbdf2f2f5c456f14c1c72a3fb87c73a64dc8157caa5a8243213f4e0beab664335c31160514ee572b2006e78b77dee3749303d737f3ecf58b27cbeddf24120bac1c",
		"preVerificationGas": "0x51a257",
		"verificationGasLimit": "0x1987c",
		"callGasLimit": "0x19afb"
	}
}

pm_supportedEntryPoints

Returns an array of supported EntryPoint addresses.

Request

{
   "method":"pm_supportedEntryPoints",
   "id":1,
   "params":[],
   "jsonrpc":"2.0"
}

Response

{
	"jsonrpc": "2.0",
	"id": 1,
	"result": [
		"0x0000000071727De22E5E9d8BAf0edAc6f37da032"
	]
}

Last updated