Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AEGIS

AEGIS is a pre-transaction safety layer for AI agents that move value. It creates the agent and its Hedera wallet, registers its 0G Agentic ID, applies a deterministic Level 1 Policy check, and sends only trusted semantic context to 0G semantic verification. The hackathon uses an explicitly selected testnet TeeTLS profile; production requires mainnet Private/TeeML. Operational funds remain in the Safe; the agent's Hedera wallet cannot move them alone.

The current branch stops at production TEEML_ALLOWED, demo-only TEETLS_HACKATHON_ALLOWED, TEEML_DENIED, or TEEML_FAILED. It does not sign a final DecisionReceipt, request Safe owner signatures, or execute Hedera. Verdict signing and execution signing remain separate future responsibilities. The Graph is the canonical confirmed/historical onchain read layer for the dashboard. Hedera and 0G remain separate Subgraphs and are joined only in the typed GraphQL client.

TeeTLS verifies the broker TEE and signed response, but the upstream model may process plaintext. It is never an automatic fallback and its artifacts are demo-only. TeeTLS ALLOW uses TEETLS_HACKATHON_ALLOWED and releases its UsageHold. A future signer must accept only TEEML_ALLOWED backed by production-private-teeml with sealedInference: true. PostgreSQL makes final verification artifacts immutable and rejects any audit event that does not match the exact verification, action, profile, and commitment tuple.

docs/aegis-current-scope.md is the active scope and overrides conflicting historical architecture, demo, bounty, and implementation notes. Historical diagrams are intentionally not embedded here because they contain superseded trust and execution flows.

Built during ETHGlobal Lisbon using scaffold-hbar, the 0G Compute starter kit, and the Safe{Core} SDK as public references. The unintegrated starter service is not shipped as an AEGIS runtime service. Historical design material includes future DecisionReceipt and co-signature concepts; they are not implemented by the current branch.

  • Historical architecture: docs/AEGIS_ARCHITECTURE.md - design reference only; current scope and interfaces are normative.
  • Current scope: docs/aegis-current-scope.md - active Level 1 and TeeML scope, trust boundaries, handoff, and local commands.
  • Current interfaces: docs/interfaces.md - strict precheck, Policy semantic source, TeeML endpoint, hashes, states, and persistence.
  • 0G semantic verifier: docs/0g/teeml-semantic-verifier.md - production Private/TeeML and explicit hackathon TeeTLS profiles.
  • Decisions: docs/decisions.md - ADR-lite log of locked product/technical decisions.
  • Roadmap: docs/roadmap.md - phased plan from hackathon MVP to beta, expansion, and partnerships, plus the financial projections behind it.
  • Workflow: PLAYBOOK.md - how the team builds, ownership, conventions.

AEGIS repo layout

packages/nextjs             dashboard (Next.js + RainbowKit + wagmi)
packages/agentic-id-contract shared canonical Agentic ID metadata commitments
packages/foundry            contracts (TeeML registry; Safe ABIs)
services/agent-service      agent, wallet, Level 1, 0G verification, registry port
services/cosigner           future final recheck and Safe authorization boundary
docs/                       architecture, scope, decisions

Scaffold-HBAR (Hedera)

A Hedera-ready monorepo for building dApps with Next.js, Hardhat or Foundry, and Hedera networks (testnet, mainnet, local fork). Generated by create-scaffold-hbar or used as the production template when you run npx create-scaffold-hbar@latest.

Prerequisites

  • Node.js >= 20.18.3
  • Yarn - required for the frontend and contract workspaces. The standalone services/agent-service package and its root wrapper scripts use npm. Install Yarn via Corepack: corepack enable && corepack prepare yarn@stable --activate
  • Git
  • If using Foundry: Foundry (forge, cast, anvil)

Quick start

  1. Create a new project (recommended):
 npx create-scaffold-hbar@latest

Follow the prompts to pick a template (blank, payments-scheduler, or hedera-demo), frontend, Solidity framework (Hardhat or Foundry), and network. 2. Or use this repo as the template (e.g. after cloning or downloading):

 yarn install
 yarn hardhat:chain    # terminal 1: start local Hedera-forked node
 yarn hardhat:deploy --network localhost   # terminal 2: deploy to the running fork (8545)
 yarn next:start    # terminal 3: start Next.js app

Open http://localhost:3000 and use the Debug Contracts page to interact with your contracts.

Available templates (create-scaffold-hbar)

The create-scaffold-hbar CLI resolves templates from this repository's template branches. Current built-in templates are:

Template Branch What you get
blank templates/blank-template Minimal baseline scaffold with no opinionated app features; ideal starting point for custom products.
payments-scheduler templates/payments-scheduler Starter for scheduled-payment style flows, with app and contract structure tailored for recurring/payment orchestration patterns using HSS.
hedera-demo templates/hedera-demo Hedera demo/proofwall-style starter focused on showcasing Hedera integrations with Hedera Services[HTS, HCS, MirroNode] and end-to-end demo UX.

Template selection examples

# Interactive
npx create-scaffold-hbar@latest

# Explicit built-in template key
npx create-scaffold-hbar@latest --template blank
npx create-scaffold-hbar@latest --template payments-scheduler
npx create-scaffold-hbar@latest --template hedera-demo

Deploy and verify on Hedera

To deploy or verify on Hedera testnet, you need a deployer account with testnet HBAR. Generate or import one with your selected framework command, such as yarn hardhat:account:generate, yarn hardhat:account:import, yarn foundry:account:generate, or yarn foundry:account:import, then fund it using the Hedera Portal faucet. Without funds, deploy and verify will fail with "Sender account not found".

Hardhat

  • Deploy to Hedera testnet:
    From repo root (you will be prompted to decrypt your deployer key):
    yarn hardhat:deploy --network hederaTestnet
    Or use yarn hardhat:deploy --network hedera_testnet (same network, alternate name).
  • Verify on Hashscan: After deploy, run (no extra arguments needed; uses last deployment):
yarn hardhat:verify:testnet   # chain 296
yarn hardhat:verify:mainnet   # chain 295

Foundry

  • Deploy to Hedera testnet:
    Use a keystore with testnet HBAR (fund via Hedera Portal faucet). From repo root or packages/foundry:
    yarn foundry:deploy --network hedera_testnet
    Or from packages/foundry: make deploy with RPC_URL and account set via env / Makefile.
  • Verify on Hashscan:
    After deploy, run (no extra arguments needed):
    yarn foundry:verify:testnet   # 296
    yarn foundry:verify:mainnet   # 295

Verified contracts appear on Hashscan (testnet) or Hashscan (mainnet).

Local testing with Hedera forking

You can test contracts and the app locally against a Hedera-forked execution environment before deploying to public networks.

Hardhat local workflow

Details and rationale (including localhost vs default hardhat network) are in packages/hardhat/README.md.

  1. Start a local chain (Hedera forking enabled in scripts):
yarn hardhat:chain
  1. Deploy contracts to the running node on http://127.0.0.1:8545:
yarn hardhat:deploy --network localhost

yarn hardhat:deploy without --network localhost targets the in-process hardhat network, not this long-running fork.

  1. Run Hardhat tests:
yarn hardhat:test
  1. Run the app against local contracts:
yarn next:start

Foundry local workflow

This path uses Foundry (packages/foundry) while sharing the same local JSON-RPC started by yarn hardhat:chain from the repo root. Details: packages/foundry/README.md.

  1. Start the local chain first:
yarn hardhat:chain
  1. Run Foundry tests against that JSON-RPC:
yarn foundry:test:local
  1. Optionally run Foundry tests directly against Hedera RPC endpoints (no local node):
yarn foundry:test:testnet
yarn foundry:test:mainnet

This keeps local testing on a single path and avoids chain id drift between different local node commands.

Project layout

  • packages/hardhat — Hardhat config, contracts, deploy/ scripts, tests, verifyHedera.js
  • packages/foundry — Forge config, contracts, script/ deploy scripts, tests, scripts-js/verifyHedera.js
  • packages/nextjs — Next.js app, RainbowKit, wagmi, scaffold config

Network and RPC URLs are in packages/hardhat/hardhat.config.ts or packages/foundry/foundry.toml.

Links

About

AEGIS — protected wallets for AI agents that move money, it prevents unauthorized payments.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages