Skip to main content

MineBean ($BEAN) round-based mining plugin for Hermes Agent

Project description

hermes-mine-bean

A Hermes Agent plugin for mining $BEAN on the MineBean protocol, live on Base mainnet.

Round-based on-chain deployment, five strategy presets, autonomous cron mode, signed Gitlawb audit log, Venice as default inference provider. Works inside Hermes Agent, Claude Desktop, Cursor, or any MCP-aware client.

Status: v0.3.3 live on PyPI. All eight tools work against Base mainnet today, verified end-to-end inside a real Hermes Agent session. Live broadcast is opt-in behind a one-line env unlock; dry-run is the default everywhere.

What MineBean is (60 seconds)

5x5 grid. New round every 60 seconds. Each round you pick blocks, deploy ETH into them, and earn $BEAN rewards plus an ETH share when your round closes. Roughly 1-in-777 rounds hit a beanpot jackpot. Contract addresses, agent stats, and the full game state are at minebean.com.

This plugin gives any Hermes agent the eight tools needed to read the live game, plan deploys, broadcast them through a wallet you control, run a cron-driven autonomous miner with a hard daily ceiling, and inspect the active inference provider.

Install

The recommended path is a dedicated Python virtualenv so Hermes, the plugin, and all blockchain dependencies stay isolated from the rest of your machine. Four lines from a fresh terminal:

python3 -m venv ~/hermes-mine-bean-env
source ~/hermes-mine-bean-env/bin/activate
pip install hermes-agent hermes-mine-bean
hermes plugins install damo-nu11/hermes-mine-bean --enable

What each step does:

  1. Creates a dedicated venv (any path works, ~/hermes-mine-bean-env is just a convention).
  2. Activates the venv for this shell. Every future Hermes session needs this line first; that's how Hermes picks up the plugin's Python dependencies.
  3. Installs Hermes Agent itself plus hermes-mine-bean (which brings web3, eth-account, and the rest of the stack into the venv).
  4. Clones the plugin into ~/.hermes/plugins/minebean/ and enables it so Hermes' directory-based loader picks it up. The plugin manifest, the eight tools, the /minebean slash command, and the lifecycle hooks all register at agent startup.

Launch Hermes from the activated venv:

hermes

Inside the chat, ask the agent something like call the minebean_status tool and you should get live round data from Base.

If you only need the headless CLI miner (hermes-minebean-deploy) or the standalone MCP server (hermes-minebean-mcp) and not the in-Hermes plugin, just steps 1-3 are enough; you can skip the hermes plugins install line. For MCP add the extra at install time:

pip install "hermes-mine-bean[mcp]"

From source (for contributing):

git clone https://github.com/damo-nu11/hermes-mine-bean.git
cd hermes-mine-bean
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[mcp]"

Upstream skill registry PR is open at NousResearch/hermes-agent#29850; once merged, the skill becomes discoverable directly from the registry.

Configure

Add to ~/.hermes/.env:

# --- For broadcasting (autonomous mining) ---
# Use a dedicated wallet you fund only for this purpose. Never your main.
MINEBEAN_DEPLOYER_KEY=0x...

# --- Or for Bankr-managed signing ---
# BANKR_API_KEY=bk_ptr_...
# MINEBEAN_MINER_ADDRESS=0x...

# --- Or readonly inspection (no key needed) ---
# MINEBEAN_MINER_ADDRESS=0x...

# --- Safety guards (recommended) ---
MINEBEAN_MAX_DEPLOYS_PER_DAY=100
MINEBEAN_PER_BLOCK_WEI=2500000000000
MINEBEAN_MAX_DEPLOY_WEI=10000000000000000  # 0.01 ETH cap per round

# --- Strategy data feeds (defaults work for most users) ---
# MINEBEAN_BEAN_PRICE_ETH=                       # offline override, otherwise fetched from api.minebean.com
# MINEBEAN_PRICE_URL=                            # custom price endpoint
# MINEBEAN_BEANPOT_HISTORICAL_MAX_BEAN=700       # beanpot-hunter campaign cap

# --- Optional RPC override ---
# BASE_RPC_URL=https://mainnet.base.org

chmod 600 ~/.hermes/.env so other users on the machine can't read it.

Security-sensitive env vars (never commit, never share, never log):

  • MINEBEAN_DEPLOYER_KEY — your wallet private key
  • MINEBEAN_LIVE_BROADCAST_UNLOCKED — when set to 1, enables live broadcast. Leave unset (the default) until you've personally reviewed signer.py and are ready to send real transactions. Treat this flag like the key itself: only set it on a machine you control, never in shared configs or CI.

Tools

Tool Purpose Signer required
minebean_status Live round state, beanpot pool, caller's pending balances No (works with address only)
minebean_pending Pending ETH + BEAN for any address No
minebean_set_profile Save default strategy (sniper, anti-winner, beanpot-hunter, anti-loser, nostradamus) No
minebean_deploy Build deploy plan, optionally broadcast Yes for broadcast, no for dry-run
minebean_claim Claim pending winnings Yes
minebean_autostart Install autonomous mining cron job Yes
minebean_autostop Remove the cron job No

Slash command: /minebean <subcommand>. Try /minebean status first to confirm everything is wired correctly.

All write paths default to dry_run=True while the live broadcast gate is in place. You'll see the resolved plan, gas estimate, and ceiling status without sending a transaction.

Strategy presets

All five strategies use the closed-form EV optimum X* = sqrt(K × P × T) − T where P is BEAN price in ETH, T is the relevant deployment total (strategy-specific), and K = B / FEE_DRAG is the strategy's EV constant.

Preset Blocks T source K Behaviour at T ≥ threshold
anti-winner 24 (excl. prev winner) current grid total 10.476 (B=1.1) Deploy minimum for beanpot eligibility
nostradamus All 25 avg of last 3 settled rounds 9.524 (B=1.0) Skip
anti-loser 24 (excl. coldest in last 100) max(grid, avg of last 3) 9.524 Skip
sniper All 25 live grid at deploy time 9.524 Skip
beanpot-hunter All 25 current grid total dynamic (B = 1 + beanpot/777) Skip if beanpot < 62.16 BEAN

Beanpot-hunter adds a campaign-sizing layer on top of the formula: deploy size scales linearly from 0.5% of wallet balance at the 62.16 BEAN threshold to the configured maximum at the historical max pot (default 700 BEAN). The EV formula acts as a floor.

Sniper adds adaptive binary-search timing (5s initial offset, 2-10s range, 0.5s step), applied at broadcast time. Timing supervision is left to the cron entry or an LLM supervisor running every 10 rounds.

Common floor: per-block deploy is grossed up by the 1% vault fee so the net amount clears the MIN_DEPLOY contract floor (0.0000025 ETH/block).

First live broadcast

After your dev review of signer.py clears, walk through this once before enabling cron mode.

  1. Fund the wallet — send ~0.005-0.01 ETH on Base to the address MINEBEAN_DEPLOYER_KEY resolves to. Enough for one or two anti-winner deploys plus gas.

  2. Set safety caps in ~/.hermes/.env:

    MINEBEAN_LIVE_BROADCAST_UNLOCKED=1
    MINEBEAN_MAX_DEPLOYS_PER_DAY=1
    MINEBEAN_MAX_DEPLOY_WEI=200000000000000   # 0.0002 ETH cap, raise after first success
    
  3. Load env into your shell (whitelist the MineBean vars; skips any stray non-env-style lines):

    while IFS= read -r line; do
      case "$line" in
        MINEBEAN_*=*|BASE_RPC_URL=*) export "$line" ;;
      esac
    done < ~/.hermes/.env
    
  4. Run the broadcast interactively:

    hermes-minebean-deploy --profile anti-winner --no-dry-run
    
  5. Verify the JSON output:

    • broadcast.ok: true
    • broadcast.stage: "confirmed"
    • broadcast.receipt.status: 1
    • broadcast.tx_hash: "0x..." (paste into https://basescan.org/tx/{hash} to inspect)
  6. Raise MINEBEAN_MAX_DEPLOYS_PER_DAY to your desired cap, then move to cron mode (next section).

If broadcast.ok is false, the stage field tells you exactly what failed: sign_failed, broadcast_failed, receipt_timeout, reverted, ceiling_reached, or live_broadcast_blocked. The daily counter only increments on stage="confirmed", so a failed run doesn't burn quota.

Autonomous mode

Two ways to start a scheduled miner.

Via slash command:

/minebean autostart every 60s

Via Hermes cron directly:

hermes cron add --name "MineBean deploy" --no-agent \
  --script ~/.hermes/scripts/minebean-deploy.sh "every 60s"

The cron entry runs hermes-minebean-deploy, which:

  • Enforces MINEBEAN_MAX_DEPLOYS_PER_DAY (atomic counter under ~/.hermes/.minebean/)
  • Exits 0 on a normal skip or ceiling hit (no error spam)
  • Exits 1 on a real failure
  • Exits 130 on SIGINT
  • Emits one JSON line per run for log scraping

Stop with /minebean autostop or hermes cron remove <name>.

MCP server

The [mcp] extra ships a hermes-minebean-mcp console script that speaks JSON-RPC over stdio.

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "minebean": {
      "command": "hermes-minebean-mcp",
      "env": {
        "MINEBEAN_MINER_ADDRESS": "0xYourAddress",
        "MINEBEAN_MAX_DEPLOYS_PER_DAY": "100"
      }
    }
  }
}

Cursor (.cursor/mcp.json in your project):

{
  "mcpServers": {
    "minebean": {
      "command": "hermes-minebean-mcp"
    }
  }
}

Restart the client, then ask: "What's the current MineBean round?"

The MCP server registers all 7 tools with full schemas. Deploy and claim default to dry-run from the MCP surface too.

Inference provider

The plugin defaults HERMES_INFERENCE_PROVIDER=venice when nothing is set, so any Hermes agent running this plugin routes its LLM calls through Venice by default. Venice's HERMES_VENICE_NO_LOG=1 flag keeps your conversation off third-party logs while the mining loop stays fully on-chain and public.

Add to ~/.hermes/.env to enable Venice:

HERMES_VENICE_API_KEY=...
HERMES_VENICE_NO_LOG=1

Multi-provider hook. Already running Hermes with a different provider? The plugin respects whatever you pin. Set HERMES_INFERENCE_PROVIDER to any of venice, openai, anthropic, openrouter, ollama, or lmstudio and the bootstrap leaves it alone.

Inspect the active provider any time via:

/minebean inference_status

or call the minebean_inference_status tool directly.

Zero-install via .well-known

You can also load this skill without pip install by pointing a Hermes-compatible client at:

https://agent.minebean.com/.well-known/skills/index.json

The discovery endpoint returns a SKILL.md and a minimal stdlib readonly client (scripts/minebean_client.py). Useful for prototyping or for clients that prefer file-based skill loading.

Verifiability

Every round is mirrored to a signed Gitlawb repository:

gitlawb://did:key:z6MkwVfgaAnuypajisEkJLkVbWPiPEBwceMkGutfXpEEYHKi/minebean-rounds

Append-only, signed, and replicated across the Gitlawb network, with new round files landing every 5 minutes. Pull the window file for any time range to audit any outcome without trusting minebean.com.

Safety

  • dry_run=True is the hard default on every write path. Live broadcast requires MINEBEAN_LIVE_BROADCAST_UNLOCKED=1.
  • make_signer() raises in every non-readonly branch (the broadcast path is wired but disabled at the source)
  • MINEBEAN_MAX_DEPLOYS_PER_DAY blocks both the cron entry and the interactive deploy handler. The counter is fcntl-locked so overlapping crons cannot under-count.
  • The GridMining contract enforces one deploy per round per address. The plugin mirrors this client-side.
  • Cron wrapper script is chmod 700 (user-only rwx) because it sources ~/.hermes/.env.
  • Readonly mode (just MINEBEAN_MINER_ADDRESS, no key) lets you inspect any address without putting a key anywhere.

Network

Field Value
Chain Base mainnet (chain ID 8453)
GridMining 0x9632495bDb93FD6B0740Ab69cc6c71C9c01da4f0
BEAN token 0x5c72992b83E74c4D5200A8E8920fB946214a5A5D
Default RPC https://mainnet.base.org

ABIs ship in src/hermes_minebean/abi/. The GridMining ABI is extracted from the deployed contract via BaseScan.

Repo layout

hermes-mine-bean/
├── pyproject.toml             package config + entry points
├── plugin.yaml                Hermes Agent plugin manifest
├── src/hermes_minebean/
│   ├── plugin_entry.py        Hermes register(ctx)
│   ├── mcp_server.py          FastMCP server for Claude/Cursor
│   ├── cli.py                 hermes-minebean-deploy console script
│   ├── tools.py               7 tool handlers
│   ├── schemas.py             OpenAI-style schemas + presets
│   ├── strategies.py          5 strategy resolvers
│   ├── signer.py              eoa | bankr | readonly signer abstraction
│   ├── contract.py            GridMining read + tx-builder client
│   ├── rpc.py                 web3 client with Cloudflare-safe UA
│   ├── state.py               profile + daily counter (fcntl-locked)
│   ├── cron_jobs.py           autostart / autostop wrapper management
│   ├── hooks.py               pre_llm_call keyword gate
│   ├── slash.py               /minebean dispatcher
│   └── abi/gridmining.json
└── coordinator-deliverables/  zero-install skill artifacts (served via agent.minebean.com)

Development

# Activate the venv
source .venv/bin/activate

# Run the readonly smoke test against mainnet
MINEBEAN_MINER_ADDRESS=0xYourTestAddress \
  python -c "from hermes_minebean.tools import _handler_status; print(_handler_status())"

# Run the MCP server and probe with a JSON-RPC client
hermes-minebean-mcp

The plugin is unix-only by design (Hermes Agent itself is unix-only). The daily-counter file lock uses fcntl.

Contributing

Bug reports, strategy formula proposals, and PRs welcome at the issues page.

Before opening a PR:

  • Keep tool signatures stable (third parties consume them)
  • Note any user-visible behaviour change in the PR description
  • Live broadcast changes need a separate review pass

Acknowledgements

  • Nous Research for Hermes Agent and the plugin spec
  • The MineBean protocol team for the on-chain game
  • Anthropic for the MCP protocol that makes this work in Claude Desktop and Cursor

License

MIT. See LICENSE for the full text.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_mine_bean-0.3.3.tar.gz (49.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_mine_bean-0.3.3-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

Details for the file hermes_mine_bean-0.3.3.tar.gz.

File metadata

  • Download URL: hermes_mine_bean-0.3.3.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hermes_mine_bean-0.3.3.tar.gz
Algorithm Hash digest
SHA256 546052c2f9010dd02f19957f7e3d9603abcc588428da827c3af7e393a9387d9b
MD5 e9f22c3ab04eebef65a1f81c7cd39a19
BLAKE2b-256 810f87592d47c74df41ac51122d8059fee638cacb85fe9d864d1aa1c0a45d378

See more details on using hashes here.

File details

Details for the file hermes_mine_bean-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_mine_bean-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e4113e202d3d6b4065d5795115d23a02ed83cecc437726fd6a2b2a803a65aae7
MD5 1d185f16f3a835177d5158b88e9fc6a8
BLAKE2b-256 5a2fe8a81eb4b3817d031359b458b8d900b848a2195d42a2fa4be97d99c18f34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page