Skip to main content

chaincodec (Python)

Universal blockchain ABI decoder — production-grade EVM event log and function call decoding, with 50+ built-in DeFi/NFT/bridge protocol schemas.

PyPI Python License: MIT

Install

pip install chaincodec

Prebuilt wheels for Linux (x64, arm64, musl), macOS (x64, arm64), and Windows (x64). No Rust toolchain required.

Quick Start

import asyncio
from chaincodec import EvmDecoder, MemoryRegistry

async def main():
    # Load a schema
    registry = MemoryRegistry()
    registry.load_file("schemas/erc20.csdl")

    decoder = EvmDecoder()

    # Decode an ERC-20 Transfer event
    raw_log = {
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "topics": [
            "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
            "0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045",
            "0x000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b",
        ],
        "data": "0x000000000000000000000000000000000000000000000000000000003b9aca00",
    }

    fingerprint = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
    schema = registry.get_by_fingerprint(fingerprint)

    event = decoder.decode_event(raw_log, schema)
    print(event)
    # DecodedEvent(schema="ERC20Transfer", fields={"from": "0xd8dA...", "to": "0xAb58...", "value": 1000000000})

asyncio.run(main())

Decode Function Calls

from chaincodec import EvmCallDecoder, MemoryRegistry

registry = MemoryRegistry()
registry.load_file("schemas/uniswap-v3.csdl")

decoder = EvmCallDecoder()
call_data = bytes.fromhex("414bf389...")  # exactInputSingle calldata

result = decoder.decode_call(call_data, registry)
print(result.function_name)  # "exactInputSingle"
print(result.inputs)         # [("tokenIn", "0x..."), ("amountIn", 1000000)]

Encode Function Calls

from chaincodec import EvmEncoder, MemoryRegistry

registry = MemoryRegistry()
registry.load_file("schemas/erc20.csdl")

encoder = EvmEncoder()
calldata = encoder.encode_call("transfer", ["0xRecipient...", 1_000_000], registry)
# b'\xa9\x05\x9c\xbb...'

Batch Decode

from chaincodec import EvmDecoder, MemoryRegistry

registry = MemoryRegistry()
registry.load_directory("schemas/")   # loads all 50+ schemas

decoder = EvmDecoder()
events = decoder.decode_batch(raw_logs, registry)
# Parallel decode via Rayon — >1M events/sec

Built-in Schemas (53 protocols)

Category Protocols
Tokens ERC-20, ERC-721, ERC-1155, WETH, ERC-4626, ENS, ERC-4337
DEX Uniswap V2/V3, SushiSwap, Curve, Balancer V2, Camelot, DODO, Bancor V3
Lending Aave V2/V3, Compound V2/V3, Morpho Blue, Spark
Derivatives GMX, GMX V1, dYdX V4, Perpetual Protocol, Synthetix V3, Ribbon Finance
LSD/Staking Lido, Rocket Pool, Frax Ether, Stader, EigenLayer, Convex, Yearn
Bridges Wormhole, LayerZero V2, Hop, Celer, Stargate, Across
NFT OpenSea, Blur, CryptoPunks, BAYC, LooksRare
Governance Safe Multisig, Compound Governance
Oracle Chainlink (Aggregator, VRF, CCIP)
Other Pendle Finance, Maker DAO

Metadata

Release files for chainfoundry-chaincodec 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for chainfoundry-chaincodec 0.2.0
File
chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details
chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ ARM64 Details

Total release size: 3.4 MB

Release files / chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl

Download URL chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl
Size 566.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
31a55a89f9afa954783e618f5cbc607915ed0da6a202a6c6f1dcbcd22064989e
BLAKE2b-256 checksum
How to use checksums
17328c9950065cb4146496a6193a94bde4e96326af003a58b4988e6bd5515f85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Size 654.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f21f9d77414cdc91e98da39e0945deccf94a9630141b670dbaad812ea8420e85
BLAKE2b-256 checksum
How to use checksums
35c6dde7d23ad9cbcb861a1567b80f39b9e52368871ab48667427c2dbf48f788
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl

Download URL chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl
Size 669.2 kB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ad12044335f675b28ec8c4a57d8c35472afac9de4b019bf695230e0c5db4552d
BLAKE2b-256 checksum
How to use checksums
55e581cb89e16e647b7ff8fa9f433380246c50617b53ca013f54453d03e1c43c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 752.9 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1bd64a26ff63329d5388a26614f1363b35e4ed46f22fa7ff059736e1342fbf94
BLAKE2b-256 checksum
How to use checksums
0ca9839292fc2cbfa7877fbedb003cc8816ca2f056483e664d8b138be4ab9b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 727.3 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
13db8faae31d9275ae4f9178c151e7bff205b627af31d65407fa90109e6d3efc
BLAKE2b-256 checksum
How to use checksums
597f5801c1ee9ffbcd85907d8848b40ef14b9f4fd0aa0be257bc26ce43155f6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Security for chainfoundry-chaincodec 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page