当前位置: 首页 > Skill >

AI Walllet Payment System

AI Walllet Payment System

AI Walllet Payment System

使用加密密钥和TOTP双因素认证管理以太坊钱包,实现安全ETH交易、审计日志和限流,用于AI驱动的支付处理。

0.1.0 2026.11.16 345
获取Skill文件查看使用说明
作 者:林知 许可证: 更新时间:2026.11.16
本文目录展开

AI Wallet Payment System - Skill Guide

Overview

This skill enables AI agents to securely manage cryptocurrency wallets and perform blockchain transactions. It provides encrypted key storage, multi-factor authentication, and secure transaction processing for Ethereum-based payments.

Repository: https://github.com/cerbug45/AI-Wallet-Payment-System
Author: cerbug46
Version: 13.0
Language: Python 3.8+

🎯 What This Skill Does

Primary Capabilities

  • Creates and manages Ethereum cryptocurrency wallets
  • Encrypts private keys with military-grade cryptography
  • Performs secure ETH transactions via Web3
  • Implements TOTP-based two-factor authentication
  • Provides comprehensive audit logging
  • Offers rate limiting and abuse prevention

Use Cases

  • AI agents that need to make automated payments
  • Secure wallet management for applications
  • Educational demonstrations of crypto security
  • Testing blockchain integrations
  • Building payment-enabled AI systems

📦 Installation & Setup

Step 1: System Dependencies

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y python3-dev libsqlcipher-dev build-essential libssl-dev

macOS:

brew install sqlcipher openssl python@3.11

Windows:

# Install Visual Studio Build Tools 2019+
# Download from: https://visualstudio.microsoft.com/downloads/
# Select "Desktop development with C++" workload

Step 2: Clone Repository

git clone https://github.com/cerbug45/AI-Wallet-Payment-System.git
cd AI-Wallet-Payment-System

Step 3: Python Environment

# Create isolated virtual environment
python3 -m venv venv

# Activate environment
source venv/bin/activate  # Linux/macOS
# OR
venvScriptsactivate     # Windows

# Upgrade pip
pip install --upgrade pip

Step 4: Install Python Dependencies

# Core dependencies
pip install web3==6.0.0
pip install pysqlcipher3==1.2.0
pip install cryptography==41.0.0
pip install argon2-cffi==23.1.0
pip install pyotp==2.9.0
pip install qrcode==7.4.0
pip install pillow==10.0.0

# Optional: Install all at once
pip install -r requirements.txt

Dependency Breakdown:

  • web3 - Ethereum blockchain interaction
  • pysqlcipher3 - Encrypted SQLite database
  • cryptography - AES/ChaCha20 encryption
  • argon2-cffi - Password hashing
  • pyotp - TOTP 2FA implementation
  • qrcode - QR code generation for 2FA
  • pillow - Image processing for QR codes

Step 5: Environment Configuration

Create .env file in project root:

# Required Configuration
WEB3_PROVIDER_URL=https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID
BACKUP_ENCRYPTION_KEY_FINGERPRINT=<generated-key>

# Optional Configuration
DATABASE_PATH=./secure_wallets.db
LOG_LEVEL=INFO
RATE_LIMIT_ENABLED=true
MAX_REQUESTS_PER_MINUTE=2
MAX_REQUESTS_PER_HOUR=20
SESSION_TIMEOUT_MINUTES=15

Generate Backup Encryption Key:

openssl rand -hex 32
# Copy output to BACKUP_ENCRYPTION_KEY_FINGERPRINT

Get Infura Project ID:

  1. Sign up at https://infura.io/
  2. Create new project
  3. Copy Project ID from dashboard
  4. Use in WEB3_PROVIDER_URL

Step 6: Verify Installation

python -c "from ultra_secure_wallet_v13_MAXIMUM_SECURITY import MaximumSecurityPaymentAPI; print('✅ Installation successful')"

🚀 Quick Start Guide

Basic Usage Example

from ultra_secure_wallet_v13_MAXIMUM_SECURITY import MaximumSecurityPaymentAPI
import getpass
import os

# Load environment variables
from dotenv import load_dotenv
load_dotenv()

# Get master password securely (NEVER hardcode!)
master_password = getpass.getpass("Enter master password: ")

# Initialize API
api = MaximumSecurityPaymentAPI(master_password)

# Create new wallet
wallet = api.create_wallet(
    wallet_id="my_ai_wallet",
    metadata={
        "agent_name": "PaymentBot",
        "purpose": "automated_payments"
    }
)

if wallet['success']:
    print(f"✅ Wallet created!")
    print(f"   Address: {wallet['address']}")
    print(f"   📱 Setup 2FA with: {wallet['totp_uri']}")
    print(f"   🔑 Backup codes: {wallet['backup_codes']}")
    
    # CRITICAL: Save MFA secret and backup codes securely!
    # Store in password manager or encrypted vault

# Check balance
balance = api.get_balance("my_ai_wallet")
print(f"💰 Balance: {balance['balance_eth']} ETH")

# Send transaction (requires TOTP from authenticator app)
totp_code = input("Enter 6-digit TOTP code: ")
tx = api.send_transaction(
    wallet_id="my_ai_wallet",
    to_address="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    amount_eth=0.001,  # Send 0.001 ETH
    totp_code=totp_code
)

if tx['success']:
    print(f"✅ Transaction sent!")
    print(f"   TX Hash: {tx['tx_hash']}")

# Always cleanup sensitive data
api.cleanup()

Command Line Demo

# Run built-in demo
python ultra_secure_wallet_v13_MAXIMUM_SECURITY.py

# Follow prompts:
# 1. Enter strong master password (20+ chars)
# 2. System creates demo wallet
# 3. Displays active security features
# 4. Shows wallet address and 2FA setup

🔒 Security Configuration

Password Requirements

The system enforces strict password policies:

# Minimum requirements
- Length: 20+ characters
- Uppercase letters: 1+
- Lowercase letters: 1+
- Digits: 1+
- Special characters: 1+
- Entropy: 80+ bits

Recommended Password Generation:

# Generate strong password
openssl rand -base64 32

# Or use password manager:
# - 1Password
# - Bitwarden
# - LastPass
# - KeePassXC

Two-Factor Authentication Setup

After creating a wallet, you'll receive:

  1. TOTP Secret - Store in password manager
  2. QR Code URI - Scan with authenticator app
  3. Backup Codes - Save offline securely

Compatible Authenticator Apps:

  • Google Authenticator
  • Authy
  • Microsoft Authenticator
  • 1Password (has built-in TOTP)

Rate Limiting Configuration

Edit in code or environment:

# Default limits
MAX_REQUESTS_PER_MINUTE = 2   # Per wallet/IP
MAX_REQUESTS_PER_HOUR = 20    # Per wallet/IP
LOCKOUT_DURATION = 3600       # 1 hour in seconds

Audit Logging

All operations are logged to secure_wallet.log:

# View logs
tail -f secure_wallet.log

# Filter for specific wallet
grep "my_ai_wallet" secure_wallet.log

# Check for security events
grep -E "SECURITY|ERROR|FAILED" secure_wallet.log

🎓 Advanced Usage

Using with AI Agents

class PaymentAgent:
    def __init__(self, master_password):
        self.wallet_api = MaximumSecurityPaymentAPI(master_password)
        self.wallet_id = "agent_wallet"
        
    async def process_payment(self, recipient, amount, totp):
        """Process automated payment"""
        
        # Check balance first
        balance = self.wallet_api.get_balance(self.wallet_id)
        
        if balance['balance_eth'] < amount:
            return {"error": "Insufficient funds"}
        
        # Execute transaction
        result = self.wallet_api.send_transaction(
            wallet_id=self.wallet_id,
            to_address=recipient,
            amount_eth=amount,
            totp_code=totp
        )
        
        return result
    
    def cleanup(self):
        self.wallet_api.cleanup()

Environment-Specific Configuration

Development/Testnet:

# Use Sepolia testnet
WEB3_PROVIDER_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID

# Or Goerli
WEB3_PROVIDER_URL=https://goerli.infura.io/v3/YOUR_PROJECT_ID

Production/Mainnet:

# Ethereum mainnet
WEB3_PROVIDER_URL=https://mainnet.infura.io/v3/YOUR_PROJECT_ID

# Enable all security features
RATE_LIMIT_ENABLED=true
REQUIRE_2FA=true
AUDIT_LOGGING=true

Backup and Recovery

Export Wallet Backup:

# Encrypted backup creation
api.export_wallet_backup("my_wallet", backup_password="strong-backup-pwd")
# Creates: wallet_backup_20240215_123456.enc

Restore from Backup:

# Import encrypted backup
api.import_wallet_backup(
    "wallet_backup_20240215_123456.enc",
    backup_password="strong-backup-pwd"
)

🧪 Testing Guide

Test on Testnet First

Never test with real ETH on mainnet!

# 1. Get testnet ETH
# Visit: https://sepoliafaucet.com/
# Enter your wallet address
# Receive free test ETH

# 2. Configure testnet
export WEB3_PROVIDER_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID

# 3. Run tests
python ultra_secure_wallet_v13_MAXIMUM_SECURITY.py

Unit Testing

# Install test dependencies
pip install pytest pytest-cov pytest-mock

# Run tests (if available)
pytest tests/

# With coverage
pytest --cov=ultra_secure_wallet_v13_MAXIMUM_SECURITY tests/

⚠️ Important Warnings

What This System Actually Provides

✅ Implemented Security Features:

  • Encrypted database (SQLCipher AES-256)
  • Strong password hashing (Argon2id)
  • Private key encryption (ChaCha20-Poly1305)
  • TOTP two-factor authentication
  • Rate limiting and lockout
  • Audit logging
  • Input validation
  • Memory wiping

❌ Not Implemented (Despite Header Claims):

  • Hardware Security Module (HSM) integration
  • Trusted Platform Module (TPM) support
  • Post-quantum cryptography
  • Multi-signature wallets
  • Quantum random number generation
  • Most of the 500+ listed features

Production Checklist

Before using in production:

  • Professional security audit completed
  • Penetration testing performed
  • Code review by security experts
  • Insurance/liability coverage obtained
  • Disaster recovery plan documented
  • Incident response procedures ready
  • Regular security updates scheduled
  • Compliance requirements verified (KYC/AML if applicable)
  • Multi-signature wallet implemented for large amounts
  • Cold storage setup for long-term holdings

Risk Acknowledgment

This system is experimental and educational.

  • ⚠️ No warranty provided
  • ⚠️ Use at your own risk
  • ⚠️ Authors not liable for lost funds
  • ⚠️ Not professionally audited
  • ⚠️ May contain security vulnerabilities
  • ⚠️ Suitable for small amounts only

🐛 Troubleshooting

Common Issues

Problem: "ModuleNotFoundError: No module named 'pysqlcipher3'"

# Solution: Install system dependencies first
sudo apt-get install libsqlcipher-dev
pip install pysqlcipher3

Problem: "Web3 provider not connected"

# Solution: Check Infura URL and API key
echo $WEB3_PROVIDER_URL
# Should output: https://mainnet.infura.io/v3/YOUR_PROJECT_ID

Problem: "Argon2 too slow / system freeze"

# Solution: Reduce Argon2 parameters in code
# Edit MaxSecurityConfig:
ARGON2_MEMORY_MB = 128  # Reduce from 512
ARGON2_ITERATIONS = 4   # Reduce from 16

Problem: "Rate limit exceeded"

# Solution: Wait for cooldown or increase limits
# Limits reset after 1 hour
# Or edit rate limit config

📚 Additional Resources

Documentation

  • Web3.py Docs
  • Ethereum Development Docs
  • Argon2 Specification
  • TOTP RFC 6238

Security Best Practices

  • OWASP Cryptographic Storage Cheat Sheet
  • NIST Password Guidelines
  • CWE Top 25 Software Weaknesses

Ethereum Tools

  • Etherscan - Blockchain explorer
  • Remix IDE - Smart contract development
  • MetaMask - Browser wallet

🤝 Contributing

Contributions welcome! Areas needing improvement:

  1. Testing: Add comprehensive test suite
  2. Documentation: Improve code documentation
  3. Security: Implement claimed features properly
  4. Performance: Optimize Argon2 parameters
  5. Features: Real HSM integration, multi-sig support
  6. UI: Web interface or CLI improvements

📞 Support

  • GitHub Issues: https://github.com/cerbug45/AI-Wallet-Payment-System/issues
  • Username: cerbug46
  • Repository: cerbug45/AI-Wallet-Payment-System

📄 License

MIT License - See LICENSE file for details

Last Updated: February 2024
Skill Version: 1.0
Code Version: 13.0

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • AI Wallet Payment System - Skill Guide
    • Overview
    • 🎯 What This Skill Does
      • Primary Capabilities
      • Use Cases
    • 📦 Installation & Setup
      • Step 1: System Dependencies
      • Step 2: Clone Repository
      • Step 3: Python Environment
      • Step 4: Install Python Dependencies
      • Step 5: Environment Configuration
      • Step 6: Verify Installation
    • 🚀 Quick Start Guide
      • Basic Usage Example
      • Command Line Demo
    • 🔒 Security Configuration
      • Password Requirements
      • Two-Factor Authentication Setup
      • Rate Limiting Configuration
      • Audit Logging
    • 🎓 Advanced Usage
      • Using with AI Agents
      • Environment-Specific Configuration
      • Backup and Recovery
    • 🧪 Testing Guide
      • Test on Testnet First
      • Unit Testing
    • ⚠️ Important Warnings
      • What This System Actually Provides
      • Production Checklist
      • Risk Acknowledgment
    • 🐛 Troubleshooting
      • Common Issues
    • 📚 Additional Resources
      • Documentation
      • Security Best Practices
      • Ethereum Tools
    • 🤝 Contributing
    • 📞 Support
    • 📄 License
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期