hackquest logo

GasGuard

Introducing GasGuard, a decentralized intelligence subnet that predicts gas costs and execution failure risks for complex DeFi transactions before they are executed, helping users avoid consequences

Videos

Project image 1

Tech Stack

React
Solidity
Foundry
Bittensor
ML
FastAPI
SQLite
Python

Description

GasGuard Subnet

A decentralized intelligence subnet that predicts gas cost, execution failure risk, and safety for complex composed DeFi transactions using miner-submitted simulations and validator-enforced scoring.

Core Insight

DeFi composability is powerful but costly. As transactions span multiple protocols, gas usage becomes unpredictable, failures increase, and users lose funds. GasGuard transforms this uncertainty into actionable execution intelligence.

πŸ”΄ Problem 1: Each Contract Call Costs Gas

Description
In composed transactions, users interact with multiple smart contracts in a single execution.

User
 β†’ Contract A
 β†’ Contract B
 β†’ Contract C
 β†’ Contract D

Each interaction introduces:

  • Function dispatch overhead

  • Context switching

  • Validation logic

  • Storage access

Impact

  • Gas costs grow rapidly

  • Execution becomes inefficient

  • Users pay more for the same intent

πŸ”΄ Problem 2: Redundant Work Across Contracts

Description
Independent protocols repeatedly perform the same checks:

  • Balance verification

  • Permission validation

  • Storage reads

Even when these checks were already performed earlier in the same transaction.

Impact

  • Duplicate computation

  • Wasted gas

  • No shared standards to reuse validations

πŸ”΄ Problem 3: Storage Operations Are Expensive

Description
Storage writes (SSTORE) are among the most expensive EVM operations.

In composed transactions, protocols often:

  • Update balances in multiple contracts

  • Persist intermediate states

  • Overwrite the same storage slots multiple times

Impact

  • Gas usage spikes

  • Transactions hit block gas limits

  • Failed transactions still burn gas

πŸ› οΈ What Exists Today as solution

  • Local gas optimizations within individual protocols

  • Layer 2 rollups (lower cost, same structural problems)

  • Manual batching by developers

❌ What Is Missing

  • System-level understanding of composed transactions

  • Cross-protocol gas coordination

  • Predictive tooling to prevent failures before execution

  • Shared optimization standards

Current tools react after failure.
GasGuard acts before execution.

GasGuard does not try to rewrite DeFi protocols.
Instead, it provides execution intelligence that enables better decisions.

It addresses each problem with a specific solution class.

πŸš€ Opportunity 1 β†’ Solution to Problem 1

Transaction Bundlers

What it does

  • Analyzes multi-step transactions

  • Collapses multiple calls into a single optimized execution plan

  • Minimizes external calls and storage writes

Outcome

  • Fewer contract hops

  • Lower gas consumption

  • More efficient execution

πŸš€ Opportunity 2 β†’ Solution to Problem 2

Gas-Optimized Composition Patterns

What it does

  • Defines reusable standards for:

    • Shared validation logic

    • Stateless intermediate execution

    • Shared execution context

Outcome

  • Eliminates redundant checks

  • Reduces repeated storage reads

  • Improves composability efficiency

πŸš€ Opportunity 3 β†’ Solution to Problem 3

Predictive Gas Estimation & Risk Intelligence (Primary Focus)

What it does

  • Simulates full composed transactions

  • Detects storage-heavy execution paths

  • Predicts gas usage and failure probability

  • Warns users before execution

Outcome

  • Fewer failed transactions

  • Reduced wasted gas

  • Higher user trust

Subnet Architecture(Textual Representation)

Transaction Analyzer

↓

Gas Simulation Engine

↓

ML-Based Risk Analyzer

↓

User Warning / Recommendation

Subnet Architecture(Visual Representation)

πŸ‘‰ https://app.eraser.io/workspace/NkHOTU5CX8bUGDV0pzDZ

Core Components

  1. Transaction Analyzer

    • Extracts call depth, protocol types, storage operations

  2. Gas Simulation Engine

    • Runs dry-run simulations on forked state

  3. ML-Based Risk Analyzer

    • Predicts failure probability and risk class

    • Learns from historical transaction outcomes

  4. User Warning Layer

    • Converts predictions into actionable guidance

Incentive & Mechanism Design

🎯 What the Subnet Produces (Intelligence)

  • Gas cost estimates

  • Failure probability scores

  • Risk classification (Low / Medium / High)

  • Failure reason attribution

This intelligence is:

  • Non-trivial

  • Computation-heavy

  • Continuously improvable

πŸ”High Level Flow

User submits transaction payload

↓

Miners simulate & analyze

↓

Validators evaluate prediction quality

↓

Rewards distributed based on accuracy & effort

🧩 Emission & Reward Logic

Who earns rewards

  • Miners β†’ accurate, timely predictions

  • Validators β†’ honest, correct scoring

Reward factors:

Reward ∝ Accuracy Γ— Confidence Γ— Timeliness Γ— Reputation

🀝 Incentive Alignment

Miners

  • Must run real simulations

  • Must produce calibrated predictions

  • Low-quality or spam outputs are penalized

Validators

  • Score miner outputs against ground truth

  • Penalized for dishonest or collusive behavior

  • Compete with other validators

Proof of Intelligence/Proof of Effort

βœ… Proof of Effort

  • Simulation

  • Feature extraction

  • Model inference

  • Cannot be cheaply faked

βœ… Proof of Intelligence

  • Better heuristics β†’ better rewards

  • Better models β†’ higher reputation

  • Learning compounds over time

High Level Algorithm

  1. Validator publishes transaction payload

  2. Miners simulate and predict outcomes

  3. Validators compare predictions

  4. Scores computed using accuracy + calibration

  5. Rewards distributed per epoch

Miner Design

Tasks

  • Simulate composed transactions

  • Predict gas and failure risk

Input

  • Encoded calldata

  • Chain context

Output

{

"estimatedGas": uint,

"failureProbability": float,

"riskLevel": enum,

"confidence": float

}

Performance Metrics

  • Accuracy

  • Calibration

  • Speed

  • Consistency

Validator Design

Evaluation

  • Reference simulations

  • Cross-miner comparison

  • Consensus-weighted scoring

Cadence

  • Per epoch

  • Rolling history

Incentives

  • Honest scoring rewarded

  • Malicious behavior penalized

Business Logic & Market Rationale

πŸ”₯ Why This Matters

  • Millions lost to failed gas fees

  • No neutral execution-risk oracle exists

πŸ₯Š Competition

  • Centralized estimators

  • Wallet heuristics

  • Protocol-specific tools

❌ None are decentralized, composable, and incentive-aligned.

Go-To-Market Strategy

Initial Users

  • DeFi power users

  • Wallet developers

  • Yield aggregators

Distribution

  • Wallet plugins

  • APIs

  • Dashboards

Bootstrapping

  • Boosted early rewards

  • Free risk queries

  • Validator incentives

Tech Stack

Final Project Structure(Textual Representation)

GasGuard Subnet

β”œβ”€β”€ Problem: High gas & failed composed DeFi TXs

β”œβ”€β”€ Solutions:

β”‚ β”œβ”€β”€ Transaction Bundling

β”‚ β”œβ”€β”€ Gas-Optimized Composition Patterns

β”‚ └── Predictive Gas & Risk Intelligence

β”œβ”€β”€ Architecture:

β”‚ β”œβ”€β”€ Analyzer

β”‚ β”œβ”€β”€ Simulator

β”‚ β”œβ”€β”€ ML Risk Engine

β”‚ └── User Warnings

β”œβ”€β”€ Incentive Design (Miners + Validators)

β”œβ”€β”€ Proof of Intelligence & Effort

β”œβ”€β”€ Business & Market Rationale

β”œβ”€β”€ Go-To-Market Strategy

└── Long-Term Adoption Vision

Final Project Structure(Visual Representation)

Progress During Hackathon

GasGuard is currently in the ideation phase

Fundraising Status

Not raised

Team Leader
PPratyush Dutta
Project Link
Sector
DeFiAI