{"id":5689,"library":"py-builder-signing-sdk","title":"Python Builder Signing SDK","description":"The Python Builder Signing SDK facilitates the creation and signing of builder bids and bundles for blockchain applications, specifically in the context of MEV (Maximal Extractable Value) builders. It handles the cryptographic signing processes using `eth-account` and `eip712`. The current version is 0.0.2, and it appears to follow an infrequent release cadence, typical for specialized blockchain tools.","status":"active","version":"0.0.2","language":"en","source_language":"en","source_url":"https://github.com/Polymarket/py-builder-signing-sdk","tags":["ethereum","blockchain","signing","MEV","builder","cryptography","web3"],"install":[{"cmd":"pip install py-builder-signing-sdk","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required for Ethereum account management and cryptographic signing.","package":"eth-account","optional":false},{"reason":"Core Ethereum utility library, likely used for interacting with Ethereum data types and potentially RPC calls.","package":"web3","optional":false},{"reason":"Crucial for EIP-712 structured data signing, a standard for web3 applications.","package":"eip712","optional":false},{"reason":"Standard library for making HTTP requests, possibly used for submitting bids/bundles to an external service.","package":"requests","optional":false}],"imports":[{"symbol":"Builder","correct":"from builder_signing_sdk.builder import Builder"},{"symbol":"Account","correct":"from eth_account import Account"},{"symbol":"LocalAccount","correct":"from eth_account.signers.local import LocalAccount"}],"quickstart":{"code":"import os\nfrom builder_signing_sdk.builder import Builder\nfrom eth_account import Account\n\n# WARNING: In a real application, retrieve your private key securely, e.g., from environment variables.\n# DO NOT hardcode private keys in production code.\n# This is a dummy private key for demonstration purposes ONLY.\nprivate_key_env = os.environ.get('BUILDER_PRIVATE_KEY', '0x1111111111111111111111111111111111111111111111111111111111111111')\n\nif private_key_env == '0x1111111111111111111111111111111111111111111111111111111111111111':\n    print(\"WARNING: Using a dummy private key. Set BUILDER_PRIVATE_KEY environment variable for real usage.\")\n\n# Initialize an Ethereum account from the private key\naccount = Account.from_key(private_key_env)\n\n# Define your builder's name\nbuilder_name = os.environ.get('BUILDER_NAME', 'my-test-builder')\n\n# Initialize the Builder SDK\nbuilder = Builder(builder_name, account)\n\nprint(f\"Initialized Builder SDK for '{builder_name}' with Ethereum address: {account.address}\")\nprint(\"You can now use 'builder.sign_bid()' or 'builder.sign_bundle()' to sign MEV payloads.\")\n\n# Example of how you would call sign_bid (requires valid data, commented out to keep runnable):\n# signed_bid_id = builder.sign_bid(\n#     gas_limit=21000,\n#     gas_price=10**10,\n#     base_fee_per_gas=10**10,\n#     builder_eth_balance_delta=0,\n#     builder_eth_balance_after=0,\n#     block_number=12345678,\n#     tx_hash=\"0x\" + \"0\"*64, \n#     tx_eth_value=0,\n#     sender_address=account.address,\n#     destination_address=\"0x\" + \"0\"*40,\n#     mev_gas_price=0\n# )\n# print(f\"Signed dummy bid ID: {signed_bid_id}\")","lang":"python","description":"This quickstart initializes the `Builder` SDK with an Ethereum account. It demonstrates how to securely handle private keys using environment variables and provides a basic setup for signing builder bids and bundles. Note that the actual signing calls are commented out as they require valid, context-specific data."},"warnings":[{"fix":"Pin the exact version (e.g., `py-builder-signing-sdk==0.0.2`) in your `requirements.txt` or `pyproject.toml` and thoroughly test when upgrading.","message":"The library is in a very early stage (version 0.0.2). The API and internal mechanisms are subject to rapid change, potentially introducing breaking changes even between minor patch versions. Users should pin exact versions and review release notes diligently.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Always use secure methods for private key management, such as environment variables (e.g., `os.environ.get()`), a dedicated secret management service, or hardware security modules (HSMs).","message":"Directly embedding private keys in source code or insecurely managing them is a severe security risk. This library requires a private key for signing, which must be handled with extreme care.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure compatibility with your other `web3` and `eth-account` installations. If you encounter issues, check the `py-builder-signing-sdk`'s `setup.py` or `pyproject.toml` for explicit dependency version ranges and align your project's dependencies accordingly.","message":"The library relies on `web3` and `eth-account` as dependencies. Major version upgrades of these libraries (e.g., `web3` v5 to v6) have introduced significant breaking changes in the past, which could indirectly affect `py-builder-signing-sdk`'s behavior or require specific versions.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}