Why Batch Payments?
Batch payments on Tempo provide:- Atomic execution: All operations succeed or fail together
- Gas efficiency: One transaction fee for multiple payments
- Simplified reconciliation: Single transaction hash for the entire batch
- Guaranteed ordering: Operations execute in the specified sequence
Basic Batch Transfer
Send multiple TIP-20 payments in a single transaction:All calls in a batch execute atomically. If any call fails, the entire transaction reverts.
Batch with Memos
Add memos to each transfer in a batch for individual tracking:Multi-Token Batch
Send different tokens in the same batch:Contract Interaction + Payments
Combine token transfers with contract calls in a single batch:Use Cases
Payroll
Distribute salaries to multiple employees in one transaction
Settlements
Batch settlement payments to multiple vendors
Refunds
Process multiple customer refunds atomically
Airdrops
Distribute tokens to many recipients efficiently
DeFi Operations
Swap and transfer in a single transaction
Multi-Sig
Execute complex multi-step payment flows
Dynamic Batch Generation
Build batches dynamically from data:Error Handling
Since batch transactions are atomic, you should handle failures appropriately:Limits and Considerations
Gas limits
Gas limits
Batch transactions consume more gas. Estimate gas for large batches and split if necessary.
Atomic execution
Atomic execution
All operations succeed or fail together. Design batches to avoid partial failures.
Ordering
Ordering
Calls execute in the order specified. Ensure dependencies are ordered correctly.
Balance checks
Balance checks
Verify sufficient token balance before sending large batches.
Best Practices
- Validate before batching: Check balances and allowances before building the batch
- Use memos: Add unique identifiers to track individual payments in the batch
- Monitor gas: Large batches may exceed block gas limits - split if needed
- Test atomicity: Verify rollback behavior in test scenarios
- Log batch details: Store batch metadata off-chain for reconciliation
Next Steps
Fee Sponsorship
Combine batches with fee sponsorship to pay gas for users
Smart Accounts
Use access keys to delegate batch payment permissions
Tempo Transaction
Learn more about Tempo Transaction features
Making Payments
Return to basic payment operations