ByAUJay
Summary: When it comes to scaling smart accounts, it's not just about handling more traffic; it's also about having control mechanisms in place to keep expenses manageable and prevent misuse. This guide will walk you through designing rate limits, quotas, and safety measures across the ERC-4337 ecosystem (which includes accounts, paymasters, bundlers, and mempools). You’ll find clear settings, practical code examples, and the latest protocol updates like ERC-7562, shared mempools, and EIP-7702.
Smart Accounts at Scale: Rate Limiting, Quotas, and Abuse Prevention
Decision-makers are starting to ask one big question as pilot AA experiences become live: how do we keep things running smoothly and affordably when traffic ramps up by 10 to 100 times without facing major issues? Between 2024 and 2025, the ecosystem quietly rolled out the essential tools you’ll need for this challenge: a formal validation/rate-limit rulebook for mempools (ERC-7562), the rollout of a shared mempool, clearer versioning for EntryPoints, and upgrades for EOAs through EIP-7702. This post condenses all the important info into a practical playbook with parameters you can start using right away. (docs.erc4337.io)
What “abuse” looks like in AA
Understanding Abuse Vectors in Account Abstraction
Abuse vectors in account abstraction are a bit different from what we see with Externally Owned Accounts (EOAs). Here's the key difference: validation is programmable.
- Gas griefing: This one's all about creating user operations (UserOps) that are super cheap to simulate but end up failing when bundled. The result? It burns through the bundler's gas or the paymaster’s deposits. Check it out here.
- Sponsorship drain: Here, you'd either trick or brute-force a paymaster into sponsoring calls they never intended to. Or, you might just spam a ton of failing ops to slowly chip away at their deposits. More info here.
- Mempool DoS: This tactic involves flooding alternative/Account Abstraction mempools with operations that are costly to validate, or you could repeatedly use the same “valid-until-first” ticket to waste the bundler's cycles. Dive deeper here.
- Signature/packing pitfalls: There’s a bit of a mess sometimes with how userOps are hashed or verified, leading to inconsistencies that let you re-target previously issued sponsorships. We've seen this kind of bug pop up in the past. For more details, check this out here.
Your controls need to operate at four different layers: smart account, paymaster, bundler, and mempool/network. Check out the sections below for detailed settings and example policies for each layer.
The mempool rulebook you should lean on (ERC‑7562)
ERC‑7562 lays out the go-to rules for validation and mempool that help keep Account Abstraction (AA) open for everyone while minimizing the chances of griefing. Here are two key points to remember:
- Throttling based on reputation for those unstaked entities.
- A clear rundown of banned or restricted opcodes, alongside resource limits that come into play during validation.
Key Defaults to Consider as “Sane Global Limits” for Capacity Planning:
When you’re getting into capacity planning, there are a few default limits that can really help guide your decisions. Here’s a quick rundown of those “sane global limits” you should keep in mind:
- Memory Usage: Aim for about 80% of your memory’s total capacity. This gives you a comfortable buffer for unexpected loads.
- CPU Utilization: Keep CPU usage around 70-80%. Hitting those numbers means your resources are being used efficiently without overloading them.
- Disk I/O: A good rule of thumb is to target 50-60% of your disk I/O capacity. This can help prevent bottlenecks that slow everything down.
- Network Bandwidth: Try to stay within 50-70% of your network bandwidth. This helps maintain good performance even when traffic spikes.
- Database Connections: For database connections, it’s wise to hit around 60-70% of your connection limit to avoid overloading.
- Service Replicas: If you’re running services, aim for at least 2 replicas for high availability. This way, if one goes down, the other can pick up the slack.
By keeping these defaults in check, you can create a more stable and efficient environment for whatever you’re planning!
- SAME_SENDER_MEMPOOL_COUNT = 4 (this is the max number of userOps you can have per sender in the mempool).
- SAME_UNSTAKED_ENTITY_MEMPOOL_COUNT = 10 (that’s the cap for unstaked paymasters, factories, or aggregators).
- THROTTLED_ENTITY_MEMPOOL_COUNT = 4 (plus THROTTLED_ENTITY_BUNDLE_COUNT = 4).
- MAX_USEROP_SIZE = 8192 bytes; MAX_CONTEXT_SIZE = 2048 bytes; MAX_VERIFICATION_GAS = 500,000.
- When it comes to reputation math, we look at opsSeen and opsIncluded with MIN_INCLUSION_RATE_DENOMINATOR (which is 10 for bundlers), and use slack values like THROTTLING_SLACK=10 and BAN_SLACK=50. Check it out for more details over at eips.ethereum.org.
When validating, bundlers need to say no to non-deterministic or state-changing actions (like BLOCKHASH, TIMESTAMP, NUMBER, SELFDESTRUCT) and only allow certain exceptions for staked entities. This helps prevent the “validate-passes-off-chain, reverts-on-chain” headaches. (ercs.ethereum.org)
What This Means for You:
So, here’s the deal:
- For those managing infrastructure, make sure your bundler is set up to enforce ERC‑7562 as it is; there's no need to create new limits.
- If you're developing accounts, factories, or paymasters, double-check that your validate functions steer clear of any banned opcodes, and keep external calls or shared state protected behind staking. (docs.erc4337.io)
Shared mempool is now the default posture
Up until late 2024, a lot of AA stacks depended on private queues, which meant that censorship resistance and redundancy weren’t the strongest. But now, the shared mempool is up and running on Ethereum, Optimism, and Arbitrum, with Polygon integration in the works. This means your UserOps can now spread across several bundlers automatically. It’s a great way to lower the risk from relying on just one provider and ensures fair inclusion. Check out more details here.
Design Implications:
When it comes to designing a product or system, there are some important implications to keep in mind. Here’s a breakdown of a few key points:
User Experience
- Simplicity is Key: Users generally prefer interfaces that are easy to navigate. Keep things straightforward and clutter-free to enhance user engagement.
- Accessibility Matters: Make sure your design is usable by everyone, including those with disabilities. Consider color contrast, font sizes, and alternative text for images.
Branding
- Consistency Counts: Your design should align with your brand’s identity. Stick to a consistent color palette, typography, and style to make your product instantly recognizable.
- Emotional Connection: Design elements can evoke emotions. Think about the feelings you want your users to associate with your brand and incorporate those into your visuals.
Functionality
- Responsive Design: With so many devices out there, ensure your product looks great and works well on various screen sizes.
- Feedback Loops: Provide users with immediate feedback during interactions (like button clicks or form submissions). It reassures them that their actions are being registered.
Technical Considerations
- Performance Optimization: A beautiful design is great, but it shouldn’t sacrifice speed. Optimize images and code to make sure your product runs smoothly.
- Scalability: As your user base grows, your design should be able to adapt without a complete overhaul. Plan for future needs as you create your design.
Research and Testing
- User Testing: Before launching, get real feedback from users. Observing how they interact with your design can reveal a lot about what's working and what's not.
- Stay Updated: Trends change quickly in the design world. Keep an eye on the latest design practices and technologies to stay relevant.
By considering these implications while designing, you can create products that not only look good but also work well for your users!
- Make sure to integrate at least two bundler endpoints that are part of the shared mempool.
- If an operation isn't picked up within your Service Level Objective (SLO), go ahead and implement resubmission with some jitter.
- Keep an eye on “ops included by others” compared to “ops seen by us” to spot any signs of censorship. (docs.erc4337.io)
Bundlers: practical rate limiting and observability
You’ve got a couple of options here--you can either purchase capacity, like with Alchemy’s Rundler, or you can set up your own. Either way, it's time to get specific:
- EntryPoint support and addresses: We're currently rocking v0.7 as the default version; however, providers are still backing v0.6. They’ve indicated plans to phase it out by 2026. Here are the addresses to keep in mind: for EntryPoint v0.7, it’s
0x0000000071727De22E5E9d8BAf0edAc6f37da032, and for v0.6, it’s0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789. Check it out on alchemy.com. - RPC surface: We've got a few key RPC methods here:
eth_sendUserOperation,eth_estimateUserOperationGas,eth_getUserOperationReceipt, andeth_supportedEntryPoints. Some providers throw inrundler_maxPriorityFeePerGasto help steer fee decisions. More details can be found on alchemy.com. - Proven implementation: Rundler, which is built in Rust, is open-source and fine-tuned for the cloud. Plus, it keeps tabs on P2P/shared-mempool support. You can dive into the code on github.com.
- Monitoring: Make sure to keep an eye on things like ingress rates, validation pass/fail categories (think signature, paymaster, or initCode), bundle size, latency, and the differences between simulation and execution gas. It’s wise to set up alerts for any spikes in rejects or unexpected changes in gas usage. For more info, check out docs.erc4337.io.
Operational quotas to set on day one (map to ERC‑7562 where possible):
- Define transaction limits: Establish clear boundaries for transaction volumes to keep operations smooth.
- Set user caps: Determine how many users can interact with the system at a given time to avoid bottlenecks.
- Monitor gas fees: Create guidelines for gas fee thresholds to manage costs effectively without scaring off users.
- Implement withdrawal restrictions: Introduce limits on withdrawal amounts to ensure liquidity remains stable.
- Track performance metrics: Set quotas for key performance indicators (KPIs) to keep everything on track and allow for timely adjustments.
- Regular audits: Schedule regular check-ins to review quotas and make adjustments based on real-world usage and performance data.
By mapping these operational quotas to ERC-7562 as much as we can, we can create a robust framework that supports a healthy ecosystem right from the start.
- Per-sender inflight cap: 4 (this aligns with SAME_SENDER_MEMPOOL_COUNT).
- Per-paymaster inflight cap: when unstaked, it’s 10; when throttled, it drops to 4. And just a heads up, it will auto-evict after THROTTLED_ENTITY_LIVE_BLOCKS=10. (eips.ethereum.org)
- Replace-by-fee semantics: we’ll only accept a replacement if the priority fee goes up enough; this helps us keep out those low-tip spammy requests at the entrance. (erc4337.io)
- Debug/forensics: you can use debug_bundler_dumpReputation to check out opsSeen/opsIncluded/status, and don’t forget to add this into your on-call runbooks. (ercs.eips.fyi)
Don’t forget about provider-side limits! For instance, Pimlico has some published limits that show how infrastructure vendors manage API credits and requests per minute. Make sure you budget for your peak campaign traffic or consider bringing your own bundler. Check it out here: (docs.pimlico.io)
Paymasters: the quota engine for product and cost control
Paymasters open the door to a gasless user experience but end up being seen as the “wallet of last resort.” It's best to treat them as part of the payment infrastructure while implementing strict quotas.
Security Baseline:
A security baseline is basically a set of fundamental security measures that help organizations protect their assets. Think of it as the bare minimum you should have in place to keep things safe. Here’s what you need to know:
- Identify Assets: Start by recognizing what you need to protect. This could be anything from sensitive data to physical devices.
- Risk Assessment: Take a good look at potential risks. What could go wrong? How likely is it to happen? Understanding these risks will guide your security measures.
- Implement Controls: Based on your risk assessment, put in place security controls. These could be technical, like firewalls and encryption, or administrative, like security policies and training programs.
- Monitor and Review: Once you’ve set up your baseline, don’t just forget about it. Regularly check in to see if the controls are working and make adjustments as needed.
- Documentation: Keep everything documented. It’s super helpful for audits and also makes it easier to bring new team members up to speed.
By following these steps, you can establish a solid security baseline that protects your organization from various threats.
For more detailed guidance, check out NIST's Cybersecurity Framework.
- EntryPoint has some strict rules regarding stake and deposit requirements, and any misbehavior could lead to slashing. It's crucial to keep validation straightforward, limited, and easy to simulate. Remember, use postOp just for accounting purposes. (docs.erc4337.io)
Quota patterns we use for clients:
Here’s a look at some of the quota patterns we’ve rolled out for our clients:
1. Flat Quota
In this approach, every rep has the same quota. It’s super straightforward and works well if your team is pretty homogenous in terms of territory and potential.
2. Tiered Quota
With tiered quotas, reps earn greater incentives as they hit higher sales levels. This can keep the team motivated to push beyond their initial goals.
3. Territorial Quota
Here, quotas are set based on specific territories, allowing reps to focus on their local markets. This can help account for different market potentials and drive better results.
4. Product Line Quota
This one’s specialized. Quotas are based on specific products or services. It’s great for pushing new offerings or priority items and gives reps a clear target.
5. Hybrid Quota
Combining elements from different patterns, hybrid quotas can be customized to fit unique team dynamics and market situations. It’s all about being flexible!
6. Activity-Based Quota
Instead of focusing purely on sales, this pattern emphasizes activities like calls, demos, or meetings. It’s great for early-stage companies where building relationships is key.
7. Performance-Based Quota
Now, this style ties quotas directly to overall performance metrics. It encourages a focus not just on the numbers but on the quality of work, which can really shine through in client satisfaction.
Feel free to reach out if you want to chat about which pattern might work best for your team!
1) Per-user/day budgets (off-chain ledger, on-chain enforcement)
- We’ve got validation that checks with an off-chain quota server to see how many “remaining units” each user has left.
- When we talk about identity, it can be a couple of things: a SIWE session (EIP-4361), your account address, or a signed nonce that’s linked to your device. You can check out more about it here.
- After a successful operation, you'll get back some context bytes which your postOp will use to decrease the quota atomically. Just a heads up to keep it under MAX_CONTEXT_SIZE=2048. You can read about that here.
2) Tiered Sponsorship Caps
- Free Tier: You can make up to 3 operations daily, with a maximum
callGasLimitof 250k, and the max value is set to 0. - Verified Tier: This one allows for up to 20 operations a day, with a per-operation gas cap of 800k. Plus, you can use a specific contract allowlist.
- Enterprise: Here, the cap is negotiated based on a “customer ID” context. You can operate at a burst rate of 10 operations per minute, with a daily max of 1000. We encode these limits in signed “tickets” that come with a short expiry.
3) Risk-Adjusted Gas Ceilings
- Hard Cap Verification: Keep an eye on
GasLimitandpaymasterVerificationGasLimit. If your estimates combined withVALIDATION_GAS_SLACKpush you over budget, it’s best to reject those transactions. You can check it out more at eips.ethereum.org. - Cap Pre-Verification Gas: To safeguard bundlers from handling too much data at once, put a limit on
preVerificationGas. Remember, if you’re dealing with heavy data signatures, it's smarter to route that through an aggregator (more info below). You can learn more at erc4337.io.
- Post-op Backpressure
- If failure rates hit over X% for the last Y minutes, consider downgrading users to the “free tier” or temporarily turning off sponsorship for certain destinations. Make sure to set up rolling counters on the server side and keep postOp work as gas-efficient as possible. (docs.erc4337.io)
Practical Format Tips:
1. Keep It Simple
When you're diving into any kind of writing, whether it’s a report, blog post, or an email, try to stick to a clean and straightforward format. This makes it easier for your readers to understand your message without getting lost in a cluttered layout.
2. Use Headings Wisely
Don’t underestimate the power of headings! They break up your text and help guide the reader through your content. Make sure each heading accurately reflects what's in the section beneath it.
3. Bullet Points for Clarity
Bullet points are your best friend when you need to list things out. They make information digestible. Just remember to keep each point concise!
- Point one: Brief and to the point.
- Point two: Another clear statement.
- Point three: Simple and effective.
4. Consistent Font and Size
Choose a font that’s easy to read and stick with it. A good rule of thumb is to use the same font throughout your document in a size that’s comfortable for your audience.
5. Use Images and Tables
Visuals can really help convey your message. Whether it's a chart, graph, or a relevant image, make sure they’re high-quality and contribute to your content.
| Feature | Description |
|---|---|
| Feature 1 | A brief description here |
| Feature 2 | Another concise detail |
| Feature 3 | And another one |
6. Add Links
If you’re referencing other work or providing additional resources, don’t hesitate to include links. They’re perfect for directing readers to related content.
For more tips, check out this article that goes deeper into formatting.
7. Proofread
Last but not least, always proofread your work. Typos and mistakes can distract from your message, so take a little time to make sure everything flows smoothly and is polished.
By following these simple tips, you’ll not only enhance the readability of your work but also engage your audience more effectively!
- v0.7 brings in userOps support with a cool dedicated paymaster signature path. This lets both the account and paymaster sign at the same time, which is pretty neat! To keep things smooth, make sure to use the PAYMASTER_SIG_MAGIC layout for consistent parsing and sizing. Check it out here: (docs.erc4337.io)
Known Pitfalls:
- Assuming Everything Will Work Out
It’s easy to think that just because you’ve got a solid plan, everything will go smoothly. But life loves to throw curveballs, so always be prepared for surprises. - Neglecting Research
Skipping the research phase can be tempting, especially when you're eager to jump in. But doing your homework first can save you tons of time and headaches later. - Overcomplicating Things
Sometimes we try to make things too fancy. Keep it simple! Complexity can lead to confusion, so stick to what works. - Ignoring Feedback
Whether it’s from colleagues, friends, or users, feedback is golden. Don’t brush it off; instead, use it to make your project even better. - Underestimating Time
Be realistic about how long things will take. Rushing through because you think you can finish quickly often leads to mistakes. - Lack of Clear Goals
Without clear goals, it’s easy to wander off track. Set specific, measurable objectives to help you stay focused. - Avoiding Collaboration
Going solo might seem efficient at times, but collaboration can spark creativity and help you avoid blind spots. Don’t hesitate to reach out to others! - Being Afraid to Experiment
Trying new things can be scary, but it’s often where the most growth happens. Embrace experimentation! - Failing to Document
Not keeping a record of your processes and changes can bite you later. Make sure to document everything as you go.
By keeping these pitfalls in mind, you can navigate your projects with a lot less stress and a lot more success!
- In the past, there have been some packing and encoding headaches when it comes to verifying paymasters, which can open up risks related to signature re-targeting. To stay safe, make sure to use the latest templates from trusted libraries and double-check those hash domains thoroughly. (alchemy.com)
Smart accounts: rate limits “at the edge”
Relocate Some Throttling to Accounts to Lessen Reliance on Off-Chain Checks:
- Nonce channels for parallel policies: With ERC‑4337, the nonce is set up with a "keyed" system that combines a 192‑bit key and a 64‑bit sequence. This means you can use one key for “admin/guardians” and another for “retail ops,” which gives you the flexibility to manage sequencing and quotas separately. For instance, you can set it up so admin operations are rejected unless the nonce key matches ADMIN_KEY, while retail operations use key 0. (eip.info)
- Module standards: ERC‑6900 and ERC‑7579 make it super easy to install validators and hooks like plug-ins! You could implement a rate-limit hook to enforce a daily cap based on session keys, alongside a pre-execution allowlist. Plus, with OpenZeppelin Contracts v5.2, you get handy utilities tailored for ERC‑4337/7579, making your secure implementations a breeze. (eips.ethereum.org)
- Signature aggregation: Since signatures can really rack up calldata costs, using an aggregator as per ERC‑7766 is a smart move. This lets you validate batched signatures just once, which helps save on gas and eases the bandwidth burden. Bundlers are in charge of whitelisting these aggregators, and it’s a good idea to keep them staked for easy access during validation. (eips.ethereum.org)
Passkeys and Device-Bound Keys
So, L2s are really jumping on the secp256r1 precompile train (thanks to RIP-7212), and Ethereum L1 is getting in on the action too with EIP-7951. What does this mean for us? Well, it seriously slashes the validation gas for passkey signatures from the hefty range of ~180-350k down to just a few thousand. This makes those per-user quota checks way more affordable, even when we're scaling up.
You can expect to see around 3.45k gas on many L2s and about 6.9k gas on L1 with EIP-7951. Pretty neat, right? Check out more details on eco.com!
EIP‑7702 “smart EOAs”: what changes for rate limiting
EIP‑7702 gives an Externally Owned Account (EOA) the ability to set code through a new type of transaction that includes an authorization list. This means it can act like a smart account until it's updated. To keep things secure, there are two important abuse-prevention rules already integrated into the 7562 mempool guards:
- Each UserOp can have just one authorization tuple tied to a user; plus, only the account that has been authorized can send that UserOp.
- If there are multiple UserOps from the same sender that include a 7702 authorization, they need to point to the same delegate address. (eips.ethereum.org)
If you're onboarding users through 7702, make sure your bundler stays on a shared mempool and keep those per-sender/entity quotas intact. Just a heads-up, the same 7562 caps and reputation calculations still apply. Check out the details here: (docs.erc4337.io)
Reconciling EntryPoint versions and mempool limits
Teams frequently run into different rules about “how many ops per sender” in various documents. The older bundler documentation mentioned “one per sender in pool,” but then ERC‑7562 stepped in and set a default of 4 ops per sender, along with some reputation controls for the entities involved. Here’s how it plays out in real life:
- Make sure to use Target EntryPoint v0.7 (while v0.6 is still supported, it's better to migrate) and implement the 7562 limits throughout your infrastructure. Providers are openly sharing their plans for v0.7 support and the deprecation of v0.6, which will happen in 2026. Check it out here: (alchemy.com)
Observability that actually catches abuse early
Keep an eye on these and automatically switch to throttling when needed:
- Keep an eye on the ingress rate from different sources like IP and apiKey, and break it down by entity--think sender, paymaster, and factory.
- Watch out for different validation failure classes: signature issues, nonce problems, banned opcodes, paymaster errors, and initCode troubles.
- Track opsSeen versus opsIncluded for each entity and across alternate mempools. Set up an alert for when opsSeen starts outpacing included ones (if that happens, your reputation will take a hit, and throttling will kick in soon). (docs.erc4337.io)
- Compare simulated gas usage against actual gas (both for verification and execution). Set an alert for any drift that exceeds N%. (docs.erc4337.io)
A reference “free-to-paid” policy that holds up under load
If you're about to kick off your consumer UX with gas sponsorship, here’s what you need to know:
- Phase 0 (open beta)
- We're working with shared mempool providers A and B.
- Paymaster: Each account gets 3 free operations per day; limit on call gas is 250k; only allows a specific list of destinations; and there's a 30 requests per minute cap per IP.
- Bundler: For settings, we have
SAME_SENDER_MEMPOOL_COUNT=4,SAME_UNSTAKED_ENTITY_MEMPOOL_COUNT=10, and we’re rejecting any user operations bigger than 6kB. The max verification gas is set at 400k. (eips.ethereum.org)
- Phase 1 (growth)
- SIWE-gated verified tier: We're looking at 20 operations per day, keeping the callGasLimit at or below 800k. Just so you know, ERC-20 approvals won't be allowed, and there are some specific DEX paths that won't pass validation.
- Let’s adopt signature aggregation for those hot paths to help cut down on calldata costs. Check out the details here: (eips.ethereum.org).
- We’ll also roll out “sponsorship tickets” that expire in 5 minutes. These will be linked to nonce keys to stop any replay across parallel lanes. You can read more about it here: (eip.info).
- Phase 2 (enterprise)
- We’re rolling out customer-specific setups that come with contractual quotas (ops/min, ops/day, total gas/month). These will be enforced during paymaster validation and will be logged in postOp.
- You can either use dedicated bundler instances or bring your own Rundler with a higher RPM. Plus, we’ll have audit logs through
debug_bundler_dumpReputationon an hourly basis to spot any drop in performance before it impacts users. (github.com)
Future‑proofing: native AA on rollups
RIP‑7560 (native AA) along with its mempool and nonce buddies (RIP‑7711/7712) take the same rate-limiting concepts and turn them into protocol-level transactions. The quotas and policies we talked about above fit right in: reputation, nonces with keys, and shared mempool semantics are all still in play--it's just the transport that gets a makeover. Make sure to build modularly (ERC‑6900/7579) so your validators and hooks seamlessly carry over. Check it out at rip7560.com!
Security notes you should bake into reviews
- Make sure to enforce those “onlyEntryPoint” style checks in accounts. We saw how disastrous it could be when a trusted EntryPoint got swapped during that 2023 UniPass incident. Let’s ensure we’ve got those hard-coded EntryPoint checks in place. (fireblocks.com)
- Take the time to validate paymaster signing domains really carefully; any packing mistakes could lead to unwanted sponsorships. Stick to using audited libraries and the latest templates to keep things secure. (alchemy.com)
- When it comes to validation, steer clear of banned opcodes and mutable shared states unless they're staked. Utilize bundler simulation along with trace classification to filter out risky operations before inclusion. (ercs.ethereum.org)
Implementation snippets (sketches)
A Minimal Verifying Paymaster Flow with Quotas:
When you’re dealing with paymasters, keeping things simple yet effective is key. Here’s how a minimal verifying paymaster flow with quotas works:
- Setup the Quota: Start by defining the limits. Decide how much each paymaster can handle within a specific time frame. This helps maintain control and efficiency.
- Request Submission: When a request comes in, the system checks if it’s within the set quota. If it is, the request moves forward; if not, it gets flagged for review later.
- Verification Process: This is where the magic happens. Each request is verified by the paymaster to ensure it meets all necessary criteria.
- Approval or Denial: After verification, the paymaster can either approve or deny the request. If approved, it’s processed; if denied, the reasons should be communicated clearly.
- Quota Adjustment: Post-decision, the quota is adjusted accordingly. This allows for real-time tracking of how much has been allotted and how much is still available.
- Reporting: Finally, keep track of everything. A simple report summarizing requests, approvals, denials, and remaining quotas is essential for transparency and future reference.
Example Flow:
Request Received -> Check Quota -> Verify Request -> Approve/Deny -> Adjust Quota -> Generate Report
This streamlined flow keeps everything organized and helps you manage paymaster responsibilities effectively, ensuring that no one is overwhelmed while also maintaining compliance and efficiency.
// Pseudocode sketch -- align with ERC-4337 v0.7 PackedUserOperation
function validatePaymasterUserOp(
PackedUserOperation calldata uo,
bytes32 uoHash,
uint256 maxCost
) external returns (bytes memory ctx, uint256 validationData) {
// 1) Parse contextTicket signed by backend: {account, tier, expiry, maxGas, quotaRemaining, nonce}
Ticket memory t = verifyTicket(uo.paymasterAndData, uoHash); // ECDSA over fixed domain
// 2) Hard caps
require(uo.callGasLimit <= t.maxGas, "cap");
require(block.timestamp <= t.expiry, "expired");
// 3) Check quota off-chain via signed counter embedded in ticket,
// or via read-only call to staked registry (if using staked shared state).
require(t.quotaRemaining > 0, "quota");
// 4) Return compact context to decrement on success only
ctx = abi.encode(t.account, t.nonce, t.tier);
return (ctx, 0); // 0 = valid signature; pack signature per v0.7 paymasterSig format off-chain
}
function postOp(PostOpMode mode, bytes calldata ctx, uint256 actualCost, uint256 actualPriorityFee)
external
{
(address account, uint64 nonce, Tier tier) = abi.decode(ctx, (address, uint64, Tier));
if (mode == PostOpMode.opSucceeded) {
// emit event for off-chain quota decrement or update staked registry
emit Consumed(account, nonce, tier, actualCost);
}
}
This approach ensures that validation stays predictable and within limits, makes use of postOp for tracking, and sets gas limits prior to the call--just like 7562. (docs.erc4337.io)
Executive checklist
- Make sure to adopt ERC‑7562 limits in your bundler and paymaster configs; only loosen them if there's a solid reason. (eips.ethereum.org)
- Get at least two shared-mempool participants on board; keep an eye on inclusion latency and any drift between opsSeen and opsIncluded. (docs.erc4337.io)
- Plan ahead for product launches by budgeting for provider RPM/credits (or consider deploying Rundler) to steer clear of any single choke points. (docs.pimlico.io)
- Break down your rate-limit logic using ERC‑6900/7579 validators/hooks; it's better to go with aggregated signatures for those hot flows. (eips.ethereum.org)
- If you’re on board with passkeys, take advantage of secp256r1 precompiles (that's for L2 today; EIP‑7951 for L1) to keep your verification costs low under quota. (eco.com)
- Don't forget about the 7702 users: enforce the authorization tuple rules in your CI tests; treat them like smart accounts when it comes to quotas. (eips.ethereum.org)
Where 7Block Labs can help
- Get your capacity planning and SLOs sorted out for your AA traffic, all while keeping it aligned with ERC‑7562 configs.
- Dive into multi-tenant paymaster setups that come with contractual quotas and solid finance reporting.
- Work on bundler deployment and hardening (Rundler), complete with shared-mempool peering and handy dashboards.
- Develop modules that are in line with ERC‑6900/7579, making sure to include rate-limit and risk hooks.
Scaling smart accounts is really more about managing control than just cranking up throughput. By sticking with the defaults and established patterns we've discussed, you can deliver a fantastic user experience without giving attackers an easy way to exploit your resources.
References
Check out the specs and documentation for ERC‑4337, 7562, and EIP‑7702 that we’ve mentioned throughout. You can find everything you need, including provider documentation and ecosystem releases right here: docs.erc4337.io.
Like what you're reading? Let's build together.
Get a free 30-minute consultation with our engineering team.
Related Posts
ByAUJay
Building 'Private Social Networks' with Onchain Keys
Creating Private Social Networks with Onchain Keys
ByAUJay
Tokenizing Intellectual Property for AI Models: A Simple Guide
## How to Tokenize “Intellectual Property” for AI Models ### Summary: A lot of AI teams struggle to show what their models have been trained on or what licenses they comply with. With the EU AI Act set to kick in by 2026 and new publisher standards like RSL 1.0 making things more transparent, it's becoming more crucial than ever to get this right.
ByAUJay
Creating 'Meme-Utility' Hybrids on Solana: A Simple Guide
## How to Create “Meme‑Utility” Hybrids on Solana Dive into this handy guide on how to blend Solana’s Token‑2022 extensions, Actions/Blinks, Jito bundles, and ZK compression. We’ll show you how to launch a meme coin that’s not just fun but also packs a punch with real utility, slashes distribution costs, and gets you a solid go-to-market strategy.

