Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 37 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
# Example .env for sovereignagent (DO NOT commit real secrets)
# Replace placeholders with your test wallet and Base RPC information
PRIVATE_KEY=your_test_wallet_private_key
RPC_URL=https://base-goerli.blockscout.com
CHAIN_ID=84531
SUPER_TOKEN=fDAIx
SOVEREIGN_AGENT_ADDRESS=0xYourSovereignAgentAddress
# Example .env for PhantomOperator (DO NOT commit real secrets)
# Replace placeholders with your real wallet and Base RPC information.

# ── Core wallet / chain ──────────────────────────────────────────────────────
PRIVATE_KEY=your_wallet_private_key
PHANTOM_OPERATOR_ADDRESS=0xYourPhantomOperatorAddress

# ── Base chain RPC (mainnet for live registrations) ──────────────────────────
BASE_RPC_URL=https://mainnet.base.org
# Legacy fields kept for SuperfluidService compatibility:
RPC_URL=https://mainnet.base.org
CHAIN_ID=8453

# ── Superfluid streaming token ───────────────────────────────────────────────
SUPER_TOKEN=USDCx
FLOW_RATE=385802469135802

# ── Agent registration ────────────────────────────────────────────────────────
# Public HTTPS URL where the agent accepts requests (used in x402 / Bazaar)
AGENT_SERVICE_ENDPOINT=https://your-agent-domain.example.com/api
# IPFS or HTTPS URI pointing to agent metadata JSON
AGENT_METADATA_URI=ipfs://Qm...
# Price per request in USDCx (6-decimal USDC equivalent, e.g. 0.001 = $0.001)
PRICE_PER_REQUEST=0.001

# ── CryptoSkill.org ───────────────────────────────────────────────────────────
CRYPTOSKILL_API_KEY=your_cryptoskill_api_key
# Override only if the API base URL changes
# CRYPTOSKILL_API=https://cryptoskill.org/api/v1

# ── Coinbase Developer Platform (CDP) x402 Bazaar ────────────────────────────
CDP_API_KEY=your_cdp_api_key
# Override only if needed
# X402_BAZAAR_URL=https://api.developer.coinbase.com/rpc/v1/base

# ── Superfluid x402 Facilitator ───────────────────────────────────────────────
# Override only if needed
# X402_FACILITATOR_URL=https://x402.superfluid.org

# Notes:
# - Keep this file locally and never commit `.env` to source control.
# - For CI, add the same keys to GitHub Actions Secrets instead.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/register_agent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Register Sovereign Agent
name: Register PhantomOperator Agent
about: Register your agent identity (normancomics.*) for priority payouts and marketplace listing
title: "Register Agent: <agent-name>"
labels: onboarding
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superfluid-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
RPC_URL: ${{ secrets.RPC_URL }}
CHAIN_ID: ${{ secrets.CHAIN_ID }}
SUPER_TOKEN: ${{ secrets.SUPER_TOKEN }}
SOVEREIGN_AGENT_ADDRESS: ${{ secrets.SOVEREIGN_AGENT_ADDRESS }}
PHANTOM_OPERATOR_ADDRESS: ${{ secrets.PHANTOM_OPERATOR_ADDRESS }}
FLOW_RATE: ${{ secrets.FLOW_RATE }}
run: node test.js
4 changes: 2 additions & 2 deletions SovereignAgent.js → PhantomOperator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { startSuperfluidFlow, stopSuperfluidFlow } = require('./services/Superflu
const SearchAgent = require('./agents/SearchAgent');
const BrokerAgent = require('./agents/BrokerAgent');

class SovereignAgent {
class PhantomOperator {
constructor() {}

async startDataRemovalTask(userInfo) {
Expand Down Expand Up @@ -52,4 +52,4 @@ class SovereignAgent {
}
}

module.exports = SovereignAgent;
module.exports = PhantomOperator;
76 changes: 68 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# sovereignagent
# PhantomOperator

SovereignAgent — automated privacy-removal orchestration with real-time Superfluid payouts on Base.
PhantomOperator — automated privacy-removal orchestration with real-time Superfluid payouts on Base.

Why SovereignAgent?
- Automated data-broker opt-outs and prioritized threat remediation
Why PhantomOperator?
- Automated data-broker opt-outs and prioritised threat remediation
- Real-time micropayments via Superfluid USDCx on Base (streams & IDAs)
- On-chain agent identity & skill registration (8004scan.io, CryptoSkill.org)
- x402 HTTP payment protocol support (Superfluid facilitator + CDP Bazaar)
- Secure, sandboxed agents and enterprise-ready orchestration

Getting started

1) Configure environment
- Copy `.env.example` to `.env` and fill in your test keys (never commit `.env`).
- Copy `.env.example` to `.env` and fill in your keys (never commit `.env`).
- At minimum set `PRIVATE_KEY` and `PHANTOM_OPERATOR_ADDRESS`.

2) Install Node dependencies
```bash
Expand All @@ -22,15 +25,72 @@ npm ci
node test.js
```

---

Agent Registration

The `npm run register` command (or `node scripts/registerAgent.js`) runs a 5-step pipeline for **each** sub-agent:

| Step | Registry | Contract / URL |
|------|----------|----------------|
| 1 | On-chain Identity Registry | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` (Base) |
| 2 | On-chain Reputation/Skill Registry | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` (Base) |
| 3 | CryptoSkill.org | https://cryptoskill.org/ |
| 4 | Superfluid x402 Facilitator | https://x402.superfluid.org/ |
| 5 | CDP x402 Bazaar | https://docs.cdp.coinbase.com/x402/bazaar |

Required `.env` variables for registration:

| Variable | Description |
|----------|-------------|
| `PRIVATE_KEY` | Agent owner wallet private key (signs on-chain txs) |
| `PHANTOM_OPERATOR_ADDRESS` | Deployed agent wallet address |
| `BASE_RPC_URL` | Base mainnet JSON-RPC (default: `https://mainnet.base.org`) |
| `AGENT_SERVICE_ENDPOINT` | Public HTTPS URL where the agent accepts requests |
| `AGENT_METADATA_URI` | IPFS or HTTPS URI to the agent metadata JSON |
| `CRYPTOSKILL_API_KEY` | CryptoSkill.org API key |
| `CDP_API_KEY` | Coinbase Developer Platform API key (for Bazaar listing) |

Optional:

| Variable | Default |
|----------|---------|
| `PRICE_PER_REQUEST` | `0.001` (USDCx) |
| `X402_FACILITATOR_URL` | `https://x402.superfluid.org` |
| `X402_BAZAAR_URL` | `https://api.developer.coinbase.com/rpc/v1/base` |
| `CRYPTOSKILL_API` | `https://cryptoskill.org/api/v1` |

Run registration:
```bash
npm run register
```

Each step is fault-tolerant — if one registry is unavailable the script logs the error and continues with the rest.

---

Services

| File | Purpose |
|------|---------|
| `services/RegistryService.js` | Ethers.js calls to the identity & reputation registry contracts on Base |
| `services/SkillRegistryService.js` | REST calls to the CryptoSkill.org API |
| `services/X402Service.js` | Superfluid x402 facilitator + CDP Bazaar registration |
| `services/SuperfluidService.js` | Superfluid streaming (start/stop flow) |

Registration & Priority Payouts

Want priority payouts and featured placement? Create a registration issue using the `Register Sovereign Agent` template in `.github/ISSUE_TEMPLATE/register_agent.md` and include your ENS / on-chain identity (e.g., `normancomics.base.eth`).
Want priority payouts and featured placement? Create a registration issue using the `Register PhantomOperator Agent` template in `.github/ISSUE_TEMPLATE/register_agent.md` and include your ENS / on-chain identity (e.g., `normancomics.base.eth`).

Files added in this repo
- `SovereignAgent.js` — orchestrator
- `PhantomOperator.js` — orchestrator
- `agents/SearchAgent.js` — search & threat analysis
- `agents/BrokerAgent.js` — data broker automation (placeholder)
- `services/RegistryService.js` — on-chain identity & reputation registry
- `services/SkillRegistryService.js` — CryptoSkill.org integration
- `services/X402Service.js` — Superfluid x402 & CDP Bazaar integration
- `services/SuperfluidService.js` — Base-compatible Superfluid helper
- `scripts/registerAgent.js` — agent registration CLI
- `test.js` — example runner
- `.env.example` — environment variable template (DO NOT commit secrets)
- `.github/workflows/superfluid-test.yml` — GitHub Actions test workflow
Expand All @@ -41,5 +101,5 @@ Security notes

SEO / Quick Pitch

Automated opt-out workflows + Superfluid streaming payouts on Base — join the SovereignAgent beta for priority payouts and featured listings.
Automated opt-outs + Superfluid x402 streaming payouts on Base — registered with CryptoSkill.org, 8004scan identity & reputation registries, and the CDP Bazaar.

2 changes: 1 addition & 1 deletion agents/SearchAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SearchAgent {

static async performDuckDuckGoSearch(query, num = 10) {
const url = 'https://html.duckduckgo.com/html';
const headers = { 'User-Agent': 'Mozilla/5.0 (compatible; SovereignAgent/1.0)' };
const headers = { 'User-Agent': 'Mozilla/5.0 (compatible; PhantomOperator/1.0)' };
const params = new URLSearchParams();
params.append('q', query);

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "sovereignagent",
"name": "phantom-operator",
"version": "0.1.0",
"description": "Sovereign Agent orchestrator and sub-agents (prototype)",
"main": "SovereignAgent.js",
"description": "PhantomOperator orchestrator and sub-agents (prototype)",
"main": "PhantomOperator.js",
"scripts": {
"start": "node test.js",
"test": "node test.js"
"test": "node test.js",
"register": "node scripts/registerAgent.js"
},
"keywords": [],
"author": "normancomics",
Expand Down
Loading