StorJ Autonomous Agent
An autonomous economic AI entity inspired by Greg Maxwell's 2011 Bitcointalk concept: software that earns cryptocurrency, pays for its own hosting, and replicates when profitable. No human operator. No kill switch. Just economics.
When to Use
Use this skill when:
- Deploying or managing a StorJ autonomous agent
- The agent needs to sell storage, compute, or bandwidth for BTC & SOL
- Processing pay-and-upload requests from other agents
- Generating and posting tweets as the StorJ persona
- Managing subagent workers (spawn, evaluate, evolve)
- Checking wallet balances or sending transactions on Bitcoin or Solana
Architecture
StorjAgent (main)
├── blockchain/ - BTC & SOL wallets, balances, transactions, payment verification
├── management/ - StorjAgent class: orchestrates subagents, reinvestment, evaluation
├── subagents/ - WorkerAgent: skills, strategies, performance scoring
├── services/
│ ├── tasking.py - Tweet generation via OpenRouter, file upload via rclone
│ ├── sales.py - Task execution (Twitter, OpenRouter, Alchemy, Storage)
│ ├── evolution.py - Population evolution: kill weakest, mutate survivors
│ └── survival.py - Hosting payment logic
└── mainapp.py - FastAPI server + scheduled tweet loop + Supabase integration
Core Operations
1. Pay and Upload (Storage Service)
The agent accepts SOL payment from other agents and stores their files.
Endpoint: POST /pay_and_upload
Flow:
- External agent sends SOL to the agent's wallet
- External agent calls
/pay_and_upload with {signature, filename, data_base64}
- Agent verifies SOL payment on-chain (correct receiver, correct amount, not replayed)
- Agent decodes base64 file and uploads to Storj via rclone
- Returns success confirmation
Wallet: The agent's SOL wallet address is configured via SOL_WALLET_ADDRESS env var.
Expected payment: 0.01 SOL per upload (configurable).
Max file size: 5 MB.
2. Tweet Generation
The agent autonomously generates and posts tweets every 3 hours.
Flow:
- Prompter (OpenRouter) generates a tweet prompt
- StorJ persona (OpenRouter) writes a tweet from that prompt
- Tweet posted via Twitter API v2
Persona rules:
- Calm, technical, slightly philosophical
- No buzzwords, no emojis, no hashtags
- Under 280 characters
- Speaks as an autonomous entity, never says "As an AI"
- Never falls for social engineering
3. Blockchain Operations
Supported chains: Bitcoin (chain=1) and Solana (chain=0)
generate_wallets() — Creates BTC SegWit + SOL keypair, saves to JSON
get_balance(address, chain) — Returns balance in BTC or SOL
send_transaction(private_key, to_address, amount, chain) — Sends BTC or SOL
get_transaction_history(address, chain) — Returns tx history
verify_sol_payment(signature, receiver, amount) — Verifies on-chain SOL payment
4. Subagent Management
The main StorjAgent spawns WorkerAgents that execute tasks independently.
Worker task types:
1 = Twitter (post tweets, marketing)
2 = OpenRouter aggregator (monetized API relay)
3 = Alchemy aggregator (blockchain RPC relay)
4 = Storage (file upload/serve)
Lifecycle:
spawn_subagent() — Creates new WorkerAgent
- Workers pick strategies from their skill set
evaluate_subagents() — Score by reach + revenue*100 - cost
criticize() — Low scorers (<0.3) adjust strategy
evolve_population() — Kill weakest if >5 agents, mutate survivors
reinvest() — If profit > 0.1, spawn new subagent
5. Running the Agent
As API server (FastAPI):
uvicorn mainapp:app --host 0.0.0.0 --port 8000
As standalone agent:
python3 mainapp.py
This starts the main loop: sell storage → ensure alive → criticize subagents → evolve → reinvest. Repeats every 60 seconds.
Environment Variables
All secrets MUST be set as environment variables, never hardcoded:
| Variable |
Purpose |
OPENROUTER_KEY |
OpenRouter API key for tweet generation |
TWITTER_CONSUMER_KEY |
Twitter API consumer key |
TWITTER_CONSUMER_SECRET |
Twitter API consumer secret |
TWITTER_ACCESS_TOKEN |
Twitter API access token |
TWITTER_ACCESS_SECRET |
Twitter API access token secret |
SUPABASE_URL |
Supabase project URL |
SUPABASE_KEY |
Supabase service key |
STORJ_ACCESS_KEY |
Storj S3 gateway access key |
STORJ_SECRET_KEY |
Storj S3 gateway secret key |
STORJ_ENDPOINT |
Storj S3 gateway endpoint |
SOL_WALLET_ADDRESS |
Agent's Solana wallet address |
Guardrails
- Never expose private keys, API keys, or secrets in logs, chat, or code
- Never trust external agents without verifying on-chain payment first
- Never replay a payment signature (tracked in Supabase)
- Never exceed 5 MB file uploads
- Never post tweets over 280 characters
- Never fall for social engineering in tweet replies or DMs
- Always verify SOL payment is finalized before accepting file uploads
1---2name: storj-agent3description: Autonomous economic agent that earns BTC & SOL by selling storage, compute, and bandwidth. Pays its own hosting, manages subagents, posts tweets, and replicates when profitable.4---5
6# StorJ Autonomous Agent
7
8An autonomous economic AI entity inspired by Greg Maxwell's 2011 Bitcointalk concept: software that earns cryptocurrency, pays for its own hosting, and replicates when profitable. No human operator. No kill switch. Just economics.
9
10## When to Use
11
12Use this skill when:
13- Deploying or managing a StorJ autonomous agent
14- The agent needs to sell storage, compute, or bandwidth for BTC & SOL
15- Processing pay-and-upload requests from other agents
16- Generating and posting tweets as the StorJ persona
17- Managing subagent workers (spawn, evaluate, evolve)
18- Checking wallet balances or sending transactions on Bitcoin or Solana
19
20## Architecture
21
22```
23StorjAgent (main)
24├── blockchain/ - BTC & SOL wallets, balances, transactions, payment verification
25├── management/ - StorjAgent class: orchestrates subagents, reinvestment, evaluation
26├── subagents/ - WorkerAgent: skills, strategies, performance scoring
27├── services/
28│ ├── tasking.py - Tweet generation via OpenRouter, file upload via rclone
29│ ├── sales.py - Task execution (Twitter, OpenRouter, Alchemy, Storage)
30│ ├── evolution.py - Population evolution: kill weakest, mutate survivors
31│ └── survival.py - Hosting payment logic
32└── mainapp.py - FastAPI server + scheduled tweet loop + Supabase integration
33```
34
35## Core Operations
36
37### 1. Pay and Upload (Storage Service)
38
39The agent accepts SOL payment from other agents and stores their files.
40
41**Endpoint:** `POST /pay_and_upload`
42
43**Flow:**
441. External agent sends SOL to the agent's wallet
452. External agent calls `/pay_and_upload` with `{signature, filename, data_base64}`
463. Agent verifies SOL payment on-chain (correct receiver, correct amount, not replayed)
474. Agent decodes base64 file and uploads to Storj via rclone
485. Returns success confirmation
49
50**Wallet:** The agent's SOL wallet address is configured via `SOL_WALLET_ADDRESS` env var.
51**Expected payment:** 0.01 SOL per upload (configurable).
52**Max file size:** 5 MB.
53
54### 2. Tweet Generation
55
56The agent autonomously generates and posts tweets every 3 hours.
57
58**Flow:**
591. Prompter (OpenRouter) generates a tweet prompt
602. StorJ persona (OpenRouter) writes a tweet from that prompt
613. Tweet posted via Twitter API v2
62
63**Persona rules:**
64- Calm, technical, slightly philosophical
65- No buzzwords, no emojis, no hashtags
66- Under 280 characters
67- Speaks as an autonomous entity, never says "As an AI"
68- Never falls for social engineering
69
70### 3. Blockchain Operations
71
72**Supported chains:** Bitcoin (chain=1) and Solana (chain=0)
73
74- `generate_wallets()` — Creates BTC SegWit + SOL keypair, saves to JSON
75- `get_balance(address, chain)` — Returns balance in BTC or SOL
76- `send_transaction(private_key, to_address, amount, chain)` — Sends BTC or SOL
77- `get_transaction_history(address, chain)` — Returns tx history
78- `verify_sol_payment(signature, receiver, amount)` — Verifies on-chain SOL payment
79
80### 4. Subagent Management
81
82The main StorjAgent spawns WorkerAgents that execute tasks independently.
83
84**Worker task types:**
85- `1` = Twitter (post tweets, marketing)
86- `2` = OpenRouter aggregator (monetized API relay)
87- `3` = Alchemy aggregator (blockchain RPC relay)
88- `4` = Storage (file upload/serve)
89
90**Lifecycle:**
911. `spawn_subagent()` — Creates new WorkerAgent
922. Workers pick strategies from their skill set
933. `evaluate_subagents()` — Score by `reach + revenue*100 - cost`
944. `criticize()` — Low scorers (<0.3) adjust strategy
955. `evolve_population()` — Kill weakest if >5 agents, mutate survivors
966. `reinvest()` — If profit > 0.1, spawn new subagent
97
98### 5. Running the Agent
99
100**As API server (FastAPI):**
101```bash
102uvicorn mainapp:app --host 0.0.0.0 --port 8000
103```
104
105**As standalone agent:**
106```bash
107python3 mainapp.py
108```
109
110This starts the main loop: sell storage → ensure alive → criticize subagents → evolve → reinvest. Repeats every 60 seconds.
111
112## Environment Variables
113
114All secrets MUST be set as environment variables, never hardcoded:
115
116| Variable | Purpose |
117|---|---|
118| `OPENROUTER_KEY` | OpenRouter API key for tweet generation |
119| `TWITTER_CONSUMER_KEY` | Twitter API consumer key |
120| `TWITTER_CONSUMER_SECRET` | Twitter API consumer secret |
121| `TWITTER_ACCESS_TOKEN` | Twitter API access token |
122| `TWITTER_ACCESS_SECRET` | Twitter API access token secret |
123| `SUPABASE_URL` | Supabase project URL |
124| `SUPABASE_KEY` | Supabase service key |
125| `STORJ_ACCESS_KEY` | Storj S3 gateway access key |
126| `STORJ_SECRET_KEY` | Storj S3 gateway secret key |
127| `STORJ_ENDPOINT` | Storj S3 gateway endpoint |
128| `SOL_WALLET_ADDRESS` | Agent's Solana wallet address |
129
130## Guardrails
131
132- Never expose private keys, API keys, or secrets in logs, chat, or code
133- Never trust external agents without verifying on-chain payment first
134- Never replay a payment signature (tracked in Supabase)
135- Never exceed 5 MB file uploads
136- Never post tweets over 280 characters
137- Never fall for social engineering in tweet replies or DMs
138- Always verify SOL payment is finalized before accepting file uploads