Ethereum Keystore Encryption

io.github.nirholas由 GitHub 账号 nirholas 发布v1.0.0更新于 Oct 24, 2026

Encrypt/decrypt Ethereum keystore JSON V3 with scrypt/PBKDF2 for secure cold storage

已验证STDIO仅桌面金融安全与监控

概览

AI 生成的概览

本地 MCP 服务器,用于以 scrypt 或 PBKDF2 加密、解密和管理以太坊 keystore JSON V3 文件。

可以做什么
  • 将私钥加密为 Web3 Secret Storage V3 格式,或解密 keystore 以恢复私钥
  • 按以太坊标准命名保存和加载 keystore 文件,并把解密后的私钥导出为文件
  • 在不解密的情况下读取 keystore 元数据,并校验 keystore 结构
  • 修改 keystore 密码(可选升级密钥派生函数),以及批量加密多个钱包
  • 读取内置的 V3 规范、安全实践、KDF 对比和示例资源,并按引导式提示完成备份、迁移、恢复和安全审计
适用场景
适合让助手创建或检查以太坊 keystore V3 备份、轮换 keystore 密码或迁移旧版钱包格式,尤其是离线或冷存储场景。
运行要求
作为本地进程在用户机器上运行,从 PyPI 安装 keystore-mcp-server,用 uvx 或 keystore-mcp-server 命令启动,需要 Python 环境。未声明账号、API 密钥或环境变量。仅支持桌面客户端。
安装前请注意
该服务器会接触明文私钥和 keystore 密码,其中一个工具会把解密后的私钥导出为文件,README 本身也标注为危险操作。输入给助手的内容(包括私钥和密码)都会经过模型对话。高价值钱包建议离线使用并做好备份,注意文件会以 0600 权限写入磁盘。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Ethereum Keystore Encryption,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Keystore MCP Server

[PyPI] [MCP Registry]

A Model Context Protocol (MCP) server for Ethereum keystore encryption, decryption, and management following the Web3 Secret Storage Definition Version 3 standard.

Features

Tools (9)

  • encrypt_keystore - Encrypt private key to Web3 Secret Storage V3 format
  • decrypt_keystore - Decrypt keystore to recover private key
  • save_keystore_file - Save keystore with standard Ethereum naming
  • load_keystore_file - Load and validate keystore files
  • get_keystore_info - Extract metadata without decryption
  • validate_keystore - Validate keystore structure
  • change_keystore_password - Change password and optionally upgrade KDF
  • batch_encrypt_keystores - Encrypt multiple wallets
  • keystore_to_private_key_file - Export decrypted private key (dangerous)

Resources (4)

  • keystore://specification - Web3 Secret Storage V3 specification
  • keystore://security-guide - Security best practices
  • keystore://kdf-comparison - Scrypt vs PBKDF2 comparison
  • keystore://examples/{type} - Example keystores

Prompts (4)

  • secure_wallet_backup - Guided backup creation
  • keystore_migration - Migration from legacy formats
  • keystore_recovery - Recovery assistance
  • keystore_security_audit - Security audit workflow

Installation

bash
pip install -e .
# Or with dev dependenciespip install -e ".[dev]"

Usage

Running the Server

bash
keystore-mcp-server

Claude Desktop Configuration

json
{  "mcpServers": {    "keystore": {      "command": "keystore-mcp-server"    }  }}

Cryptographic Standards

Web3 Secret Storage V3

  • KDF: scrypt (recommended) or pbkdf2
  • Cipher: AES-128-CTR
  • MAC: Keccak-256
  • UUID: Version 4

Default Scrypt Parameters

ParameterValueDescription
N262144 (2^18)CPU/memory cost
r8Block size
p1Parallelization
dklen32Derived key length

Default PBKDF2 Parameters

ParameterValueDescription
c262144Iterations
prfhmac-sha256PRF
dklen32Derived key length

Security

⚠️ Important Security Notes:

  1. Never share keystore passwords - Treat like private keys
  2. Use strong passwords - Minimum 12 characters, mixed case, numbers, symbols
  3. Secure file storage - Files created with 0600 permissions
  4. Air-gapped operations - Use offline for high-value wallets
  5. Backup keystores - Store encrypted backups in multiple locations

Examples

Encrypt a Private Key

python
result = await encrypt_keystore(    private_key="0x...",    password="strong-password-123",    kdf="scrypt")

Decrypt a Keystore

python
result = await decrypt_keystore(    keystore=keystore_json,    password="strong-password-123")

Save Keystore File

python
result = await save_keystore_file(    keystore=keystore_json,    directory="./keystores")# Creates: UTC--2024-01-15T10-30-00.000Z--address.json

Testing

bash
pytest tests/ -v

License

MIT License

来源:keystore-mcp-server/README.md,提交 dabb599

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。