微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔐

多币种加密货币钱包生成器

create-crypto-wallets · v1.0.1
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 D 级 作者 beocca 公开目录收录
234 下载 0 安装 479 收藏 1 浏览

简介

基于Python hdwallet库的HD分层确定性钱包技能,支持200+加密货币,可通过CLI或API生成符合BIP32/39/44等标准的私钥和地址。

原始描述

Generate and manage Hierarchical Deterministic (HD) crypto wallets for 200+ cryptocurrencies (Bitcoin, Ethereum, and many more) using the Python `hdwallet` library, via either its CLI or its Python API.

通过你的 Agent 添加

安装目录:create-crypto-wallets/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/create-crypto-wallets/
Codex CLI~/.codex/skills/create-crypto-wallets/
DeepSeek Harness~/.agents/skills/create-crypto-wallets/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

create-crypto-wallets 是一个基于 Python hdwallet 库的加密货币钱包生成技能,支持通过命令行(CLI)或 Python API 两种模式使用。核心功能是从熵(entropy)、助记词(mnemonic)、种子(seed)或扩展密钥等"主密钥源"派生出符合 BIP32/39/44/49/84/86/141、SLIP10、Cardano、Monero 等标准的分层确定性钱包。

用户可通过 hdwallet dump 命令生成单个钱包的完整密钥信息(JSON 输出),或使用 hdwallet dumps 批量导出多个派生地址(支持 CSV/JSON 格式)。Python API 则提供更灵活的编程接口,允许在代码中直接实例化 HDWallet 类,配置加密货币类型、HD 标准、网络和派生路径,获取私钥、公钥、地址及扩展密钥等信息。

显著优点

  1. 广泛兼容性:支持 200+ 加密货币,涵盖比特币、以太坊及众多山寨币,密钥格式与主流钱包服务兼容。
  2. 标准合规性:严格遵循行业标准的 HD 钱包协议,确保生成的钱包可在其他平台导入恢复。
  3. 双模式灵活:CLI 适合快速一次性生成,API 适合集成到自动化工作流或其他 Python 项目中。
  4. 完整密钥生命周期:从熵生成到助记词、种子、派生密钥和地址的全流程支持,满足从创建到恢复的各种场景。
  5. 批量处理能力:dumps 命令支持批量生成地址并导出为结构化数据,便于大规模地址管理。

潜在缺点与局限性

  1. 安全责任完全下放:技能本身不托管密钥,所有敏感信息以明文形式输出到终端或文件,用户需自行承担密钥保管的全部责任。
  2. 无内置加密存储:生成的助记词和私钥需借助外部工具(如文档推荐的 KeePass CLI)实现加密存储,原生输出无保护机制。
  3. 学习曲线陡峭:涉及密码学概念(熵、派生路径、BIP 标准等),非技术用户理解门槛较高。
  4. 依赖外部环境:需要 Python 环境和虚拟环境配置,跨平台使用可能存在依赖兼容性问题。
  5. 网络配置敏感:主网/测试网切换、自定义派生路径等配置错误可能导致资金发送到错误地址或无法恢复。

适合的目标群体

  • 区块链开发者:需要在测试环境批量生成钱包地址,或构建集成多币种钱包功能的应用。
  • DeFi 协议测试人员:需要快速创建大量测试网钱包进行合约交互验证。
  • 加密货币高级用户:理解 HD 钱包原理,希望自主掌控密钥生成流程,避免依赖第三方托管钱包。
  • 安全研究人员:分析不同加密货币的地址派生机制和密钥格式。
  • 自动化运维场景:需要将钱包生成集成到 CI/CD 或自动化脚本中的技术团队。

使用风险

极高安全风险:本技能直接处理加密货币私钥和助记词,属于最高敏感等级操作。

  • 密钥泄露风险:CLI 输出可能进入 shell 历史记录(~/.bash_history 等),JSON/CSV 导出文件若未设置严格权限(chmod 600)或被意外提交到版本控制,将导致不可逆的资产损失。
  • 熵源质量问题:若使用非加密安全的随机数源生成熵,可能产生可预测的钱包地址,遭受暴力破解。
  • 派生路径错误:错误的 account/change/address 索引或自定义派生路径配置可能导致生成的地址与预期钱包无关,造成"丢失"资金的假象。
  • 环境隔离不足:在共享环境或未隔离的容器中运行,密钥信息可能被其他进程或用户读取。
  • 无交易功能:本技能仅生成密钥,不涉及区块链交互,但生成的密钥若被导入到不安全环境使用,风险将传导至实际资金管理。

建议严格遵循文档安全提示:使用专用低余额钱包、结合 KeePass CLI 加密存储、禁止在日志中打印敏感信息、确保 .gitignore 排除所有密钥文件。

技能正文


name: create-crypto-wallets version: 1.0.1 description: Generate and manage Hierarchical Deterministic (HD) crypto wallets for 200+ cryptocurrencies (Bitcoin, Ethereum, and many more) using the Python hdwallet library, via either its CLI or its Python API. metadata: {"crypto":{"category":"wallets","library":"hdwallet"}}

Create Crypto Wallets

Overview

hdwallet is a Python library and CLI for generating Hierarchical Deterministic (HD) wallets. It supports 200+ cryptocurrencies and lets you go from entropy/mnemonic/seed all the way down to derived private keys, public keys, and addresses, following standard protocols (BIP32/39/44/49/84/86/141, SLIP10, Cardano, Monero, Electrum, etc.) so keys stay compatible with other wallets and services.

Setup Instructions

python3 -m venv .venv
source .venv/bin/activate
pip install python-dotenv hdwallet[cli]

Usage Instructions

There are two ways to use hdwallet: the hdwallet CLI (fastest for one-off wallet generation) or the Python API (from hdwallet import HDWallet, best when the result needs to be consumed by other code).

Core concepts

A wallet is derived from one of these "master key" sources (pick exactly one):

  • Entropy — random bytes (hex), e.g. -e/--entropy
  • Mnemonic — human-readable seed phrase, e.g. -m/--mnemonic
  • Seed — raw seed bytes (hex), e.g. -s/--seed
  • Extended key — -xprv/--xprivate-key or -xpub/--xpublic-key
  • Raw private/public key — -prv/--private-key / -pub/--public-key
  • WIF — -w/--wif

From the master key, hdwallet derives keys/addresses using an HD standard (-h/--hd, default BIP44) for a given cryptocurrency (-sym/--symbol, default BTC) and network (-n/--network, default mainnet), following a derivation path controlled by -ac/--account, -ch/--change, -ad/--address (or a raw -d/--derivation path).

CLI: discovering options

hdwallet --help
hdwallet list cryptocurrencies      # list all supported cryptocurrency symbols
hdwallet list languages             # list supported mnemonic languages
hdwallet list strengths             # list valid entropy strengths (e.g. 128, 160, 192, 224, 256)

CLI: generating a new mnemonic and entropy

# Generate raw entropy (hex)
hdwallet generate entropy --client BIP39 --strength 128

# Generate a BIP39 mnemonic phrase (12 words for 128-bit strength)
hdwallet generate mnemonic --client BIP39 --words 12 --language english

# Generate a seed from a mnemonic
hdwallet generate seed --client BIP39 --mnemonic "abandon abandon ... about"

CLI: creating a wallet (hdwallet dump)

hdwallet dump derives and prints one wallet's keys/address as JSON. Supply exactly one master-key source flag plus the cryptocurrency/HD/network/derivation options you want:

# New Bitcoin wallet from a freshly generated mnemonic
MNEMONIC=$(hdwallet generate mnemonic --client BIP39 --words 12)
hdwallet dump --symbol BTC --hd BIP44 --network mainnet --mnemonic "$MNEMONIC"

# Ethereum wallet, account 0, address index 0, from an existing mnemonic
hdwallet dump --symbol ETH --hd BIP44 --mnemonic "$MNEMONIC" --account 0 --address 0

# Derive multiple addresses for the same wallet by changing --address
hdwallet dump --symbol BTC --mnemonic "$MNEMONIC" --address 1

Key dump flags:

Flag Purpose
-sym, --symbol Cryptocurrency ticker (default BTC)
-h, --hd HD standard: BIP32, BIP44, BIP49, BIP84, BIP86, BIP141, Cardano, Electrum-V1, Electrum-V2, Monero, Algorand (default BIP44)
-n, --network mainnet / testnet / etc. (default mainnet)
-e, --entropy / -ec, --entropy-client Master key from entropy hex
-m, --mnemonic / -mc, --mnemonic-client Master key from mnemonic words
-s, --seed / -sc, --seed-client Master key from seed hex
-pp, --passphrase Optional BIP39 passphrase ("25th word")
-xprv, --xprivate-key / -xpub, --xpublic-key Master key from an extended key
-prv, --private-key / -pub, --public-key / -w, --wif Master key from a raw private/public key or WIF
-ac, --account Account index (default 0)
-ch, --change Change index (default 0)
-ad, --address Address index (default 0)
-d, --derivation Explicit derivation path/name (overrides account/change/address)
-pkt, --public-key-type compressed (default) or uncompressed
-ex, --exclude Field names to omit from the output

The output JSON typically includes fields such as cryptocurrency, symbol, network, hd, entropy, mnemonic, seed, root_xprivate_key, root_xpublic_key, xprivate_key, xpublic_key, private_key, wif, public_key, chain_code, address, and the derivation path.

CLI: batch export (hdwallet dumps)

hdwallet dumps is like dump but designed for deriving many addresses/rows at once and exporting as CSV or JSON — useful for generating a range of addresses for one wallet:

hdwallet dumps --symbol BTC --mnemonic "$MNEMONIC" --format json
hdwallet dumps --symbol BTC --mnemonic "$MNEMONIC" --format csv --include-header --delimiter ","

Extra flags vs. dump: -f/--format (csv default or json), -in/--include and -ex/--exclude (pick/drop output fields), -inh/--include-header (CSV header row), -de/--delimiter (CSV delimiter).

Python API

For programmatic wallet generation, use the HDWallet class:

from hdwallet import HDWallet
from hdwallet.hds import BIP44HD
from hdwallet.cryptocurrencies import Bitcoin
from hdwallet.entropies.bip39 import BIP39Entropy, BIP39_ENTROPY_STRENGTHS
from hdwallet.mnemonics.bip39 import BIP39Mnemonic

# 1. Generate fresh entropy, then a mnemonic from it
entropy = BIP39Entropy.generate(strength=BIP39_ENTROPY_STRENGTHS.ONE_HUNDRED_TWENTY_EIGHT)
mnemonic = BIP39Mnemonic.from_entropy(entropy=entropy)  # 12-word phrase

# 2. Build the HD wallet for Bitcoin using BIP44 derivation
wallet: HDWallet = HDWallet(
    cryptocurrency=Bitcoin,
    hd=BIP44HD,
    network="mainnet",
).from_mnemonic(mnemonic=BIP39Mnemonic(mnemonic=mnemonic))

# 3. Read the derived keys/address
print(wallet.mnemonic())        # the mnemonic phrase — BACK THIS UP, it recovers the whole wallet
print(wallet.private_key())     # derived private key (hex)
print(wallet.public_key())      # derived public key (hex)
print(wallet.address())         # derived address for the configured account/change/address index
print(wallet.xprivate_key())    # extended private key (xprv...)
print(wallet.xpublic_key())     # extended public key (xpub...)

Other HDWallet constructors for recovering/loading an existing wallet instead of generating a new one: HDWallet.from_entropy(entropy), HDWallet.from_seed(seed), HDWallet.from_xprivate_key(...), HDWallet.from_xpublic_key(...), HDWallet.from_private_key(...), HDWallet.from_public_key(...), HDWallet.from_wif(...), HDWallet.from_derivation(...).

To enumerate supported cryptocurrencies in code:

from hdwallet.cryptocurrencies import CRYPTOCURRENCIES
print(CRYPTOCURRENCIES.classes())  # list of all supported Cryptocurrency classes

Security

  • The mnemonic/entropy/seed/private key is the wallet. Anyone with it has full control of funds. Never print these to shared logs, commit them to version control, or send them over an insecure channel.
  • Prefer deriving from a mnemonic you generate once and store securely, rather than regenerating entropy per-session — regenerating creates a brand-new, unrelated wallet each time.
  • If writing wallet material to disk, restrict file permissions (e.g. chmod 600) and keep the file out of any directory tracked by git (add it to .gitignore).
  • Use a dedicated wallet with a minimal balance for agentic/automated use to limit exposure if the key is ever leaked.

Resources

  • Clawhub skill: keepass-cli — store the mnemonic/private keys generated here in a local, password-protected KeePass (.kdbx) database instead of plaintext files. Use it to create an entry per wallet (e.g. title hdwallet:<symbol>:<address>) with the mnemonic/private key in the password/notes field, so secrets are encrypted at rest rather than left in shell history or loose JSON files. Directly install via openclaw skills install @beocca/keepass-cli

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

finance-accountingdevelopment-engineeringbackendautomationapi

同类 Skill