{"id":21036,"library":"chia-puzzles-py","title":"chia-puzzles-py","description":"A collection of the currently deployed ChiaLisp puzzles used in Chia blockchain, including standard transactions, CATs, DIDs, and other puzzle types. Version 0.20.3 supports Python >=3.8,<4.0.","status":"active","version":"0.20.3","language":"python","source_language":"en","source_url":"https://github.com/Chia-Network/chia-puzzles-py","tags":["chia","blockchain","clvm","puzzles","chialisp"],"install":[{"cmd":"pip install chia-puzzles-py","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for puzzle compilation and CLVM operations.","package":"clvm","optional":false},{"reason":"Required for higher-level puzzle tools and debugging.","package":"clvm_tools","optional":true}],"imports":[{"note":"Standard way to load .clvm puzzle files.","symbol":"load_clvm","correct":"from chia.puzzles.load_clvm import load_clvm"},{"note":"Direct module import is incorrect; must access specific functions.","wrong":"from chia.puzzles import p2_delegated_puzzle_or_hidden_puzzle","symbol":"p2_delegated_puzzle_or_hidden_puzzle","correct":"from chia.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk, solution_for_conditions"}],"quickstart":{"code":"from chia.puzzles.load_clvm import load_clvm\nfrom chia.types.blockchain_format.program import Program\n\n# Load a standard puzzle\npuzzle = load_clvm('p2_delegated_puzzle_or_hidden_puzzle.clvm')\nprint(puzzle)\n\n# Optionally export to hex\nprint(bytes(puzzle).hex())","lang":"python","description":"Loads a CLVM puzzle from the bundled .clvm files and prints it."},"warnings":[{"fix":"Update imports to use the new nested module layout. For example, change 'from chia.puzzles import p2_delegated' to 'from chia.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ...'.","message":"In version 0.20.x, the puzzle module structure was reorganized. Imports from 'chia.puzzles' directly may break. Use full submodule paths like 'chia.puzzles.p2_delegated_puzzle_or_hidden_puzzle'.","severity":"breaking","affected_versions":">=0.20.0,<0.21.0"},{"fix":"Clear the cache by calling 'load_clvm.cache_clear()' (Python 3.8+) or reload the module.","message":"The 'load_clvm' function caches compiled puzzles. If you modify a .clvm file at runtime, the cached version is used; restart the interpreter to see changes.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the full name 'p2_delegated_puzzle_or_hidden_puzzle' for new code.","message":"Some legacy puzzle names (e.g., 'p2_delegated_puzzle') are deprecated in favor of 'p2_delegated_puzzle_or_hidden_puzzle'. The old names may be removed in a future release.","severity":"deprecated","affected_versions":">=0.20.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install via 'pip install chia-puzzles-py'. Ensure you are using the correct import prefix 'chia.puzzles' (not 'puzzles' alone).","cause":"The package is not installed or the import path is wrong.","error":"ModuleNotFoundError: No module named 'chia.puzzles'"},{"fix":"Use 'from chia.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ...'","cause":"Direct import of 'chia.puzzles' fails because the module is a package; you must import the submodule explicitly.","error":"AttributeError: module 'chia.puzzles' has no attribute 'p2_delegated_puzzle_or_hidden_puzzle'"},{"fix":"Verify the puzzle name. Use 'load_clvm' with the exact filename (without path). Available puzzles include 'p2_delegated_puzzle_or_hidden_puzzle.clvm', 'singleton_top_layer.clvm', etc.","cause":"Attempting to load a .clvm file that does not exist in the bundled puzzles.","error":"clvm_tools.errors.CLVMError: unknown puzzle"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}