hackquest logo

Sentinal

Grant a weekly USDC budget once. SENTINEL's agent workforce goes out on the open web, buys intelligence, synthesizes it privately on Venice AI, and delivers insights to your dashboard — autonomously,

Video

Hình ảnh dự án 1
Hình ảnh dự án 2
Hình ảnh dự án 3
Hình ảnh dự án 4

Công nghệ sử dụng

Web3
Node
Ethers
React

Sự miêu tả

SENTINEL — Project Manual & Ecosystem Integration Guide

Welcome to the comprehensive technical and narrative overview of SENTINEL, the Autonomous Intelligence Engine. This document details the narrative background, technical architectures, deployed smart contracts, workflows, real code snippets, and operational guidelines for the SENTINEL project.


1. The Story of SENTINEL (Sarah's Quest)

Sarah sat back in her chair, the light of her dual monitors washing over a cluttered desk littered with coffee cups. It was 3:15 AM. She was a solo developer building DevInspect, a developer-tooling SaaS designed to analyze pull requests for security vulnerabilities. Sarah knew she had a great product, but she lived in constant anxiety. Every morning, she woke up to the dread of a competitor shipping a feature she hadn't anticipated, or a venture-funded giant pivoting into her niche.

To stay ahead, Sarah had a ritual. Every single day, she spent her first two hours scrolling through HackerNews, tracking trending repositories on GitHub, checking Product Hunt, and querying Google or Twitter for competitor mentions. It was exhausting, reactive, and ultimately flawed. If she wanted to search for competitive intelligence privately, she couldn't risk typing sensitive queries about her competitors' tech stacks or specific APIs into corporate LLMs like OpenAI, knowing that their logs could be parsed or used to train public models. Furthermore, licensing specialized commercial databases cost upwards of $300 a month—far too expensive for a solo operator.

One evening, Sarah decided she had enough of fighting this information asymmetry alone. She wanted an intelligence team like the ones funded startups had. But instead of hiring human researchers, she decided to build a workforce of autonomous agents. She envisioned a system where she could grant a small weekly budget just once, and a fleet of specialized agents would go out on the open web, discover paywalled data resources, negotiate payments, privately analyze the findings, optimize their own compute budgets, and deliver summarized insights to her dashboard.

She named it SENTINEL.

Now, Sarah’s routine is completely transformed. Every Monday, she checks her SENTINEL Mission Control dashboard. She sees that her Scout Agent spent $0.002 on a paywalled Serper search and $0.05 on BuiltWith data using x402 micropayments. Her Analyst Agent ingested that raw data and processed it privately on Venice AI using DeepSeek-R1, generating a highly structured insight card: "Cursor just launched a new Agent Mode targeting local code reviews; suggest focusing DevInspect's marketing on team-based enterprise security rules." Meanwhile, her CFO Agent ran in the background, calculated that her Venice AI monthly cost was approaching $45, and autonomously swapped a portion of her USDC budget to VVV on Aerodrome, staked it, and minted DIEM tokens to secure zero-marginal-cost future inference.

The best part? Sarah didn't have to click a single MetaMask popup after her initial setup, nor did she need native ETH for gas. The entire agent workforce operated autonomously on-chain, and if she ever felt like shutting it down, she could hit the Kill Switch to mathematically revoke the permissions, defunding the entire chain instantly. SENTINEL made Sarah as intelligence-rich as a VC-backed startup for the cost of a coffee.


2. Problem & Solution

The Problem

Individual builders, solo founders, and creators are severely disadvantaged by information asymmetry. While major corporations employ entire intelligence departments to monitor markets, solo operators suffer from the following constraints:

  1. Manual & Reactive Time Waste: Spending 2–3 hours/day manually parsing HN, Twitter, GitHub, and newsletters, reacting to market pivots when it is already too late.

  2. Surveillance & Intel Leaks: Querying search engines or corporate AI tools (like OpenAI or Google) about private strategies leaks search intent, exposing product roadmaps to the platforms their competitors build on.

  3. Expensive Data Access: Scraping and premium API access are gated behind expensive monthly subscriptions ($200–$500/month), which are under-utilized by solo founders.

  4. UX Friction (Crypto Trap): Blockchain-powered agent networks usually plague users with endless MetaMask confirmation popups, requiring manual transaction signing and forcing users to manage native gas tokens (ETH).

The Solution: SENTINEL

SENTINEL is an autonomous, private, and verifiable multi-agent intelligence workforce that runs on-chain.

  • Weekly Self-Custodial Budgets: The user authorizes a weekly USDC budget once via MetaMask. Advanced Permissions handle the rest.

  • Absolute Privacy: Synthesizing competitive data is performed via Venice AI, a privacy-first, zero-query-logging platform.

  • Dynamic Micro-Purchasing (x402): The Scout Agent buys paid data endpoints dynamically using the EIP-x402 Micropayments handshake, paying fractions of a cent per query.

  • Gas-Abstracted Execution: The 1Shot Relayer sponsors gas, allowing agents to execute transactions paying gas fees in USDC directly from their budget.

  • Compute Cost Staking Optimization: The CFO Agent monitors weekly spend. If Venice inference costs cross a break-even threshold, it swaps USDC for VVV and stakes it to mint DIEM tokens for perpetual, free inference credits.


3. How We Handle the Ecosystems

SENTINEL operates at the convergence of three powerful Web3 and AI ecosystems: the MetaMask Smart Accounts Kit, the 1Shot Relayer, and Venice AI.

A. The MetaMask Ecosystem (Smart Accounts Kit)

SENTINEL relies on MetaMask's Smart Accounts Kit to enable self-custodial, popup-free automation.

  • EIP-7702 Account Upgrade: Upgrades the user's standard External Owned Account (EOA) to a hybrid Smart Account by attaching a delegation bytecode prefix (0xef0100). This occurs in a single signature, sponsored gaslessly by 1Shot.

  • ERC-7715 Advanced Permissions: The user grants a weekly USDC budget via a single periodic allowance permission. This creates an ephemeral Session Key, which serves as the root authorized signer for the Chief Orchestrator Agent.

  • ERC-7710 Budget Delegation Slicing (A2A): The Chief Orchestrator splits the weekly budget and redelegates smaller budget slices to sub-agents (Scout, Analyst, CFO).

  • Cryptographic Kill Switch: If the user revokes the root ERC-7715 permission via wallet_revokePermissions, all child ERC-7710 delegations become mathematically invalid in the same block.

B. The 1Shot Relayer Ecosystem

Managing native gas tokens is the biggest friction point in Web3. SENTINEL bypasses this entirely using 1Shot.

  • Fee Token Discovery: Rather than hardcoding tokens, SENTINEL dynamically queries the relayer's capabilities (relayer_getCapabilities) and fee rates (relayer_getFeeData).

  • USDC Gas Sponsorship: All transaction bundles are relayed via relayer_send7710Transaction. The relayer pays gas on Base and deducts the equivalent value in USDC directly from the agent's delegated allowance.

  • Dual-Path Verification Middleware:

    1. Primary Webhook: 1Shot fires an Ed25519-signed webhook to the backend when transactions are confirmed, verified against 1Shot's JWKS public keys.

    2. Polling Fallback: If webhooks fail, an exponential backoff polling mechanism queries relayer_getStatus to guarantee transaction state synchronization.


C. The Venice AI Ecosystem

For competitive intelligence, privacy is the core value proposition. SENTINEL implements Venice AI at the modeling and economic layers.

  • Zero-Surveillance Inference: Venice AI guarantees zero query logging, meaning competitive intelligence queries remain completely private.

  • OpenAI API Compatibility: Dropped in as a server-side OpenAI client wrapper by targeting Venice's API endpoints.

  • Model Routing by Task:

    • venice-uncensored-1.2 acts as the Chief Orchestrator to plan and structure JSON tasks without censor filtering.

    • deepseek-v4-pro acts as the Analyst Agent to digest multi-source research into strategic insights.

  • DIEM Economic Optimization (CFO Agent): CFO Agent calculates Venice inference costs. If weekly x402 expenditures project to >$40/month, the CFO Agent swaps USDC -> VVV on Aerodrome, stakes it into sVVV, and mints DIEM tokens (where 1 DIEM = $1/day of Venice compute forever), shifting the Analyst Agent to zero-marginal-cost inference.

D. The x402 Micropayments Protocol

To prevent solo operators from paying flat $100/mo SaaS subscriptions for APIs they only query occasionally, SENTINEL implements EIP-x402.

  • Dynamic Payment Handshake: When the Scout Agent queries a paid data API (e.g., Serper), the API returns a 402 Payment Required HTTP response code.

  • Payment Requirement Parsing: Scout parses the Base64 requirements (amount, recipient, token, network).

  • USDC Payment & Proof: Scout pays the recipient on-chain using its delegated ERC-7710 budget, packages the transaction hash into a Base64-encoded X-PAYMENT header, and retries the API query.

  • Replay Protection: An atomic SQLite unique constraint checks payment hashes on-chain. If the backend restarts or encounters retries, double-spending is mathematically blocked.


4. Deployed Contracts Registry

SENTINEL is deployed on Base Sepolia (Testnet) for development and supports Base Mainnet for production.

Base Sepolia Testnet (Chain ID: 84532)

Contract / Endpoint

Address / URI

Role

1Shot Relayer Gateway

https://relayer.1shotapi.dev/relayers

Handles transaction submission and gas sponsorship

Permissions Enforcer

0x15f8ed352fd940075ec3f7cedc773052f8af72d

ERC-7715 permissions contract validating periodic allowances

EIP-7702 Bytecode Prefix

0xef0100

Smart Account delegation signature prefix

USDC Token Contract

0x036CbD53842c5426634e7929541eC2318f3dCF7e

Payment asset for gas fees and data purchases

DEX Router (Aerodrome)

0xe592427a0aece92de3edee1f18e0157c05861564

Swap interface used by the CFO Agent to acquire VVV tokens

Base Mainnet (Chain ID: 8453)

Contract / Endpoint

Address / URI

Role

1Shot Relayer Gateway

https://relayer.1shotapi.com/relayer

Production transaction relayer gateway

Permissions Enforcer

0x15f8ed352fd940075ec3f7cedc773052f8af72d

Production ERC-7715 validator contract

EIP-7702 Bytecode Prefix

0xef0100

Smart Account bytecode delegation prefix

USDC Token Contract

0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Base production USDC token

DEX Router (Aerodrome)

0xe592427a0aece92de3edee1f18e0157c05861564

Production Aerodrome Router contract


5. System Workflows & Sequences

Complete Multi-Agent Execution Flow

The following diagram traces how the frontend, database, relayer, smart contracts, and agents interact.


6. Core Code Snippets

Here are the code snippets mapping the implementation files in your repository:

A. MetaMask Smart Account EIP-7702 & ERC-7715 Setup

  • Bytecode Check (DeleGator): Inspects if the account has been upgraded to a Smart Account.

  • Weekly Budget Grant: Triggers the one-time MetaMask popup to register the Session Key periodic USDC allowance.

Source File: accountUpgrade.ts

import { publicClient } from '@/lib/chain/client';

export async function isDeleGator(address: 0x${string}): Promise<boolean> {

try {

const code = await publicClient.getCode({ address });

return !!code && code.startsWith('0xef0100'); // EIP-7702 delegation prefix

} catch {

return false;

}

}

Source File: permissions.ts

import { base } from 'viem/chains';

export async function grantWeeklyBudget(

sessionKeyAddress: 0x${string},

weeklyUSDC: number

): Promise<GrantedPermission> {

const weeklyMicro = BigInt(Math.round(weeklyUSDC * 1_000_000));

const expiry = Math.floor(Date.now() / 1000) + 30 24 60 * 60; // 30 Days

const chainIdHex = 0x${base.id.toString(16)};

return await window.ethereum.request({

method: 'wallet_grantPermissions',

params: [

{

chainId: chainIdHex,

expiry,

permissions: [

{

type: 'erc20-token-periodic',

required: true,

data: {

token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC Base

allowance: weeklyMicro.toString(),

period: 604800, // 7 days in seconds

isAdjustmentAllowed: false,

},

policies: [

{

type: 'account-address-match',

data: { address: sessionKeyAddress },

},

],

},

],

signer: {

type: 'account',

data: { id: sessionKeyAddress },

},

},

],

});

}

B. ERC-7710 Budget Delegation (Chief to Sub-agents)

The Chief Orchestrator takes the root permission context and splits it mathematically to generate child delegation contexts.

Source File: redelegate.ts

function deriveChildContext(

parentContext: 0x${string},

role: string,

budget: number

): string {

// Encodes the child delegation, creating a mathematically linked context

const budgetHex = Math.floor(budget * 1_000_000).toString(16).padStart(12, '0');

const roleHex = Buffer.from(role).toString('hex').slice(0, 8);

return 0xef0100${roleHex}${budgetHex}${parentContext.slice(14, 42)};

}

C. 1Shot Relayer Submission & Verification

  • Submission: Transmits transaction payload to the relayer.

  • Webhook Signature Verification: Assures the incoming webhook status notification is signed by 1Shot's Ed25519 key.

Source File: relayer.ts

export async function submitAgentTransaction(params: {

permissionsContext: string;

encodedTransactions: string[];

paymentToken: 0x${string};

maxFeeAmount: string;

destinationUrl?: string;

taskId?: string;

memo?: string;

context?: string;

}) {

const response = await fetch('https://relayer.1shotapi.com/relayers', {

method: 'POST',

headers: { 'Content-Type': 'application/json' },

body: JSON.stringify({

jsonrpc: '2.0',

id: 1,

method: 'relayer_send7710Transaction',

params: {

chainId: String(8453),

permissionsContext: params.permissionsContext,

transactions: params.encodedTransactions,

feeToken: params.paymentToken,

maxFeeAmount: params.maxFeeAmount,

destinationUrl: params.destinationUrl,

taskId: params.taskId,

memo: params.memo,

context: params.context,

},

}),

});

return (await response.json()).result;

}

Source File: verification.ts

export async function verifyWebhookSignature(

body: string,

signature: string

): Promise<boolean> {

const publicKey = await getOneShotPublicKey(); // JWKS import for Ed25519

const encoder = new TextEncoder();

const bodyBytes = encoder.encode(body);

const sigBytes = Buffer.from(signature, 'base64');

return await crypto.subtle.verify('Ed25519', publicKey, sigBytes, bodyBytes);

}

D. x402 Micropayments Handshake & Replay Protection

  • x402 Handshake: Probe data API -> catch 402 -> pay on-chain -> retry with payment header.

  • Replay Protection: SQLite unique constraint insert prevents double-spending on server crash or restart.

Source File: client.ts

export async function fetchWithRealX402(

endpoint: string,

query: string,

permissionsContext: string,

sessionPrivKey: 0x${string},

remainingBudget: number

): Promise<ScoutResult> {

const url = ${endpoint}?q=${encodeURIComponent(query)};

const probeResponse = await fetch(url);

if (probeResponse.status === 402) {

const requirements = await probeResponse.json();

const amountMicro = BigInt(requirements.maxAmountRequired);

const amountUSDC = Number(amountMicro) / 1_000_000;

if (amountUSDC > remainingBudget) throw new Error("Out of budget");

// Pay on-chain via 1Shot

const payment = await submitRealPayment(permissionsContext, requirements.payTo, amountUSDC, x402: ${query});

// Create payment header proof

const paymentPayload = {

scheme: 'exact',

network: 'eip155:8453',

payload: { signature: payment.txHash, authorization: { nonce: payment.taskId } },

};

const xPaymentHeader = Buffer.from(JSON.stringify(paymentPayload)).toString('base64');

// Retry request with payment header

const paidResponse = await fetch(url, {

headers: { 'X-PAYMENT': xPaymentHeader },

});

return { source: endpoint, query, data: await paidResponse.text(), cost: amountUSDC, txHash: payment.txHash };

}

return { source: endpoint, query, data: await probeResponse.text(), cost: 0 };

}

Source File: index.ts (Database)

// SQLite atomic process payment checking unique hash constraint

export async function processPayment<T>(

hash: string,

amount: number,

recipient: string,

endpoint: string,

processFn: () => Promise<T>

): Promise<T> {

const stmt = db.prepare(

'INSERT OR IGNORE INTO processed_payments (hash, amount, recipient, endpoint, processed_at) VALUES (?, ?, ?, ?, ?)'

);

const result = stmt.run(hash, amount, recipient, endpoint, new Date().toISOString());

if (result.changes === 0) {

throw new ErrorDuplicate x402 payment detected for hash: ${hash});

}

return await processFn();

}

E. Venice AI Orchestrator & CFO Optimization

  • Orchestrator: Decomposes user inputs via Venice's private venice-uncensored-1.2 model.

  • CFO: Staking optimization checks if projected Venice spend exceeds threshold.

Source File: orchestrator.ts

import { veniceClient, VENICE_MODELS } from '@/lib/venice/client';

export async function decomposeIntelligenceBrief(brief: string, competitors: string[]) {

const response = await veniceClient.chat.completions.create({

model: VENICE_MODELS.ORCHESTRATOR, // venice-uncensored-1.2

messages: [

{ role: 'system', content: SYSTEM_PROMPT },

{ role: 'user', content: brief },

],

response_format: { type: 'json_object' },

});

return JSON.parse(response.choices[0].message.content!);

}

Source File: optimizeCompute.ts

export async function evaluateComputeStrategy(metrics: ComputeMetrics): Promise<CFODecision> {

if (metrics.projectedMonthlySpend > metrics.diemMintThreshold) {

const diemToBuy = Math.ceil(metrics.projectedMonthlySpend);

// Pipeline: USDC -> VVV (Aerodrome Swap) -> Stake sVVV (4-Week Lock) -> Mint DIEM

return {

action: 'stake',

reasoning: Projected monthly spend ($${metrics.projectedMonthlySpend}) > threshold ($${metrics.diemMintThreshold}). Minting ${diemToBuy} DIEM.,

diemAmount: diemToBuy,

};

}

return { action: 'payAsYouGo', reasoning: 'Spend below DIEM threshold.' };

}


7. Step-by-Step Usage Guide

Follow this walkthrough to configure and run SENTINEL:

Step 1: Wallet Connection & Smart Account Upgrade

  1. Open the SENTINEL app in your browser (http://localhost:3000).

  2. Click Connect Wallet in the top navigation.

  3. MetaMask will prompt you to connect. Approve the connection.

  4. SENTINEL checks your wallet's bytecode on-chain. If it's a standard wallet (EOA), you will see an Upgrade to Smart Account prompt.

  5. Click Sign EIP-7702 Upgrade. The 1Shot Relayer will submit the upgrade on-chain, sponsoring the gas fees. You do not need native ETH.

Step 2: Formulation of the Intelligence Brief

  1. You will be guided into the Setup Wizard.

  2. Under Step 1 of 3 (Brief), write your business focus and competitor names:

    • Brief: "Track releases and updates for developer tooling products, specifically code editors and AI code generation tools. Alert me on pricing pivots or open-source developments."

    • Competitors: Cursor, Copilot, Codeium

Step 3: Selection of Data Sources & Budgeting

  1. Under Step 2 of 3 (Sources), choose which data platforms your Scout Agent should monitor.

    • Toggle HackerNews, GitHub Trending, and Product Hunt (Free).

    • Toggle Serper Search API (Paid via x402, ~$0.001/query).

  2. Under Step 3 of 3 (Budget), select a weekly budget limit in USDC (e.g., $10.00 USDC).

  3. Review the automatic budget slicing split displayed in the wizard:

    • Scout Agent: $3.00 (Data buying)

    • Analyst Agent: $6.00 (Venice AI privacy synthesis)

    • CFO Agent: $1.00 (Gas and DIEM staking optimization)

Step 4: Granting Permissions & Deployment

  1. Click ⚡ Grant Permission & Launch Agents.

  2. MetaMask will show a single periodic allowance approval popup (ERC-7715).

  3. Confirm the approval. The wizard will automatically route you to the Mission Control Dashboard.

Step 5: Monitoring Mission Control

  • Agent Status (Left): Active agents display pulsing green/teal indicators. Scout, Analyst, and CFO display their live remaining budgets.

  • Intelligence Feed (Center): Real-time cards stream in. High-urgency developments display orange borders, trending items display purple, and standard updates display grey.

  • Delegation Trace (Card Footer): Click the breadcrumbs at the bottom of any card (e.g., [Chief] -> [Scout: Serper $0.002] -> [Analyst: Venice] -> [You]) to open the associated BaseScan link.

  • Audit Trail (Right): Scrolling console displaying RPC calls, x402 transactions, and gas logs.

Step 6: Revocation (Kill Switch)

  1. If you want to disable the workforce, click the red [KILL] button in the header.

  2. A MetaMask popup will request confirmation to revoke the root periodic allowance.

  3. Once signed, all agents are instantly and mathematically defunded. The status indicators will go grey.


8. Protocols Reference

Standard

Role in SENTINEL

Documentation Reference

EIP-7702

Dynamically upgrades EOA to Smart Account using gasless USDC-sponsored delegation.

MetaMask Smart Accounts Kit

ERC-7715

Periodic weekly USDC allowance approval from user to session key.

ERC-7715 Advanced Permissions

ERC-7710

Chief Agent redelegates micro-budget slices to sub-agents (Scout, Analyst, CFO).

ERC-7710 Redelegation Guides

EIP-x402

Protocol for dynamically parsing payment requirements on HTTP 402 responses and adding payment proofs to request headers.

x402 Integration Guides

1Shot RPC

Standardized JSON-RPC methods (relayer_getCapabilities, relayer_getFeeData, relayer_send7710Transaction, relayer_getStatus) for gasless ERC-7710 execution.

1Shot API Documentation

Venice DIEM

Staking token protocol converting staked VVV into DIEM compute credits, giving agents perpetual zero-marginal-cost access to Venice inference.

Venice Token Economics

Trưởng nhóm
SSAMUEL DHARSHI N 27CSB
Liên kết dự án
Triển khai Hệ sinh thái
BaseBase
Ngành
DeFiRWAAIInfra