Paymaster
Gas-free transaction and contract invocation operations where the Paymaster service sponsors the gas fee on behalf of the user. Ideal for onboarding new users who don't hold ZTX tokens. Flow: generate paymaster blob → sign blob → submit paymaster.
Generates a gas-free transaction blob using the Zetrix Paymaster service. The Paymaster allocates a nonce from its pool and sponsors the gas fee when the transaction is submitted.
Flow:
Call this endpoint with
userAddressandoperationsReceive
blob,blobId, and reservation expiry (expiresAt)Sign the blob using
/tx/sign-blobSubmit via
/tx/paymaster/submitwithintimeoutMinutes
Pool Selection: Auto-selected unless paymasterPoolId or poolType (NORMAL, PREMIUM, CORPORATE) is specified.
Bearer access token. Include in all requests as: Authorization: Bearer <your_access_token>
API key for authentication. Include in all requests.
ehg7q2i6aN8jY6BbHqN5q42KsHQFRwl260jqAkAURequest to generate a paymaster-sponsored transaction blob (gas-free for users).
Zetrix address of the user initiating the transaction. Gas covered by the Paymaster.
ZTX3PGkYe55MJdKLMEQDShy5tR1as7kYJFZbUChain code identifier. Defaults to "0".
0Example: 0Specific paymaster pool ID. Auto-selected if not provided.
1Operation type label for tracking.
TRANSFERTarget address for tracking purposes.
ZTX9876543210ZYXWVUTSRQPONMLKJIHGFEDTransaction amount for tracking (optional).
1000000Minutes the nonce reservation is valid. Defaults to 10.
10Example: 10Minimum required pool balance in drops (optional).
10000000Preferred paymaster pool type.
NORMALPossible values: Paymaster blob generated. Sign and submit via /tx/paymaster/submit before expiresAt.
POST /ztx/tx/paymaster/generate-blob HTTP/1.1
Host: api-sandbox.zetrix.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-API-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 262
{
"userAddress": "ZTX3PGkYe55MJdKLMEQDShy5tR1as7kYJFZbU",
"operations": [
{
"type": "2",
"toAddress": "ZTX3TkqopBiDmHFMEBr5U7n9HfNqBa7LBhV2Q",
"amount": "1000000"
}
],
"chainCode": "0",
"timeoutMinutes": 10,
"poolType": "NORMAL",
"metadata": {
"appId": "mobile-app",
"version": "1.0.0"
}
}Paymaster blob generated. Sign and submit via /tx/paymaster/submit before expiresAt.
{
"success": true,
"object": {
"blob": "0A255A5458334A64656A33434B7443724253547851747456666E6456...",
"hash": "e3ea722dfaf33ca7a970348f55be0ba51abedfbd15e840ffb63fd9d7202b7eb2",
"blobId": "550e8400-e29b-41d4-a716-446655440000",
"paymasterAddress": "ZTX9876543210ZYXWVUTSRQPONMLKJIHGFED",
"paymasterNonce": 42,
"paymasterPoolId": 1,
"actualFee": 15000,
"expiresAt": "2026-01-01T10:10:00Z",
"timeoutMinutes": 10
},
"messages": [],
"timestamp": "2026-01-01T10:00:00Z",
"traceId": "trace-005"
}Submits a signed paymaster transaction blob for asynchronous processing. Returns immediately with QUEUED status.
Pre-conditions:
blobIdfrom a valid, non-expired/tx/paymaster/generate-blobcallblobsigned by the user's private keySubmitted before
expiresAt
Async Processing: The Paymaster adds its gas-sponsoring signature and broadcasts the transaction. Poll /tx/query with txHash to check final status.
Response Fields:
status— InitiallyQUEUEDtxHash— Use this to query the final result
Bearer access token. Include in all requests as: Authorization: Bearer <your_access_token>
API key for authentication. Include in all requests.
ehg7q2i6aN8jY6BbHqN5q42KsHQFRwl260jqAkAURequest body for submitting a paymaster-sponsored transaction or contract invocation.
Unique ID of the paymaster blob reservation from generate-blob.
550e8400-e29b-41d4-a716-446655440000The hex-encoded transaction blob returned during blob generation.
0A255A5458334A64656A33434B7443724253547851747456666E6456...Transaction queued for paymaster processing. Poll /tx/query using txHash for final status.
POST /ztx/tx/paymaster/submit HTTP/1.1
Host: api-sandbox.zetrix.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-API-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 234
{
"blobId": "550e8400-e29b-41d4-a716-446655440000",
"blob": "0A255A5458334A64656A33434B7443724253547851747456666E6456...",
"listSigner": [
{
"signBlob": "b8f4a2c3d1e0f9a8b7c6d5e4f3a2b1c0...",
"publicKey": "b00179b4adb1d3188aa1b98d6977a837..."
}
]
}Transaction queued for paymaster processing. Poll /tx/query using txHash for final status.
{
"success": true,
"object": {
"txHash": "e3ea722dfaf33ca7a970348f55be0ba51abedfbd15e840ffb63fd9d7202b7eb2",
"blobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "QUEUED",
"paymasterAddress": "ZTX9876543210ZYXWVUTSRQPONMLKJIHGFED",
"nonce": 42,
"submittedAt": "2026-01-01T10:01:00Z"
},
"messages": [],
"timestamp": "2026-01-01T10:01:00Z",
"traceId": "trace-006"
}Generates a gas-free contract invocation blob using the Paymaster service. Either contractKey or contractAddress must be provided. If both are given, contractAddress takes precedence.
Flow:
Call this endpoint with the user's address, contract identifier, method, and input parameters
Receive
blob,blobId, and expiry infoSign the blob using
/tx/sign-blobSubmit via
/contract/paymaster/submitbeforeexpiresAt
Pool Selection: Auto-selected unless paymasterPoolId or poolType (NORMAL, PREMIUM, CORPORATE) is specified.
Bearer access token. Include in all requests as: Authorization: Bearer <your_access_token>
API key for authentication. Include in all requests.
ehg7q2i6aN8jY6BbHqN5q42KsHQFRwl260jqAkAURequest to generate a paymaster-sponsored contract invocation blob.
Registered contract alias. Either this or contractAddress must be provided.
my-token-contractOn-chain contract address. Takes precedence over contractKey if both are given.
ZTX3JK2mN9pQ7rS4tU5vW6xY8zA0bC1dE2fG3hI4Contract method to invoke.
transferUser's Zetrix address (initiator). Gas covered by the Paymaster.
ZTX3PGkYe55MJdKLMEQDShy5tR1as7kYJFZbUZTX value in drops. Use 0 for non-payable methods.
0Chain code identifier. Defaults to "0".
0Example: 0Specific paymaster pool ID. Auto-selected if not provided.
1Nonce reservation timeout in minutes. Defaults to 10.
10Example: 10Minimum required paymaster pool balance in drops.
10000000Preferred paymaster pool type.
NORMALPossible values: Paymaster contract blob generated. Sign and submit via /contract/paymaster/submit before expiry.
POST /ztx/contract/paymaster/generate-blob HTTP/1.1
Host: api-sandbox.zetrix.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-API-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 311
{
"contractKey": "my-token-contract",
"method": "transfer",
"inputParameters": {
"to": "ZTX3TkqopBiDmHFMEBr5U7n9HfNqBa7LBhV2Q",
"amount": "1000000"
},
"userAddress": "ZTX3PGkYe55MJdKLMEQDShy5tR1as7kYJFZbU",
"value": 0,
"chainCode": "0",
"timeoutMinutes": 10,
"poolType": "NORMAL",
"metadata": {
"appId": "mobile-app",
"version": "1.0.0"
}
}Paymaster contract blob generated. Sign and submit via /contract/paymaster/submit before expiry.
{
"success": true,
"object": {
"blob": "0A255A5458334A64656A33434B7443724253547851747456666E6456...",
"hash": "e3ea722dfaf33ca7a970348f55be0ba51abedfbd15e840ffb63fd9d7202b7eb2",
"blobId": "550e8400-e29b-41d4-a716-446655440000",
"paymasterAddress": "ZTX9876543210ZYXWVUTSRQPONMLKJIHGFED",
"paymasterNonce": 42,
"paymasterPoolId": 1,
"contractAddress": "ZTX3JK2mN9pQ7rS4tU5vW6xY8zA0bC1dE2fG3hI4",
"method": "transfer",
"actualFee": 20000,
"expiresAt": "2026-01-01T10:10:00Z",
"timeoutMinutes": 10
},
"messages": [],
"timestamp": "2026-01-01T10:00:00Z",
"traceId": "trace-011"
}Queues a signed contract invocation blob for asynchronous Paymaster processing. Returns immediately with QUEUED status. The Paymaster adds its gas-sponsoring signature and broadcasts the transaction.
Required fields:
blobId— from/contract/paymaster/generate-blobblob— signed by the userlistSigner— user's signature(s)
Tracking: Poll /tx/query with txHash to check final on-chain status.
Bearer access token. Include in all requests as: Authorization: Bearer <your_access_token>
API key for authentication. Include in all requests.
ehg7q2i6aN8jY6BbHqN5q42KsHQFRwl260jqAkAURequest body for submitting a paymaster-sponsored transaction or contract invocation.
Unique ID of the paymaster blob reservation from generate-blob.
550e8400-e29b-41d4-a716-446655440000The hex-encoded transaction blob returned during blob generation.
0A255A5458334A64656A33434B7443724253547851747456666E6456...Contract invocation queued for paymaster processing.
POST /ztx/contract/paymaster/submit HTTP/1.1
Host: api-sandbox.zetrix.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-API-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 234
{
"blobId": "550e8400-e29b-41d4-a716-446655440000",
"blob": "0A255A5458334A64656A33434B7443724253547851747456666E6456...",
"listSigner": [
{
"signBlob": "b8f4a2c3d1e0f9a8b7c6d5e4f3a2b1c0...",
"publicKey": "b00179b4adb1d3188aa1b98d6977a837..."
}
]
}Contract invocation queued for paymaster processing.
{
"success": true,
"object": {
"txHash": "e3ea722dfaf33ca7a970348f55be0ba51abedfbd15e840ffb63fd9d7202b7eb2",
"blobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "QUEUED",
"paymasterAddress": "ZTX9876543210ZYXWVUTSRQPONMLKJIHGFED",
"nonce": 42,
"submittedAt": "2026-01-01T10:01:00Z"
},
"messages": [],
"timestamp": "2026-01-01T10:01:00Z",
"traceId": "trace-012"
}Last updated