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 分

    請在儲存庫或註冊中心條目中宣告授權條款。