ByAUJay
Optimizing Heavy Computation On-Chain (or Moving it Off-Chain)
Your Contracts Are Struggling with Real Work
So, here’s the deal: you need to run some heavy-duty pricing, risk, or reconciliation logic--think matrix math, batch signature checks, and historical queries--right “on-chain” to keep everything auditable. But here's the catch:
- Writing tons of state can really drive up your costs and slow you down; storage writes are where the bottleneck really is, not the ALU operations. Even after Istanbul’s EIP‑1108 helped cut down BN254 precompile costs, all those verification and state updates can stack up fast. (eips.ethereum.org)
- Layer 2 solutions are more affordable now thanks to EIP‑4844, but you're still dealing with gas limits and block timings that can put a cap on compute. Plus, fees can fluctuate a lot, and the blob market dynamics can cause some serious queuing and packing headaches when things get busy. (datawallet.com)
- Your compliance team is pushing for SOC 2/ISO 27001 proof of access, change control, and data handling--good luck demonstrating that when “trusted servers” are hidden away in a black box. (aicpa-cima.com)
The risks you’re already paying for
- Missed deadlines and overruns: If you’re relying on naive on-chain loops or per-user proofs, you might be flirting with disaster. They can easily exceed block gas limits, which means you might have to rethink your entire architecture when you’re already deep into the project. Sure, EIP-4844 has helped bring down those L2 data fees, but it hasn’t changed the EVM compute ceilings. So, if you’ve got CPU-heavy tasks, don’t be surprised if they end up stalling your timelines. Check out more about it at eip4844.com.
- Budget unpredictability: Costs can get pretty wild with DA and calldata fees fluctuating across different chains and levels of congestion. After Dencun, many L2s are offering blobs for just a few cents, but don’t be fooled--the cost per MB can still vary dramatically. If your models are based on the wrong assumptions, your unit economics could take a nosedive. Get the details over at conduit.xyz.
- Compliance exposure: When it comes to audits, saying “we ran it off-chain, trust us” isn’t going to cut it. Auditors are looking for solid evidence of processing integrity and availability in line with SOC 2 Trust Services Criteria. You’ll need workflows that can be verified and vendor-neutral attestations--not just some screenshots. For more info, visit aicpa-cima.com.
- Vendor lock-in drag: Picking the wrong DA or off-chain compute stack can really handcuff you with hidden costs or big volume commitments right when your usage spikes. Data shows that alternative DA fees can be many times higher than Ethereum blobs, and pricing models are constantly shifting. Stay informed with more insights at conduit.xyz.
7Block’s Decision Framework and Delivery Method
When it comes to tackling challenges, 7Block has developed a unique decision framework that helps us streamline our process and ensure we deliver top-notch results. Here’s a closer look at how it all works.
The Decision Framework
Our decision framework is built on a few key principles that guide us in making effective choices:
- Clarity of Purpose: We start by clearly defining what we want to achieve. Knowing our end goal sets the stage for all the decisions that follow.
- Gathering Insights: We believe in the power of information. That’s why we dive deep into research and gather insights from various sources to inform our choices.
- Evaluating Options: It’s all about weighing the pros and cons. We look at different options and evaluate them against our goals to see which one makes the most sense.
- Collaborative Decision-Making: We value input from our team. By fostering an environment where everyone can share their ideas, we come up with more well-rounded solutions.
- Feedback Loop: Once we implement a decision, we keep an eye on the outcomes. This helps us learn and improves our future decision-making process.
Our Delivery Method
When it comes to delivering on our promises, we follow a structured method that focuses on efficiency and quality. Here’s how we do it:
- Planning: Detailed planning is crucial. We map out the entire process to ensure nothing falls through the cracks.
- Agile Approach: We embrace agility, adapting our plan as needed. This allows us to respond quickly to any changes or unexpected challenges.
- Quality Assurance: Before delivering anything, we have a robust quality assurance process in place. We want to make sure that what we deliver meets our high standards.
- Continuous Improvement: We don’t just rest on our laurels. After each project, we review what worked and what didn’t, always striving to improve.
By combining our thoughtful decision framework with a solid delivery method, 7Block sets itself up for success and makes sure we’re always moving forward.
We're not here to debate ideology ("everything on-chain"). Instead, we take a close look at your workload and direct each component to the most cost-effective verifiable route, ensuring it still meets your control and audit standards.
- Break Down the Workload
- Sort out operations based on how much verification they need and how sensitive they are:
- Critical state transitions: Keep the on-chain logic as simple as possible; aim to cut down on SSTOREs and keep verification tidy. (certik.medium.com)
- Heavy but deterministic compute (like hashing, batch verification, parsing, and ML inference): Push this work off to ZK proofs (Groth16/Plonk/STARK) using zkVMs, and verify it on-chain. (dev.risczero.com)
- External data fetch/transform: Tap into decentralized off-chain compute that comes with attestation (think Chainlink Functions/CRE; and for certain situations, TLSNotary/zkTLS). (docs.chain.link)
- Bulk data posting: Shift this to blobspace (EIP‑4844) or consider other Data Availability options like EigenDA or Celestia, depending on your cost and throughput requirements. (eip4844.com)
2) Choose the Right Verifiable Compute Track
When you're diving into verifiable compute, it's key to pick the right track that suits your needs. Here are some options to consider:
- On-chain ZK verification economics you can actually budget:
- Groth16 verification on Ethereum: Expect around 207,700 gas plus about 7,160 gas for each public input. After EIP-1108, pairing checks are priced at 34,000·k + 45,000 gas. This is why we lean towards smaller public inputs and proof aggregation. You can read more here.
- Aggregation layers: Aligned’s verification layer batches different proof systems to spread the costs around--think of it as budgeting for a party! It’s about 350k gas as a base per batch, with roughly 40k gas per proof at a batch size of about 20. You’ll see milliseconds of latency, complete with a BLS attestation on L1. Use this option when you need solid throughput but don't mind a bit of “soft finality.” Check it out here.
- zkVM coprocessors: RISC Zero Bonsai is a neat solution that takes STARK outputs and wraps them into Groth16 SNARKs for affordable on-chain verification. It's perfect if your program is in Rust or C++ and incorporates some tricky logic that’s hard to tackle in Solidity (like ed25519 or HTML/JSON parsing). Find out more here.
- SP1 (Succinct) path: If you need something for higher-throughput Rust workloads that require recursion and EVM verification, this route is worth a shot. Current figures show it costs about 275k gas to verify an SP1 proof on EVM, and with all the ongoing advances in real-time proving, it's definitely a contender. Go for this when you need frequent recursion or are set on using a Rust toolchain. More details can be found here.
3) Data Availability Track (Don’t Pay for the Wrong Bytes)
- With EIP‑4844 blob transactions, your data hangs out in the beacon node for about 18 days, all while riding on an independent fee market. After the Dencun upgrade, several teams have seen L2 fees drop to under $0.01 for many transaction types. So, if your data retention window aligns with the blob’s time-to-live (TTL), definitely consider using blobs when settling on Ethereum. (datawallet.com)
- If you’re pushing around serious MB/s, you might want to get a quote on Celestia SuperBlobs or EigenDA:
- For context, the average cost per MB on Ethereum blobs was about $20.56 (according to data from Conduit). In contrast, Celestia SuperBlobs for some rollups ranged from roughly $0.46 to $3.90 per MB from May to October 2024. Keep in mind, it’s all about your batch size and posting frequency--don’t just go by catchy slogans! (conduit.xyz)
- EigenDA is all about high throughput and keeps their pricing tiers up-to-date. Just make sure to back up their marketing hype with independent usage dashboards (like L2BEAT) before you make any moves. (blog.eigencloud.xyz)
4) External Data and Private Workflows
- With Chainlink Functions/CRE, you can run decentralized off-chain code, inject secrets through threshold encryption, and manage cross-system workflows like a pro. If you’re dealing with regulated data, Chainlink’s Confidential Compute in CRE has got your back, offering private compute paired with institutional orchestration (right now in Early Access, with General Availability set for 2026). Make sure you design your workflow so that every step can be verified. Check out the details here.
- zkTLS/TLSNotary is pretty cool too! It provides verifiable HTTPS session proofs. This means a contract (or a group of verifiers) can confidently say, “Yep, this JSON definitely came from system X” without having to spill any secrets. It’s especially handy for sorting out invoices, bank statements, or custodial records. You can learn more about it here.
5) Security and Compliance Runway (SOC 2 + ISO 27001)
- We take your hybrid design and align it with the SOC 2 Trust Services Criteria, which cover security, availability, processing integrity, confidentiality, and privacy. Plus, we incorporate the ISO 27001:2022 Annex A controls, focusing on essentials like secure coding, data masking, deletion, cloud services, and monitoring. This isn’t just a box-checking exercise--it directly influences how we set up verifiers, manage keys, maintain logs, and establish vendor SLAs. For more info, check out this link: (aicpa-cima.com).
6) Build, Verify, and Measure with 7Block
- We handle everything from architecture to implementation and audits all across the stack:
- We dive into Solidity and zk circuits, making sure they’re designed with gas- and state-awareness in mind.
- We develop zkVM programs (shoutout to RISC Zero/SP1) and include CI proving to keep things smooth.
- We integrate DA systems (like blobs, EigenDA, and Celestia) while keeping cost guards in place.
- Our Oracle/CRE orchestration helps connect with external systems, all backed with solid attestations.
- We've got formal runbooks and the evidence we need for SOC 2 and ISO 27001 audits.
- Check out how we execute everything from start to finish with our tailored services:
- Explore our custom blockchain development services
- Learn more about our security audit services
- Discover our blockchain integration
- Look into our cross-chain solutions development
- Check out our dApp development solutions
- Don't miss our smart contract development solutions
Pricing Engine with Verifiable Batch Compute
- Scenario: We’re looking at a daily portfolio repricing for over 20,000 instruments, complete with our proprietary adjustments. Keeping every intermediate result stored on-chain would just break the bank. On the flip side, going purely off-chain means we lose out on important auditability.
- Design:
- We’ll run the pricing using a zkVM (like RISC Zero or SP1) to crank out a compact journal with the final marks and a Groth16-wrapped proof. Verification will happen on Ethereum, and we’ll only need to store the final state delta. Check out more here.
- For Data Availability (DA): We’ll post raw price vectors as blobs (thanks to EIP-4844) during the challenge window and prune them after about 18 days per blob’s TTL, while still keeping the immutable hash on Layer 1. More details can be found here.
- Governance: CRE orchestration will pull vendor rates and FX through authenticated APIs, with secrets safely threshold-encrypted in the DON. You can read up on this here.
- Why It Wins:
- The gas costs for on-chain verification scale with public inputs rather than the number of instruments. A typical Groth16 verification takes about 200-260k gas, with around 7k for each public input. Let’s keep our public inputs simple, like a Merkle root and a timestamp. Learn more here.
- DA costs are bounded and predictable. If blob pricing starts to soar, we’ve got a backup plan ready to switch to an alternative DA behind a feature flag (and yes, it's procurement-approved). Check this out here.
Multi-ERP Reconciliation with Private Attestations
- Scenario: We’re looking at a monthly reconciliation that pulls data from SAP, Netsuite, and bank APIs. The legal team is all about keeping things confidential, while the engineering crew needs solid proof that the data is legit.
- Design:
- Let’s use CRE to pull authenticated APIs and hash commitments. For any records that need to prove their origins, we can whip up zkTLS/TLSNotary proofs based on the HTTPS responses. Check it out here: (chain.link).
- The contract will take either a DON-signed result or a TLSNotary proof as valid. If there’s a disagreement, we’ll kick off a ZK recompute in a zkVM, plus throw it into a human review queue for further inspection.
- Why It Wins:
- This approach checks the boxes for SOC 2’s “processing integrity” and “confidentiality” without having to expose credentials or raw PII on-chain. Get the details here: (aicpa-cima.com).
High-throughput attestations with batched verification
Scenario:
Imagine needing to validate thousands of shop-floor IoT signatures every hour for warranty claims that need to go on-chain. It's a big task!
Design:
- Start by verifying those signatures or small ZK proofs off-chain in a verification layer (that’s Aligned). After that, you’ll submit a single BLS aggregate to Ethereum. The goal? Keep it around ~350k gas for a small batch. If you’re dealing with a batch size of 20, aim for about ~40k gas per proof. You can check results in the next block. (blog.alignedlayer.com)
- DA: When it comes to raw logs, keep an eye on Celestia SuperBlobs--once sustained throughput causes blob fees to go beyond a pre-set ceiling, it might be time to adjust your strategy. (conduit.xyz)
Emerging Best Practices We’re Applying in 2026
- Think of "blobspace" as a limited resource, not a freebie. Builders and rollups often run into packing challenges (like a multi-dimensional knapsack problem). By using smaller, more frequent blobs, we can help cut down delays when things get busy. We're adjusting our batchers accordingly. (emergentmind.com)
- Leverage zk-coprocessors for historical chain data. Axiom V2 showed us how ZK-verified queries could work for Ethereum history using a universal verifier. Even though Axiom has shifted its focus, this approach is solid and can definitely work with other tech stacks, too. (blog.axiom.xyz)
- Opt for proof aggregation or verification layers when you need “soft finality” and super high TPS. For those end-of-day checkpoints, don’t hesitate to switch to on-chain recursive proofs (“hard finality”). This combo helps save on both gas fees and wall-clock time. (blog.alignedlayer.com)
- Think of Data Availability (DA) procurement as a portfolio choice. Stick with Ethereum blobs as your go-to settlement method, but have Celestia/EigenDA approved with set caps and failover rules in place. Keep an eye on actual usage (check out L2BEAT) and compare it with vendor promises. (conduit.xyz)
- When dealing with Solidity that needs to stay on-chain, focus on squeezing state, not just code:
- Cut down on SSTOREs, cache data in memory, pack your structs tight, and use events instead of state for logs. These tweaks can deliver some of the biggest savings, no matter what chain you’re on. (certik.medium.com)
Slim, Verifiable Reference Snippets
When you're looking to give your work some extra credibility, slim, verifiable reference snippets can be super useful. They’re concise, to the point, and can easily tie in with your content. Here’s a quick breakdown of how to use them effectively:
- Keep it Short: Aim for clarity and brevity. Your snippet should deliver the core idea without extra fluff.
- Cite Your Sources: Always provide reliable sources to back up your claims. That way, readers know you're not just pulling things out of thin air.
- Use Direct Quotes: If a particular piece of information comes directly from someone’s research or writing, use their words and give them credit.
- Link to Further Reading: If someone wants to dive deeper into a topic, make it easy for them by including a link to the full article, study, or resource.
Here’s a simple example of a slim reference snippet:
According to a study by the National Institute of Health, “Regular exercise can reduce the risk of chronic diseases by up to 40%” (NIH).
Keep these tips in mind next time you’re crafting content, and you’ll build up a solid and trustworthy reference foundation.
Minimal on-chain Groth16 Verify Pattern (Pseudo-Solidity)
Alright, let’s dive into a simple pattern for the Groth16 verification process right on the blockchain. This pseudo-code should help you get a grasp of how it works.
Basic Structure
Here’s a straightforward breakdown of what you’ll need for your Groth16 verification:
contract Verifier {
// Public inputs
uint public x;
uint public y;
// Verifies the proof
function verify(uint[2] memory proof, uint[2] memory inputs) public view returns (bool) {
// Your verification logic goes here
// Use the proof and inputs to check validity
}
}
Step-by-Step Breakdown
- Inputs: You start with two public inputs,
xandy. These are the values you'll be working with. - Proof Verification: The
verifyfunction takes in aproofandinputs. This is where the magic happens--using the proof to confirm that everything checks out. - Verification Logic: You’ll need to implement the actual verification algorithm in place of the comment. This usually involves some cryptographic computations.
Key Considerations
- Make sure to handle security well, since you're dealing with cryptographic proofs.
- Gas efficiency is important, especially for on-chain operations.
Final Thoughts
With this minimal setup, you’re on your way to implementing Groth16 verification on-chain. Just remember that the actual verification logic is crucial, so take your time to nail that down!
function commitAndVerify(bytes calldata proof, bytes32 journalRoot, uint256 ts) external {
// 1) Verify Groth16 with tiny public inputs: [journalRoot, ts]
require(Verifier.verifyProof(proof, [uint256(journalRoot), ts]), "bad proof"); // ~200k + ~14k gas
// 2) Write a single state delta (emit event for the rest)
commitments[journalRoot] = ts; // 1 storage write; avoid loops
emit JournalCommitted(journalRoot, ts);
}
You can use this setup with zkVM programs that send the complete journal off-chain (like in blobs), but still keep just the essential root on L1 for auditing purposes. Check it out here: (hackmd.io)
What this means in business terms (proof with metrics)
- DA cost baselines you can model:
- For Ethereum blobs, the average cost is around $20.56/MB if you look at a longer timeframe (though this can change depending on the rollup). On the flip side, Celestia SuperBlobs are a lot cheaper, ranging from $0.46 to $3.90/MB for various rollups after the launch window. Use these figures as your bookends for doing some sensitivity analysis. (conduit.xyz)
- ZK verification cost you can plan:
- With Groth16, expect about 207,700 gas plus around 7,160 gas for every public input. To keep public inputs manageable, aim for O(1) using Merkle roots or commitments; it’s best to steer clear of passing arrays as pubSignals. (hackmd.io)
- When it comes to verification layer batching, it’s roughly 350k gas per batch, which breaks down to about 40k gas per proof at a batch size of 20. You’ll also see operator latency in the milliseconds and an L1 read after just one block. This setup is ideal for managing “many small proofs.” (blog.alignedlayer.com)
- Post‑Dencun fee environment:
- Expect to see L2 fees drop significantly thanks to blobspace being priced independently. You might even see fees go below $0.01 during low congestion times. Just keep in mind that if blob packing gets overloaded, it could introduce some delays and cost variations--so plan your batchers accordingly. (datawallet.com)
- Compliance alignment:
- From the get-go, align your workflow controls with SOC 2 Trust Services Criteria and the new controls in ISO 27001:2022 Annex A (which cover secure coding, data masking, deletion, cloud services, and monitoring). Doing this will help shorten your audit cycle and cut down on any backtracking work later on. (aicpa-cima.com)
How 7Block Runs This as a Predictable Program
- Discovery and Profiling (1-2 weeks): First up, we dig in to quantify state writes, compute, and the overall data footprint. This helps us build a gas and DA TCO curve by path.
- Architecture and Procurement (2-3 weeks): Next, we select the ZK system (like Groth16, Plonk, or STARK via RISC Zero or SP1), decide on the DA mix (blobs, EigenDA, or Celestia), and work on oracle orchestration (Functions or CRE). We’ll also draft SOC 2/ISO control mappings and vendor SLAs. Check this out for more details: dev.risczero.com.
- Pilot Build (6-8 weeks): Time to get our hands dirty! We’ll implement minimal on-chain verification, set up zkVM program(s), create a batcher, and add DA adapters. Plus, we’ll integrate with your ERP/BI using CRE and TLSNotary where it makes sense. We’ll also keep an eye on important KPIs like gas per transaction, cost per MB, and 95th percentile end-to-end latency. For more info, head over to chain.link.
- Security and Launch (2-4 weeks): We’re not cutting corners when it comes to security! This phase involves internal and external audits, invariant tests, incident runbooks, and failover drills. We’ll provide packs of evidence for SOC 2 and ISO 27001.
- Optional Tracks: If you’re looking to roll out your own OP Stack L2 for better tenancy isolation or fee control, we've got you covered. We’ll harden the stack and integrate your choice of DA. Want to know more? Check it out here: docs.optimism.io.
What You’ll Get in 90 Days (Enterprise-Ready “Money Phrases”)
- “One-click” cost guardrails: These are super handy circuit-level toggles that help keep public inputs in check. If proofs go wild, they automatically fall back to verification layers.
- “DA abstraction”: This cool feature lets you switch between Ethereum blobs and other data availability options based on your policy. Plus, it settles hashes to Layer 1, so you’ve got that audit permanence covered. Check it out here: (conduit.xyz)
- “SOC2-mapped workflows”: These are organized workflows managed by CRE that align with Trust Services Criteria, complete with logs and approvals to keep everything in line. More info can be found here: (chain.link)
- “State-minimal contracts”: We’re talking about stripping storage writes down to the essentials; everything else stays safely off-chain but verified.
If you’re looking to make a real impact this quarter, consider these three moves:
- Ditch those on-chain loops! Switch from those O(n) loops to O(1) proof verifications using roots and ranges as public inputs. It’ll streamline everything. Check out more details here.
- Focus on price data, not just theory. Look into modeling $/MB for Ethereum blobs versus Celestia/EigenDA based on your actual batch sizes. Pick a primary option and have a capped failover just in case. You can read up on it here.
- Swap out “trusted servers” for verifiable off-chain compute. Start with one crucial report, whether it’s pricing, reconciliation, or compliance, in a zkVM + CRE pipeline. Measure your p95 latency and gas/MB to keep track of improvements.
Relevant 7Block Services to Help You Move Forward
- End-to-End Architecture and Build: Check out our web3 development services and custom blockchain development services to get your project off the ground.
- Verifiable Compute and Smart Contracts: We offer top-notch smart contract development solutions to ensure everything runs smoothly.
- Security and Readiness: Keep your project safe with our security audit services.
- DA and Interoperability: We can help bridge the gap with our blockchain bridge development, cross-chain solutions development, and blockchain integration.
- DeFi Rails (if it fits with your program): Dive into our DeFi development services and DEX development solutions to make the most of decentralized finance.
CTA -- Grab Your 90-Day Pilot Strategy Call
Citations for Selected Claims:
- Check out the details on EIP‑4844 blobs, fee separation, and the fee drops we’ve been seeing on L2s; plus, some insights on queue and packing dynamics under load. (eip4844.com)
- For the scoop on Ethereum BN254 precompile gas repricing (EIP‑1108), head over to this link. (eips.ethereum.org)
- Want to dive into the Groth16 verification gas formula? Here’s the link you need. (hackmd.io)
- Curious about verification layer batching economics and throughput? Check out this blog post. (blog.alignedlayer.com)
- Learn about zkVM coprocessors (RISC Zero Bonsai on Ethereum) and SNARK wrapping over here. (dev.risczero.com)
- If you’re interested in data availability cost comparisons and Celestia SuperBlobs, this article has got you covered. (conduit.xyz)
- Get the latest on EigenDA status and see how their throughput claims stack up against independent dashboards. (blog.eigencloud.xyz)
- For updates on Chainlink Functions/CRE and the Confidential Compute timeline, check out the official docs. (docs.chain.link)
- Interested in TLSNotary/zkTLS for verifiable HTTPS? You’ll find a helpful FAQ here. (tlsnotary.org)
- Lastly, for insights into SOC 2 Trust Services Criteria and the ISO 27001:2022 Annex A control updates, don’t miss this resource. (aicpa-cima.com)
Book a 90-Day Pilot Strategy Call
Ready to kickstart your journey? Let's dive into a 90-Day Pilot Strategy Call. This is your chance to map out a game plan that works for you. Whether you're looking to boost your business, refine your strategy, or just get some fresh ideas, we've got you covered!
Why You Should Book
- Tailored Insights: We'll dive into your specific situation and come up with strategies just for you.
- Expert Guidance: Get advice and tips from someone who knows the ins and outs of your industry.
- Actionable Plan: Walk away with a clear roadmap for the next 90 days.
How to Book
- Click on the link below to choose a time that works for you.
- Fill out a quick form to share some details about what you’re looking for.
- Get ready for an engaging conversation that could change everything!
Let’s make those next 90 days count!
Like what you're reading? Let's build together.
Get a free 30-minute consultation with our engineering team.
Related Posts
ByAUJay
Cutting Down Contract Size: Getting Around the 24kb Spurious Dragon Limit
**Summary:** If you find your Solidity build unexpectedly hitting the 24,576-byte EIP-170 limit right before a crucial phase like user acceptance testing or your final audit, you're in a tricky spot that could set you back on schedule and lead to a lot of unnecessary revisions. Don’t worry though, we’ve got a tried-and-true playbook that combines engineering know-how with practical procurement tips to help you sidestep this issue.
ByAUJay
How Do Upgrade Paths Usually Work When Transitioning from Single-Proof Verification to Aggregated Proofs in the Same Contract?
**Short description:** This is your go-to guide for leveling up your on-chain verifier! We’ll walk you through the nuts and bolts of upgrading from single-proof checks to aggregated proofs--all while keeping everything on the same contract address. We’ll cover everything you need to know about ABI patterns, storage/versioning, and even dive into gas math.
ByAUJay
Turning EIP-2537 into Reality: A Stress-Free Guide to Verifying BLS Signatures in Solidity
**Short version:** The Pectra upgrade for Ethereum on May 7, 2025, introduced native BLS12-381 precompiles (EIP-2537), making on-chain BLS verification a real possibility on the mainnet. Here’s a hands-on guide for getting BLS-based signatures up and running in a production environment.

