{"id":8887,"library":"cchecksum","title":"cchecksum","description":"cchecksum is a Python library that provides an approximately 18x faster, C-implemented drop-in replacement for `eth_utils.to_checksum_address`. It ensures full API compatibility, raising the exact same exceptions as the original `eth_utils` function. Currently at version 0.4.3, the library is actively maintained with a focus on performance optimizations and broad platform compatibility through pre-built wheels.","status":"active","version":"0.4.3","language":"en","source_language":"en","source_url":"https://github.com/BobTheBuidler/cchecksum","tags":["ethereum","checksum","performance","web3","cryptocurrency","eth_utils"],"install":[{"cmd":"pip install cchecksum","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for underlying hashing functionality, explicitly added as a dependency in v0.3.5 and later.","package":"eth-hash"}],"imports":[{"note":"cchecksum is a drop-in replacement; using the eth_utils import will not utilize the performance benefits of cchecksum.","wrong":"from eth_utils import to_checksum_address","symbol":"to_checksum_address","correct":"from cchecksum import to_checksum_address"}],"quickstart":{"code":"from cchecksum import to_checksum_address\nfrom binascii import unhexlify\n\n# Convert a lowercase hex string with 0x prefix\naddress_hex_lower = \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"\nchecksummed_address = to_checksum_address(address_hex_lower)\nprint(f\"Original: {address_hex_lower}\")\nprint(f\"Checksummed: {checksummed_address}\")\n\n# Convert bytes input (must be 20 bytes long)\naddress_bytes = unhexlify(address_hex_lower[2:]) # Removes '0x' prefix\nchecksummed_bytes_address = to_checksum_address(address_bytes)\nprint(f\"Original Bytes: {address_bytes.hex()}\")\nprint(f\"Checksummed Bytes: {checksummed_bytes_address}\")","lang":"python","description":"This quickstart demonstrates how to import and use the `to_checksum_address` function from `cchecksum` with both hexadecimal string and raw bytes inputs, producing an EIP-55 checksummed Ethereum address."},"warnings":[{"fix":"Upgrade Python to 3.9+ or pin `cchecksum<0.4.0` in your dependencies.","message":"Python 3.8 support was dropped in cchecksum v0.4.0. Users on Python 3.8 will need to use an older version of cchecksum (pre-0.4.0) or upgrade their Python interpreter to 3.9 or newer.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Replace `from eth_utils import to_checksum_address` with `from cchecksum import to_checksum_address` in your codebase.","message":"To benefit from cchecksum's performance improvements, you must explicitly import `to_checksum_address` from `cchecksum`. If `eth_utils.to_checksum_address` remains in your code, you will continue to use the slower Python-based implementation.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure you have a C compiler installed (e.g., `build-essential` on Linux, Microsoft C++ Build Tools on Windows) if encountering build errors during installation.","message":"Installation may require a C compiler if pre-compiled wheels are not available for your specific Python version and operating system. The core logic is implemented in C and Cython.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install cchecksum`.","cause":"The cchecksum package is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'cchecksum'"},{"fix":"Verify the import statement is exactly `from cchecksum import to_checksum_address`. If it persists, try reinstalling `cchecksum`.","cause":"Incorrect import statement or a damaged installation. The primary function is `to_checksum_address`.","error":"ImportError: cannot import name 'to_checksum_address' from 'cchecksum'"},{"fix":"Ensure `eth-hash` is installed: `pip install eth-hash`. Reinstalling `cchecksum` (`pip install cchecksum`) should also pull its dependencies.","cause":"cchecksum relies on `eth-hash` for its internal hashing, and `eth-hash` was not installed as a dependency, potentially due to an old `pip` or incomplete install prior to `v0.3.5`.","error":"ModuleNotFoundError: No module named 'eth_hash'"},{"fix":"Install the required C/C++ build tools for your operating system. For Windows, download and install 'Microsoft C++ Build Tools'. For Linux, install development packages like `build-essential` (Debian/Ubuntu) or `gcc` (CentOS/Fedora).","cause":"The installation failed because a C compiler is needed to compile cchecksum's C/Cython extensions, and a pre-built wheel was not available for the specific environment.","error":"error: Microsoft Visual C++ 14.0 or greater is required. Get it with \"Microsoft C++ Build Tools\": ..."}]}