Ethereum Wallet Generator
Sign Ethereum messages - EIP-191, EIP-712 typed data, Permit2, signature verification and recovery
Versions
1.0.0latestTools 62
batch_encrypt_keystores Encrypt multiple wallets into keystores in a single operation. Efficiently encrypts multiple private keys into keystore format. Can use a single password for all wallets or unique passwords for each. Args: wallets: List of wallet objects, each containing: - private_key: Required - hex private key - password: Optional - per-wallet password (if unique_passwords=True) password: Default password for all wallets (if unique_passwords=False) unique_passwords: If true, each wallet must have its own password kdf: Key derivation function - "scrypt" or "pbkdf2" Returns: Dictionary containing: - keystores: List of {address, keystore} objects - total_encrypted: Number of successfully encrypted wallets - kdf_used: KDF that was used - errors: List of any errors encountered Example: batch_encrypt_keystores( wallets=[ {"private_key": "0x..."}, {"private_key": "0x...", "password": "custom_pass"} ], password="default_pass", unique_passwords=False )
decrypt_keystore Decrypt a Web3 Secret Storage V3 keystore to recover private key. Decrypts an encrypted keystore file to extract the original private key. The password must match the one used during encryption. Args: keystore: Keystore JSON object or JSON string password: Decryption password return_format: "hex" (0x-prefixed) or "bytes" (base64-encoded) Returns: Dictionary containing: - private_key: Decrypted private key in requested format - address: Checksummed Ethereum address - keystore_id: UUID from keystore - kdf_used: KDF that was used - decryption_successful: true Errors: - INVALID_PASSWORD: MAC verification failed (wrong password) - UNSUPPORTED_VERSION: Not version 3 keystore - UNSUPPORTED_KDF: Unknown key derivation function - CORRUPTED_KEYSTORE: Missing or malformed fields
change_keystore_password Change keystore password and optionally upgrade KDF parameters. Decrypts the keystore with the old password and re-encrypts with the new password. Optionally change the KDF or upgrade security parameters. Args: keystore: Existing keystore JSON object or string old_password: Current password new_password: New password to set new_kdf: Optionally change KDF to "scrypt" or "pbkdf2" upgrade_security: If true, use maximum security parameters Returns: Dictionary containing: - new_keystore: Updated keystore JSON object - address: Ethereum address (unchanged) - old_kdf: Previous KDF - new_kdf: New KDF used - security_upgraded: Whether security was upgraded - password_changed: true
encrypt_keystore Encrypt a private key into Web3 Secret Storage V3 keystore format. Creates a standard Ethereum keystore file that can be used with any Ethereum wallet software. The keystore is encrypted using AES-128-CTR with a key derived from your password using either scrypt or PBKDF2. Args: private_key: Hex-encoded private key (with or without 0x prefix) password: Password for encryption (will be UTF-8 encoded) kdf: Key derivation function - "scrypt" (more secure, slower) or "pbkdf2" (faster, less memory-intensive) iterations: For pbkdf2 - number of iterations (default: 262144) work_factor: For scrypt - N parameter as power of 2 (default: 18 = 2^18 = 262144) Returns: Dictionary containing: - keystore: Complete Web3 V3 keystore JSON object - address: Checksummed Ethereum address (0x prefixed) - kdf_used: KDF that was used - security_level: "standard", "light", or "custom"
get_keystore_info Extract metadata from keystore without decrypting. Provides detailed information about a keystore's structure, security parameters, and recommendations without requiring the password. Args: keystore: Keystore JSON object or JSON string Returns: Dictionary containing: - address: Checksummed Ethereum address - keystore_id: UUID v4 identifier - version: Keystore version (should be 3) - kdf: Key derivation function used - kdf_params: Full KDF parameters - cipher: Encryption cipher used - security_assessment: Security strength analysis
validate_keystore Validate keystore structure and parameters. Performs comprehensive validation of a keystore file against the Web3 Secret Storage V3 specification. Args: keystore: Keystore to validate (JSON object or string) strict: If true, require recommended security parameters Returns: Dictionary containing: - is_valid: Overall validation result - version: Detected version - errors: List of critical errors - warnings: List of non-critical issues - checks: Detailed check results for each field Checks performed: - has_version: Version field exists - version_is_3: Version equals 3 - has_id: UUID field exists - id_is_valid_uuid: UUID is valid format - has_address: Address field exists - address_is_valid: Address is valid hex - has_crypto: Crypto section exists - has_ciphertext: Ciphertext exists - has_cipherparams: Cipher params exist - has_iv: IV exists - iv_length_valid: IV is correct length - has_cipher: Cipher field exists - cipher_supported: Cipher is aes-128-ctr - has_kdf: KDF field exists - kdf_supported: KDF is scrypt or pbkdf2 - has_kdfparams: KDF params exist - kdfparams_valid: KDF params are complete - has_mac: MAC field exists - mac_length_valid: MAC is correct length
save_keystore_file Save keystore JSON to file with standard Ethereum naming convention. Writes the keystore to a file with secure permissions (0600). Uses the standard Ethereum keystore naming format by default. Args: keystore: Keystore JSON object from encrypt_keystore directory: Target directory path (default: current directory) filename: Custom filename (overrides standard naming if provided) use_standard_naming: Use UTC--timestamp--address format (default: true) Returns: Dictionary containing: - filepath: Absolute path to saved file - filename: Name of the file - address: Checksummed Ethereum address - file_size_bytes: Size of saved file - permissions: File permissions (0600) Standard Naming Format: UTC--YYYY-MM-DDTHH-MM-SS.sssZ--<address-lowercase-no-0x> Example: UTC--2024-01-15T10-30-00.000Z--1234567890abcdef... Security: - File created with 0600 permissions (owner read/write only) - Directory created with 0700 if it doesn't exist
load_keystore_file Load and optionally validate a keystore file. Reads a keystore JSON file from disk and optionally validates its structure according to Web3 Secret Storage V3 specification. Args: filepath: Path to keystore JSON file validate: Whether to validate keystore structure (default: true) Returns: Dictionary containing: - keystore: Full keystore JSON object - filepath: Absolute path to file - filename: Name of the file - address: Checksummed Ethereum address - version: Keystore version (should be 3) - kdf: Key derivation function used - is_valid: Validation result (if validate=true) - validation_details: Detailed validation checks
compose_signature Compose a signature from v, r, s components. Args: v: Recovery parameter (0, 1, 27, or 28) r: 32-byte r value in hex s: 32-byte s value in hex output_format: "standard" (v=27/28) or "recovery_id" (v=0/1) Returns: Composed 65-byte signature
normalize_signature Normalize a signature to a specific v format. Args: signature: 65-byte signature in hex target_format: "standard" (27/28) or "recovery_id" (0/1) Returns: Normalized signature
keystore_to_private_key_file Decrypt keystore and save private key to file. ⚠️ DANGEROUS OPERATION - use with extreme caution! This exports the private key in UNENCRYPTED form. The resulting file should be securely deleted immediately after use. Args: keystore: Keystore to decrypt (JSON object or string) password: Decryption password output_format: "hex" (0x-prefixed) or "raw_bytes" filepath: Output file path (default: ./private_key_<address>.txt) Returns: Dictionary containing: - filepath: Path to saved private key file - address: Ethereum address - format: Format used for export - file_permissions: File permissions (0600) - warning: Security warning message Security Warning: 🔴 Private key saved in plaintext - secure or delete immediately! 🔴 Anyone with access to this file has full control of the wallet 🔴 Consider using encrypted backup methods instead
encode_function_selector Encode function signature to 4-byte selector. Computes the keccak256 hash of the function signature and returns the first 4 bytes as the function selector. Args: function_signature: Function signature (e.g., "transfer(address,uint256)") Returns: Dictionary containing: - selector: 4-byte function selector (0x + 8 hex chars) - full_hash: Complete keccak256 hash - function_signature: Input signature - normalized_signature: Cleaned signature - parameter_types: List of parameter types - function_name: Function name only
decode_function_selector Decode 4-byte function selector to signature. Looks up the selector in a database of known function signatures. Note: Some selectors may have collisions (multiple functions with same selector). Args: selector: 4-byte selector (0x + 8 hex chars) use_database: Whether to look up in known signatures database Returns: Dictionary containing: - selector: Input selector (normalized) - known_signatures: List of known function signatures - most_likely: Most likely signature (if known) - collision_count: Number of known signatures - is_known: Whether selector is in database - category: Function category (if known) - description: Function description (if known)
calculate_storage_slot Calculate contract storage slot positions. Computes storage slot locations for Solidity storage layouts, supporting simple slots, mappings, and dynamic arrays. Args: base_slot: Base storage slot (hex string, position in contract storage) key: Mapping key (for mapping types) - address or uint256 slot_type: "simple", "mapping", or "dynamic_array" Returns: Dictionary containing: - storage_slot: Computed storage slot (0x + 64 hex chars) - slot_type: Type of slot computation - calculation: Details of calculation method - use_with: How to use with eth_getStorageAt Storage Layout Rules: - Simple: slot = declared position (0, 1, 2, ...) - Mapping: slot = keccak256(key . base_slot) where . is concatenation - Dynamic array: length at base_slot, data at keccak256(base_slot)
to_checksum_address Convert any Ethereum address to EIP-55 checksummed format. Takes an address in any valid format and returns the properly checksummed version according to EIP-55 specification. Args: address: Any valid Ethereum address format Returns: Dictionary containing: - checksum_address: EIP-55 checksummed address - input_address: Original input - was_already_checksummed: Whether input was already checksummed - checksum_hash: Keccak256 hash used for checksumming - uppercase_positions: Indices of uppercase characters - lowercase_positions: Indices of lowercase characters
derive_address_from_private_key Derive Ethereum address from a private key. Performs the full derivation chain: private key → public key → address, optionally returning the intermediate public key values. Args: private_key: Hex-encoded private key (with or without 0x prefix) include_public_key: Whether to include public key in response Returns: Dictionary containing: - address: Checksummed Ethereum address - address_lowercase: Lowercase address - public_key: Public key info (if include_public_key=True) - derivation_steps: Explanation of derivation process
derive_address_from_public_key Derive Ethereum address from a public key. Supports both compressed (33 bytes) and uncompressed (64/65 bytes) formats. Args: public_key: Hex-encoded public key key_format: "auto", "compressed", or "uncompressed" Returns: Dictionary containing: - address: Checksummed Ethereum address - input_format_detected: Detected key format - public_key_normalized: Normalized public key formats - keccak_hash: Full keccak hash - address_bytes: Last 20 bytes of hash
validate_signature Validate ECDSA signature components. Validates v, r, s signature values for correctness, checking ranges and optionally enforcing EIP-2 low-s requirement. Args: v: Recovery ID (27, 28, or EIP-155 encoded with chain ID) r: Signature r value (hex string with or without 0x) s: Signature s value (hex string with or without 0x) strict: If true, enforce EIP-2 low-s requirement Returns: Dictionary containing: - is_valid: Whether signature components are valid - v: Detailed v value info (value, recovery_id, is_eip155, chain_id) - r: Detailed r value info (value, byte_length, is_valid_range) - s: Detailed s value info (value, byte_length, is_valid_range, is_low_s) - validation_details: Individual validation checks - eip2_compliant: Whether signature meets EIP-2 requirements - warnings: Any warnings about the signature
validate_address Comprehensive Ethereum address validation. Validates an Ethereum address format, optionally verifying EIP-55 checksum. Returns detailed information about the address validity and format. Args: address: Address to validate (any format - with/without 0x, any case) check_checksum: Whether to verify EIP-55 checksum if present return_normalized: Return checksummed version Returns: Dictionary containing: - is_valid: Whether the address is valid - address_input: Original input - address_checksum: EIP-55 checksummed version - address_lowercase: Lowercase version - format_detected: Format of input (lowercase/checksum/mixed_invalid) - checksum_valid: Whether checksum is valid (null if not checksummed) - checksum_status: valid/invalid/not_checksummed - byte_length: Address byte length (should be 20) - validation_details: Detailed validation info - warnings: Any warnings about the address
compare_addresses Compare two Ethereum addresses for equality (case-insensitive). Compares two addresses after normalizing them, returning whether they represent the same Ethereum address regardless of case/format. Args: address1: First address address2: Second address Returns: Dictionary containing: - are_equal: Whether addresses are the same - address1: Info about first address - address2: Info about second address - comparison_method: How comparison was done - case_matches: Whether cases match exactly - both_valid_checksum: Whether both have valid checksums
batch_validate_addresses Validate multiple Ethereum addresses at once. Efficiently validates a list of addresses, returning summary statistics and detailed results for each address. Args: addresses: List of addresses to validate check_checksum: Verify checksums for all addresses stop_on_invalid: Stop at first invalid address Returns: Dictionary containing: - total_count: Total addresses checked - valid_count: Number of valid addresses - invalid_count: Number of invalid addresses - all_valid: Whether all addresses are valid - results: Detailed result for each address - invalid_addresses: List of invalid addresses with errors - valid_addresses: List of valid checksummed addresses
generate_vanity_check Check if an address matches vanity criteria. Checks whether an Ethereum address matches specified vanity patterns (prefix, suffix, or contains) and calculates pattern difficulty. Args: address: Address to check prefix: Required prefix (after 0x), case-insensitive suffix: Required suffix, case-insensitive contains: Required substring, case-insensitive Returns: Dictionary containing: - matches_all: Whether all criteria are met - address: Checksummed address - checks: Individual check results - details: What was matched - pattern_difficulty: Estimated difficulty
keccak256_hash Compute Keccak-256 hash (Ethereum's hash function). Computes the Keccak-256 hash used throughout Ethereum for addresses, signatures, storage slots, and more. Args: data: Data to hash input_type: Input format - "hex" (0x-prefixed), "text" (UTF-8 string), or "bytes" (base64 encoded) Returns: Dictionary containing: - hash: 0x-prefixed hash (64 hex chars) - hash_no_prefix: Hash without 0x prefix - input_type: Input type used - input_byte_length: Length of input in bytes - algorithm: Hash algorithm used - note: Important note about Keccak vs SHA3 Note: Ethereum uses Keccak-256, which differs from NIST SHA3-256. This is the pre-standardization version of SHA3.
validate_ens_name Validate ENS name format (offline validation only). Validates the format of an ENS name and computes its namehash. Does not perform actual resolution (requires network access). Args: name: ENS name (e.g., "vitalik.eth") check_format_only: Only check format, not resolution Returns: Dictionary containing: - is_valid_format: Whether the name format is valid - name: Original name - normalized: Normalized name - namehash: ENS namehash (recursive keccak256) - labels: List of labels (e.g., ["vitalik", "eth"]) - tld: Top-level domain (e.g., "eth") - validation_details: Detailed validation checks - note: Reminder that resolution requires network
validate_hex_data Validate hexadecimal data for Ethereum use. Validates hex strings and attempts to identify their type based on length and format patterns. Args: data: Hex string to validate expected_type: Expected type - "auto", "address", "private_key", "public_key", "transaction_hash", "signature", "calldata" expected_length: Expected byte length (optional) Returns: Dictionary containing: - is_valid: Whether data is valid hex - input: Original input - normalized: Normalized lowercase with 0x prefix - has_0x_prefix: Whether input had 0x prefix - byte_length: Length in bytes - bit_length: Length in bits - detected_type: Auto-detected type - type_confidence: Confidence level (high/medium/low) - validation_details: Detailed validation checks - statistics: Byte statistics (zero_bytes, non_zero_bytes, etc.)
validate_signature_format Validate and analyze a signature's format. Checks length, v value format, and EIP-2 compliance (low-s). Args: signature: Signature to validate Returns: Detailed validation results
validate_private_key Validate an Ethereum private key. Performs comprehensive validation of a private key including format, range checking, and optionally derives the corresponding address. Args: private_key: Hex-encoded private key (with or without 0x prefix) derive_address: Whether to derive and return the address Returns: Dictionary containing: - is_valid: Whether the key is valid - key_format: Detected format (hex_with_prefix/hex_without_prefix) - byte_length: Key byte length (should be 32) - derived_address: Derived Ethereum address (if derive_address=True) - public_key: Public key info (uncompressed, compressed, x, y) - validation_details: Detailed validation checks - security_assessment: Security warnings and recommendations Security Notes: - Private key is validated in memory only - Never logged or transmitted - Clear from memory after use
sign_hash Sign a raw 32-byte hash (DANGEROUS - requires acknowledgement). WARNING: Signing arbitrary hashes can authorize transactions or other actions. Only use if you computed the hash yourself and understand exactly what it represents. Args: message_hash: 32-byte hash to sign (hex) private_key: Private key (hex) risk_acknowledgement: Must be exactly "I understand signing raw hashes is dangerous" Returns: Signature and warning message
sign_typed_data Sign EIP-712 typed structured data. Used for signing permits, DEX orders, and other DeFi operations that require human-readable, typed signing. Args: typed_data: EIP-712 typed data with types, primaryType, domain, message private_key: Hex-encoded 32-byte private key Returns: Dictionary containing signature and signing details
verify_typed_data Verify an EIP-712 typed data signature. Args: typed_data: EIP-712 typed data structure signature: 65-byte signature in hex format expected_address: Address expected to have signed Returns: Dictionary with verification result
recover_typed_data_signer Recover the signer address from an EIP-712 typed data signature. Args: typed_data: EIP-712 typed data structure signature: 65-byte signature in hex format Returns: Dictionary containing recovered signer address
hash_typed_data Compute the EIP-712 hash of typed data without signing. Useful for debugging and verifying hash computation. Args: typed_data: EIP-712 typed data structure Returns: Dictionary containing the signing hash
get_typed_data_template Get a template for common EIP-712 typed data structures. Available templates: permit, permit2, order, delegation, mail Args: template_name: Name of the template (permit, permit2, order, delegation, mail) Returns: Template with types, domain, and message structure
sign_message Sign a text message using EIP-191 (personal_sign) format. This is the standard method for signing messages in Ethereum wallets. The message is prefixed with "\x19Ethereum Signed Message:\n<length>" to prevent signed messages from being used as transactions. Args: message: The text message to sign private_key: Hex-encoded 32-byte private key (with or without 0x prefix) Returns: Dictionary containing: - message: Original message - signer: Address that signed the message - signature: 65-byte signature in hex format - v, r, s: Signature components - message_hash: Hash that was actually signed
sign_message_hex Sign hex-encoded bytes using EIP-191 format. Use this when signing raw bytes rather than text. Args: message_hex: Hex-encoded bytes to sign (with or without 0x prefix) private_key: Hex-encoded 32-byte private key Returns: Dictionary containing signature and related data
verify_message Verify an EIP-191 signed message. Recovers the signer from the signature and compares to the expected address. Args: message: Original message that was signed signature: 65-byte signature in hex format expected_address: Address expected to have signed the message Returns: Dictionary containing: - is_valid: True if signature is valid and from expected address - recovered_address: Address that actually signed - match: Whether addresses match
recover_signer Recover the signer address from a signed message. Args: message: Original message that was signed signature: 65-byte signature in hex format Returns: Dictionary containing: - signer: Address that signed the message - success: Whether recovery was successful
decompose_signature Decompose a 65-byte signature into v, r, s components. Args: signature: 65-byte signature in hex format Returns: Dictionary with v, r, s values and format information
generate_typed_data_template Generate a template EIP-712 typed data structure for common use cases. This provides ready-to-use templates for common DeFi operations like permits, orders, and delegations. Just fill in the required fields. Args: template_type: Type of template to generate. One of: - "permit": ERC20 Permit (EIP-2612) for gasless approvals - "permit2": Uniswap Permit2 for universal token approvals - "order": DEX order for limit orders - "delegation": Delegation signature for voting power - "mail": Simple mail example from EIP-712 spec - "custom": Empty template to customize chain_id: Chain ID for the domain (default: 1 for mainnet) contract_address: Verifying contract address (optional) Returns: Dictionary containing: - template: Complete EIP-712 structure to fill in - description: Explanation of the template - required_fields: Fields that must be filled - example_values: Example values for each field Example: >>> result = await generate_typed_data_template("permit", 137) >>> # Returns template for ERC-20 permit on Polygon
generate_wallet Generate a new random Ethereum wallet. Creates a cryptographically secure random private key and derives the corresponding Ethereum address and public key. Returns: dict containing: - address: Ethereum address (0x prefixed, checksummed) - private_key: Private key (0x prefixed, hex) - public_key: Public key (0x prefixed, hex) Example: { "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00", "private_key": "0x4c0883a69102937d6231471b5dbb6204fe512961708279f2e3e8a5d4b8e3c1a2", "public_key": "0x04bfcab..." }
generate_wallet_with_mnemonic Generate a new wallet with BIP39 mnemonic seed phrase. Creates a new BIP39 mnemonic and derives an Ethereum wallet from it using the specified derivation path. The mnemonic can be used to recover the wallet later. Args: word_count: Number of mnemonic words (12, 15, 18, 21, or 24). Default: 12 language: Mnemonic language (english, spanish, french, italian, japanese, korean, chinese_simplified, chinese_traditional). Default: english passphrase: Optional BIP39 passphrase (25th word) for additional security. Default: "" derivation_path: HD derivation path. Default: m/44'/60'/0'/0/0 Returns: dict containing: - address: Derived Ethereum address - private_key: Private key - public_key: Public key - mnemonic: BIP39 mnemonic phrase (space-separated words) - derivation_path: Path used for derivation - passphrase_used: Whether a passphrase was applied Security Warning: Store the mnemonic phrase securely! Anyone with access to it can derive all wallets and access all funds.
restore_wallet_from_mnemonic Restore a wallet from an existing BIP39 mnemonic. Derives an Ethereum wallet from a previously generated mnemonic phrase. The same mnemonic and passphrase will always derive the same wallet. Args: mnemonic: BIP39 mnemonic phrase (space-separated words) passphrase: Optional BIP39 passphrase that was used during creation. Default: "" derivation_path: HD derivation path. Default: m/44'/60'/0'/0/0 Returns: dict containing: - address: Derived Ethereum address - private_key: Private key - public_key: Public key - derivation_path: Path used for derivation - passphrase_used: Whether a passphrase was applied Raises: INVALID_MNEMONIC: If the mnemonic is invalid (wrong word count, invalid words, or failed checksum)
restore_wallet_from_private_key Restore a wallet from a private key. Derives the Ethereum address and public key from a private key. Accepts the key with or without '0x' prefix. Args: private_key: Hex-encoded private key (with or without 0x prefix) Returns: dict containing: - address: Derived Ethereum address - private_key: Normalized private key (0x prefixed) - public_key: Public key Raises: INVALID_KEY: If the private key format is invalid
derive_multiple_accounts Derive multiple accounts from a single mnemonic (HD wallet batch derivation). Generates multiple Ethereum accounts from a single seed phrase by incrementing the account index in the derivation path. Args: mnemonic: BIP39 mnemonic phrase count: Number of accounts to derive (1-100). Default: 5 start_index: Starting account index. Default: 0 passphrase: Optional BIP39 passphrase. Default: "" base_path: Base HD path (index will be appended). Default: m/44'/60'/0'/0 Returns: dict containing: - accounts: List of account objects, each with: - index: Account index - derivation_path: Full derivation path - address: Ethereum address - private_key: Private key - public_key: Public key - total_derived: Number of accounts derived - base_path: Base path used - passphrase_used: Whether passphrase was applied Example: derive_multiple_accounts(mnemonic="abandon ...", count=3) Returns 3 accounts at paths: m/44'/60'/0'/0/0 m/44'/60'/0'/0/1 m/44'/60'/0'/0/2
calculate_gas_for_data Calculate the intrinsic gas cost for transaction data. Gas costs: 4 per zero byte, 16 per non-zero byte Args: data: Hex-encoded transaction data Returns: Gas cost breakdown for data
generate_vanity_address Generate an Ethereum address matching a vanity pattern. Repeatedly generates random wallets until one matches the specified prefix and/or suffix pattern. This is a computationally intensive operation that may take significant time for longer patterns. Args: prefix: Desired address prefix (after 0x), hex chars only suffix: Desired address suffix, hex chars only case_sensitive: Match case exactly using EIP-55 checksum. Default: false timeout_seconds: Maximum time to search (1-300 seconds). Default: 60 Returns: dict containing: - address: Matching vanity address - private_key: Private key - public_key: Public key - pattern_matched: The pattern that was matched - attempts: Number of addresses tried - time_seconds: Time taken - difficulty: Estimated 1-in-N difficulty - warning: Security warning about vanity addresses Raises: INVALID_PATTERN: If prefix/suffix contains non-hex characters TIMEOUT: If no match found within timeout period Performance Notes: - Each additional character increases difficulty 16x - 4 chars: ~65,000 attempts average - 6 chars: ~16 million attempts average - 8+ chars: May take hours or never complete Security Warning: ⚠️ Vanity address generation carries inherent risks. Never use vanity addresses for high-value storage. Consider hardware wallets for real funds.
build_transaction Build an unsigned Ethereum transaction. Args: to: Recipient address value: Value in wei (default 0) nonce: Transaction nonce (get from chain) gas: Gas limit (21000 for simple transfer) chain_id: Chain ID (1 for mainnet) data: Transaction data in hex (default "0x") tx_type: "legacy" or "eip1559" (default) gas_price: Gas price in wei (for legacy) max_fee_per_gas: Max fee in wei (for EIP-1559) max_priority_fee_per_gas: Priority fee in wei (for EIP-1559) Returns: Unsigned transaction object with cost estimates
validate_transaction Validate a transaction's fields. Checks for missing fields, invalid values, and common issues. Args: tx: Transaction dictionary to validate Returns: Validation results with issues and warnings
compare_transactions Compare two transactions field by field. Args: tx1: First transaction tx2: Second transaction Returns: Comparison showing differences and matches
encode_transfer Encode an ERC-20 transfer function call. Args: to: Recipient address amount: Token amount in smallest units Returns: Encoded calldata for transfer
encode_approve Encode an ERC-20 approve function call. Args: spender: Address to approve amount: Token amount to approve (use 2**256-1 for unlimited) Returns: Encoded calldata for approve
encode_transfer_from Encode an ERC-20 transferFrom function call. Args: from_addr: Address to transfer from to_addr: Recipient address amount: Token amount Returns: Encoded calldata for transferFrom
encode_function_call Encode an arbitrary function call. Args: function_signature: Function signature (e.g., "transfer(address,uint256)") params: List of parameter values Returns: Encoded calldata
decode_calldata Decode transaction calldata. Identifies the function selector and attempts to decode parameters. Args: calldata: Transaction input data in hex Returns: Decoded function and parameters
convert_gas_units Convert between Ethereum value units. Supported units: wei, kwei, mwei, gwei, szabo, finney, ether/eth Args: value: The value to convert from_unit: Source unit to_unit: Target unit Returns: Converted value
estimate_transaction_cost Estimate the total cost of a transaction. For legacy: provide gas_price_gwei For EIP-1559: provide max_fee_per_gas_gwei (and optionally base_fee + priority_fee) Args: gas_limit: Gas limit for the transaction gas_price_gwei: Gas price in gwei (for legacy) max_fee_per_gas_gwei: Max fee per gas in gwei (for EIP-1559) base_fee_gwei: Current base fee (for actual cost calculation) priority_fee_gwei: Priority fee (for actual cost calculation) value_eth: Value being transferred in ETH Returns: Cost breakdown in wei and ETH
get_gas_estimate Get gas estimates for common operations. Available operations: transfer, erc20_transfer, erc20_approve, erc721_transfer, uniswap_swap, contract_deployment Args: operation: The operation type Returns: Estimated gas for the operation
sign_transaction Sign an Ethereum transaction offline. Creates either a legacy or EIP-1559 transaction based on gas parameters. Args: to: Recipient address value: Value in wei nonce: Transaction nonce gas: Gas limit chain_id: Chain ID private_key: Signer's private key (hex) data: Transaction data (hex, default "0x") gas_price: Gas price in wei (for legacy tx) max_fee_per_gas: Max fee in wei (for EIP-1559) max_priority_fee_per_gas: Priority fee in wei (for EIP-1559) Returns: Signed transaction with raw bytes and hash
sign_transaction_object Sign a pre-built transaction object. Args: tx: Transaction dictionary with to, nonce, gas, chainId, etc. private_key: Signer's private key (hex) Returns: Signed transaction with raw bytes and hash
recover_transaction_signer Recover the signer address from a signed transaction. Args: raw_tx: Signed raw transaction in hex Returns: Recovered signer address
decode_raw_transaction Decode a raw signed transaction. Supports Legacy (Type 0), EIP-2930 (Type 1), and EIP-1559 (Type 2). Args: raw_tx: Signed raw transaction in hex format Returns: Decoded transaction fields including signer
analyze_transaction Decode and analyze a transaction in detail. Provides decoded fields plus analysis of gas, value, and function calls. Args: raw_tx: Signed raw transaction in hex format Returns: Decoded transaction with analysis notes
Permissions 3
filesystem low shell high env_vars low