← 返回 Skills 市场
pkwangwanjun

Agent Lottery

作者 pkwangwanjun · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
346
总下载
1
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-lottery
功能描述
Bitcoin solo mining "lottery" skill. Use when users want to (1) mine Bitcoin with CPU for lottery-style chance at blocks, (2) set up or manage BTC wallet for...
使用说明 (SKILL.md)

Agent Lottery - Bitcoin Solo Mining Lottery

Use CPU power to participate in Bitcoin mining lottery. Extremely low probability but zero cost entertainment - if you hit a block, you get the full 3.125 BTC reward (~$150,000+).

First-Time Setup Workflow

When user first mentions lottery mining, check if data/config.json exists:

If config.json NOT exists (first time):

  1. Check dependencies

    python3 scripts/miner.py status
    

    If cpuminer-opt not found, run:

    ./scripts/install.sh
    
  2. Ask user about BTC address:

    "Do you have a BTC address? If yes, we can use it directly. If no, I'll generate a new wallet for you."

    Wait for user response before proceeding.

  3. Ask user about CPU usage:

    "How much CPU would you like to use for lottery mining? Default is 10%, recommended 5-20%. Higher values may affect normal computer usage."

    Device Type Suggested CPU
    Raspberry Pi / Low-power devices 5-10%
    Laptop / Desktop 10-30%
    Dedicated server 50-100%

    Wait for user response. Use 10% if user doesn't specify.

  4. Configure wallet (based on step 2):

    • If YES (has address):

      python3 scripts/wallet.py --address THEIR_BTC_ADDRESS --pool btc.casualmine.com:20001 --cpu THEIR_CPU_PERCENT
      

      Tell user: "Configuration complete! Mining rewards will be sent directly to this address."

    • If NO (needs new wallet):

      python3 scripts/wallet.py --generate --pool btc.casualmine.com:20001 --cpu THEIR_CPU_PERCENT
      

      IMPORTANT: Show user the private key and warn them to save it!

      "Please save your private key securely! This is the only way to access this wallet."

    • If user has private key (WIF or hex):

      python3 scripts/wallet.py --import-key THEIR_PRIVATE_KEY --pool btc.casualmine.com:20001 --cpu THEIR_CPU_PERCENT
      
  5. Start mining

    nohup python3 scripts/miner.py start > /dev/null 2>&1 &
    

    Tell user: "Mining started! Use 'lottery' command to check status. You can adjust CPU anytime with 'setcpu --cpu X'."

If config.json exists (already configured):

Just run lottery to show current status.

Platform Support

Platform Mining CPU Limiting
Linux (x86_64, ARM) Full cpulimit
macOS (Intel, Apple Silicon) Full cpulimit (via brew)
Windows (WSL) Full cpulimit
Windows (native) Manual Requires 3rd party tool

Quick Commands

# Generate new wallet (default CPU: 10%)
python3 scripts/wallet.py --generate --pool btc.casualmine.com:20001 --cpu 10

# Use existing BTC address (no private key needed)
python3 scripts/wallet.py --address YOUR_BTC_ADDRESS --pool btc.casualmine.com:20001 --cpu 10

# Import existing wallet with private key
python3 scripts/wallet.py --import-key YOUR_PRIVATE_KEY

# Show wallet info
python3 scripts/wallet.py --show

# Start mining (background with nohup)
nohup python3 scripts/miner.py start --cpu 10 > /dev/null 2>&1 &

# Stop mining
python3 scripts/miner.py stop

# Dynamically adjust CPU (while mining or stopped)
python3 scripts/miner.py setcpu --cpu 20

# Check status
python3 scripts/miner.py status

# Lottery summary (user-friendly)
python3 scripts/miner.py lottery

Statistics Tracked

  • Best Difficulty: Highest difficulty share found (closer to block diff = better)
  • Total Shares: Number of lottery "tickets"
  • Runtime: How long mining has been active
  • CPU Usage: Current CPU limit
  • Network Difficulty: Fetched in real-time from blockchain.info

Lottery Reality Check

Tell users:

  • BTC network difficulty: fetched in real-time (currently ~144T, varies)
  • CPU mining produces shares with diff ~0.001 to ~10 typically
  • A block requires diff matching network difficulty
  • Odds: roughly 1 in 10^14+ per share
  • This is entertainment, not investment

When User Asks About Lottery

Run python3 scripts/miner.py lottery and explain:

  • Their current "tickets" (shares)
  • Best difficulty found
  • Real-time network difficulty
  • How far they are from a block (odds)
  • Encourage them to keep going (or not, if unrealistic)

Installation

Linux / macOS

chmod +x scripts/install.sh
./scripts/install.sh

Windows

  1. Option A: WSL (Recommended)

    wsl --install
    # Then run install.sh inside WSL
    
  2. Option B: Native Windows

Dependencies

  • cpuminer-opt: Bitcoin SHA256d miner
  • cpulimit: CPU throttling (Linux/macOS only)
  • base58, ecdsa: Python libraries for wallet

Files

agent-lottery/
├── SKILL.md              # This file
├── scripts/
│   ├── wallet.py         # Wallet management (generate/import/address)
│   ├── miner.py          # Mining controller (start/stop/status/setcpu)
│   ├── quick_status.py   # Fast status check
│   └── install.sh        # Cross-platform dependency installer
└── data/                 # User data (git ignored)
    ├── config.json       # Wallet and stats
    └── miner.log         # Mining output
安全使用建议
This skill is not obviously malicious, but proceed cautiously. Key points to consider before installing: (1) The miner connects to an external pool (btc.casualmine.com) — you must trust the pool operator because they handle submissions/payouts; an untrusted pool could keep any rewards. (2) The wallet code prints and saves private keys unencrypted in local config files; do NOT import private keys for wallets you actually use for funds. Prefer using address-only mode or use a throwaway wallet. (3) quick_status.py uses a different config path (~/.agent-lottery) than the other scripts (skill_dir/data) — this inconsistency can lead to confusion about where keys and state are stored. (4) The included installer builds and installs cpuminer-opt system-wide using sudo and apt/brew/git; review the install.sh and the cpuminer-opt repo yourself before running with elevated privileges. (5) If you want to reduce risk: run inside a disposable VM/container, inspect and test the scripts offline, verify the pool operator's reputation, or avoid importing real private keys. Additional information that would raise confidence: a published repository/homepage under a known maintainer, signatures/hashes for cpuminer binaries, or use of a well-known, reputable solo-mining proxy.
功能分析
Type: OpenClaw Skill Name: agent-lottery Version: 1.0.0 The skill implements a Bitcoin solo miner using 'cpuminer-opt' and 'cpulimit'. While the code appears to align with its stated purpose, it employs several high-risk behaviors including the use of 'sudo' for system-level installations, building binaries from source (scripts/install.sh), and aggressive process management using 'pkill' which could affect unrelated system processes (scripts/miner.py). Additionally, it manages sensitive Bitcoin private keys in plaintext within a local 'config.json' file. Although no evidence of intentional malice or data exfiltration was found, the combination of system-level modifications and resource-intensive background execution warrants a suspicious classification.
能力评估
Purpose & Capability
The code and instructions align with a CPU-based solo-mining “lottery” skill (miner controller, wallet manager, installer). No unrelated cloud credentials or bizarre dependencies are requested. However there is an internal inconsistency: most scripts store config under the skill directory (data/config.json) while quick_status.py looks in ~/.agent-lottery/config.json — this mismatch is unexpected and may cause confusing behavior.
Instruction Scope
Runtime instructions tell the agent to generate or import private keys, print and save private keys to disk unencrypted, build/run cpuminer-opt (which connects to an external pool) and fetch network difficulty from blockchain.info. Saving private keys unencrypted and sending mining submissions to an externally-operated pool (btc.casualmine.com) are significant trust decisions that go beyond simple local computation.
Install Mechanism
No formal package manifest is declared; instead an included install.sh builds dependencies and cpuminer-opt from GitHub and uses system package managers (apt/brew) / sudo. Building/installing from source and running installer with sudo is expected for a miner but increases risk compared to a pure instruction-only skill because it writes system-wide artifacts.
Credentials
The skill requests no environment secrets, which is appropriate, but it instructs connecting to an external pool (btc.casualmine.com). That pool operator could control payouts or otherwise mis-handle earnings — the skill assumes the pool will forward any block reward to the user's address. Also, private keys are stored unencrypted in config files; importing a real wallet into this skill could expose funds if the host or skill is compromised.
Persistence & Privilege
The skill does not request 'always: true' or special platform privileges. It does persist configuration, logs, PIDs, and private keys to disk (skill data dir), and its installer performs system-level installs (sudo/make install), which gives it a lasting system footprint. This is expected for miners but is a persistence consideration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-lottery
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-lottery 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Bitcoin solo mining lottery with CPU control
元数据
Slug agent-lottery
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Agent Lottery 是什么?

Bitcoin solo mining "lottery" skill. Use when users want to (1) mine Bitcoin with CPU for lottery-style chance at blocks, (2) set up or manage BTC wallet for... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 346 次。

如何安装 Agent Lottery?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-lottery」即可一键安装,无需额外配置。

Agent Lottery 是免费的吗?

是的,Agent Lottery 完全免费(开源免费),可自由下载、安装和使用。

Agent Lottery 支持哪些平台?

Agent Lottery 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Agent Lottery?

由 pkwangwanjun(@pkwangwanjun)开发并维护,当前版本 v1.0.0。

💬 留言讨论