SovereignGuard

Zero-Trust Session Keys, Epoch Revocation & Caps

Visit Repo
SovereignGuard banner

About

## The problem it solves

## The Problem

Floating off-chain session key signatures often linger in mempools or with relayers even after a smart account owner initiates a standard revocation. This leaves ERC-4337 smart accounts exposed to front-running and paymaster gas-drain attacks from stale, still-valid signatures.

## The Solution — SovereignGuard

SovereignGuard is a zero-trust account abstraction security layer that adds:

  • **Instant global epoch revocation** — a single `globalEpoch++` call instantly nullifies every outstanding off-chain session key signature, closing the window attackers rely on.
  • **Granular spend caps** — per-transaction and rolling 24-hour daily spend limits, enforced on-chain, to contain the blast radius of a compromised session key.

## Tech Stack

- Solidity 0.8.28

- Foundry test suite (19/19 passing) - Next.js + TypeScript - Tailwind CSS - Glassmorphic dashboard UI

## Key Security Primitives

- Instant global epoch revocation

- Micro-value spend tracking with daily resets - Real-time on-chain execution audit logging

## Challenges we ran into

### 1. Off-Chain Signature Invalidation vs. On-Chain State Sync * **The Challenge:** Standard session key revocation algorithms only flip a boolean flag on-chain. This leaves signed, floating off-chain UserOps lingering in relayers and mempools, exposing the account to front-running exploits before state synchronization completes. * **The Solution:** We architected an atomic `globalEpoch` state variable in `SovereignAccount.sol`. Binding session key validation to the contract's active epoch allows triggering `emergencyRevokeAll()` to increment `globalEpoch++`, immediately invalidating all pending off-chain signed payloads in a single transaction.

### 2. Micro-Value Spend Limit Resets Without Bloated Gas Overhead * **The Challenge:** Tracking 24-hour rolling spending caps (`dailySpendLimit`) usually requires expensive on-chain array iteration or gas-heavy storage updates on every execution. * **The Solution:** Implemented a stateless timestamp window check (`lastResetTimestamp`). If `block.timestamp >= lastResetTimestamp + 1 days`, cumulative spend resets inline inside `executeWithSessionKey()`, keeping gas consumption minimal while guaranteeing strict limit enforcement.

### 3. Real-Time State Synchronization in Frontend * **The Challenge:** Refactoring UI state smoothly to capture epoch increments, active limits, and real-time gas usage across Next.js components without inducing unnecessary re-renders. * **The Solution:** Built a high-performance **Contract Security Audit Log** panel fed directly by structured `SessionKeyExecuted` and `EmergencyRevocationTriggered` event streams.

Screenshots

SovereignGuard screenshot 1SovereignGuard screenshot 2

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

VaultBreaker

AI agent capability broker protecting private keys via Ledger seed & Hedera on-chain spend limits

Ledger Guard

Agent plans DeFi guards; you clear-sign on Ledger; Graph indexes; x402 keeper executes.