Web3 Lab / Smart Solve

Numerical computation, measured for the EVM.

An experimental Solidity framework for evaluating the precision, gas cost, and feasibility of numerical algorithms on Ethereum-style execution environments.

0x01

Solidity
EVM benchmarks

Framework

What Smart Solve is

Smart Solve is a numerical-computation and benchmarking framework written for Solidity. It is a Diamond-based production-path demonstrator built to study the practical constraints behind on-chain numerical work: gas, precision, runtime bytecode, deployment, and execution behavior.

Scope

What it can do

The current benchmark suite covers a range of small, bounded numerical workloads.

01

Root finding

02

Numerical integration

03

Differentiation

04

ODE solving

05

Polynomial evaluation

06

Matrix operations

07

Linear solvers

08

Optimization / steepest descent

Measured results

Benchmark highlights

Selected Diamond-routed measurements from the project. Figures below are intentionally limited to recorded results.

BenchmarkResultConfiguration
Full SmartSolve Diamond deployment / install≈ 25,704,269 gasComplete deployment path
Bisection root finding1,125,674 gas42 iterations
Simpson 1/3 integration80,327 gasn = 2
Centered-difference differentiation62,393 gasDiamond-routed
Euler ODE solve53,837 gas3 steps
Horner polynomial evaluation32,319 gasDiamond-routed
2×2 matrix multiplication68,996 gasDiamond-routed
2×2 Gaussian elimination105,374 gasDiamond-routed
Steepest descent optimization210,385 gasDiamond-routed
MatrixMasterFacet runtime bytecode22,425 bytes

2,151 bytes of EIP-170 headroom

Degree-32 Horner after inlining94,648 gas

down from 154,956 gas on the Diamond route

Fixed-point 1e18 Horner baselineCheaper in simple cases

less precise in the 1/3 rounding case

Method

Two ways to read a benchmark

The framework separates algorithm behavior from the cost of a production-style proxy and facet call path.

Execution pathWhat it measuresIncluded overhead
Harness / directThe algorithm itself in isolation.No Diamond selector lookup or delegatecall.
Facet-directA facet’s implementation path.Facet execution without the Diamond fallback route.
Diamond-routedProduction proxy / facet behavior.Fallback selector lookup and delegatecall overhead.

What this is / what this is not

What this is

  • Experimental Web3 numerical computation framework
  • Gas and precision benchmarking framework
  • Solidity / EVM feasibility study platform
  • Engineering proof-of-work for advanced smart contract systems

What this is not

  • An audited production DeFi math library
  • A universal replacement for off-chain computation
  • A claim that all numerical algorithms are economical on mainnet
  • A guarantee that every benchmark measures full binary128 empirical accuracy

Applications

Where it is useful

01

Feasibility decisions

Web3 teams evaluating whether a numerical method can responsibly run on-chain.

02

Bounded DeFi prototypes

Small, constrained numerical workloads for oracle, risk-model, or DeFi experiments.

03

Optimization studies

Gas and bytecode work for Solidity contracts with math-heavy execution paths.

04

Research and due diligence

Academic EVM research and a concrete technical example for smart-contract review.

Constraints

Gas-cost feasibility has limits

  • Some workloads are only practical at small, bounded sizes.
  • Large matrix and iterative workloads can approach or exceed the 30M gas limit.
  • Heavy scalability tests are opt-in rather than assumed safe defaults.
  • Callback-driven algorithms include callback staticcall cost in their gas measurement.
  • Results distinguish harness/direct, facet-direct, and Diamond-routed execution.

Evidence

Engineering quality and reproducibility

  • Structured benchmark JSON exports
  • Reproducibility metadata
  • Bytecode budget guardrails
  • Deployment artifacts and post-deploy verification
  • Failure and out-of-gas classification
  • Precision-aware tests where available

Smart Solve

Explore the implementation, benchmark artifacts, and experiment design in the public repository.

View on GitHub