chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chia/__init__.py +7 -0
- chia/_tests/blockchain/blockchain_test_utils.py +1 -1
- chia/_tests/blockchain/test_augmented_chain.py +54 -5
- chia/_tests/blockchain/test_blockchain.py +5 -12
- chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
- chia/_tests/blockchain/test_get_block_generator.py +2 -2
- chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
- chia/_tests/clvm/benchmark_costs.py +2 -1
- chia/_tests/clvm/coin_store.py +4 -3
- chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +1 -1
- chia/_tests/clvm/test_puzzle_compression.py +2 -2
- chia/_tests/clvm/test_puzzles.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -2
- chia/_tests/clvm/test_spend_sim.py +1 -1
- chia/_tests/cmds/cmd_test_utils.py +2 -2
- chia/_tests/cmds/test_click_types.py +2 -2
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_show.py +4 -3
- chia/_tests/cmds/test_tx_config_args.py +1 -1
- chia/_tests/cmds/testing_classes.py +2 -2
- chia/_tests/cmds/wallet/test_consts.py +2 -2
- chia/_tests/cmds/wallet/test_did.py +2 -2
- chia/_tests/cmds/wallet/test_nft.py +2 -2
- chia/_tests/cmds/wallet/test_notifications.py +3 -2
- chia/_tests/cmds/wallet/test_vcs.py +2 -2
- chia/_tests/cmds/wallet/test_wallet.py +4 -8
- chia/_tests/conftest.py +4 -3
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_keys.py +1 -2
- chia/_tests/core/cmds/test_wallet.py +2 -2
- chia/_tests/core/consensus/test_block_creation.py +2 -2
- chia/_tests/core/consensus/test_pot_iterations.py +1 -1
- chia/_tests/core/custom_types/test_coin.py +2 -2
- chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
- chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
- chia/_tests/core/data_layer/conftest.py +1 -1
- chia/_tests/core/data_layer/test_data_layer.py +1 -1
- chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
- chia/_tests/core/data_layer/test_data_rpc.py +2 -2
- chia/_tests/core/data_layer/test_data_store.py +1 -1
- chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
- chia/_tests/core/data_layer/util.py +2 -1
- chia/_tests/core/farmer/test_farmer_api.py +1 -1
- chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
- chia/_tests/core/full_node/ram_db.py +2 -1
- chia/_tests/core/full_node/stores/test_block_store.py +2 -2
- chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
- chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
- chia/_tests/core/full_node/test_address_manager.py +1 -1
- chia/_tests/core/full_node/test_block_height_map.py +2 -2
- chia/_tests/core/full_node/test_conditions.py +1 -1
- chia/_tests/core/full_node/test_full_node.py +346 -164
- chia/_tests/core/full_node/test_generator_tools.py +3 -2
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -15
- chia/_tests/core/full_node/test_subscriptions.py +1 -1
- chia/_tests/core/full_node/test_transactions.py +186 -185
- chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
- chia/_tests/core/make_block_generator.py +2 -2
- chia/_tests/core/mempool/test_mempool.py +165 -22
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
- chia/_tests/core/mempool/test_mempool_manager.py +476 -66
- chia/_tests/core/mempool/test_mempool_performance.py +2 -2
- chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
- chia/_tests/core/node_height.py +2 -1
- chia/_tests/core/server/test_capabilities.py +1 -1
- chia/_tests/core/server/test_dos.py +36 -28
- chia/_tests/core/server/test_loop.py +3 -3
- chia/_tests/core/server/test_rate_limits.py +1 -1
- chia/_tests/core/server/test_server.py +2 -2
- chia/_tests/core/services/test_services.py +1 -1
- chia/_tests/core/ssl/test_ssl.py +1 -1
- chia/_tests/core/test_coins.py +2 -1
- chia/_tests/core/test_cost_calculation.py +2 -2
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +2 -2
- chia/_tests/core/test_db_validation.py +26 -13
- chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +2 -2
- chia/_tests/core/test_program.py +2 -2
- chia/_tests/core/test_rpc_util.py +1 -1
- chia/_tests/core/test_seeder.py +1 -1
- chia/_tests/core/util/test_block_cache.py +3 -3
- chia/_tests/core/util/test_jsonify.py +3 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_streamable.py +3 -4
- chia/_tests/environments/wallet.py +3 -2
- chia/_tests/farmer_harvester/test_farmer.py +3 -4
- chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
- chia/_tests/generator/test_compression.py +20 -10
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -2
- chia/_tests/plot_sync/test_plot_sync.py +2 -2
- chia/_tests/plot_sync/test_receiver.py +2 -2
- chia/_tests/plot_sync/test_sender.py +2 -2
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +3 -2
- chia/_tests/plotting/test_plot_manager.py +1 -1
- chia/_tests/pools/test_pool_cli_parsing.py +3 -2
- chia/_tests/pools/test_pool_cmdline.py +2 -2
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
- chia/_tests/pools/test_pool_rpc.py +4 -5
- chia/_tests/pools/test_pool_wallet.py +1 -1
- chia/_tests/pools/test_wallet_pool_store.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +1 -1
- chia/_tests/rpc/test_rpc_server.py +1 -1
- chia/_tests/simulation/test_simulation.py +36 -8
- chia/_tests/simulation/test_simulator.py +5 -5
- chia/_tests/simulation/test_start_simulator.py +2 -2
- chia/_tests/timelord/test_new_peak.py +2 -2
- chia/_tests/tools/test_run_block.py +3 -2
- chia/_tests/util/benchmark_cost.py +2 -2
- chia/_tests/util/benchmarks.py +17 -6
- chia/_tests/util/blockchain.py +2 -1
- chia/_tests/util/blockchain_mock.py +9 -5
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/constants.py +2 -1
- chia/_tests/util/full_sync.py +6 -3
- chia/_tests/util/gen_ssl_certs.py +2 -2
- chia/_tests/util/generator_tools_testing.py +4 -3
- chia/_tests/util/get_name_puzzle_conditions.py +2 -2
- chia/_tests/util/misc.py +16 -2
- chia/_tests/util/network_protocol_data.py +17 -7
- chia/_tests/util/run_block.py +6 -8
- chia/_tests/util/setup_nodes.py +4 -3
- chia/_tests/util/spend_sim.py +9 -5
- chia/_tests/util/test_condition_tools.py +2 -2
- chia/_tests/util/test_config.py +2 -1
- chia/_tests/util/test_errors.py +2 -1
- chia/_tests/util/test_full_block_utils.py +17 -7
- chia/_tests/util/test_misc.py +1 -1
- chia/_tests/util/test_network_protocol_test.py +24 -24
- chia/_tests/util/test_replace_str_to_bytes.py +2 -2
- chia/_tests/util/test_trusted_peer.py +1 -1
- chia/_tests/util/time_out_assert.py +20 -7
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
- chia/_tests/wallet/conftest.py +3 -3
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
- chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
- chia/_tests/wallet/did_wallet/test_did.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
- chia/_tests/wallet/rpc/config.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
- chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
- chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
- chia/_tests/wallet/test_clvm_streamable.py +2 -2
- chia/_tests/wallet/test_coin_management.py +7 -7
- chia/_tests/wallet/test_coin_selection.py +20 -2
- chia/_tests/wallet/test_conditions.py +2 -2
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
- chia/_tests/wallet/test_nft_store.py +2 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_puzzle_store.py +2 -2
- chia/_tests/wallet/test_sign_coin_spends.py +2 -2
- chia/_tests/wallet/test_signer_protocol.py +3 -3
- chia/_tests/wallet/test_singleton.py +3 -11
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
- chia/_tests/wallet/test_singleton_store.py +2 -4
- chia/_tests/wallet/test_transaction_store.py +2 -2
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +53 -49
- chia/_tests/wallet/test_wallet_action_scope.py +24 -6
- chia/_tests/wallet/test_wallet_blockchain.py +1 -1
- chia/_tests/wallet/test_wallet_coin_store.py +2 -2
- chia/_tests/wallet/test_wallet_interested_store.py +2 -2
- chia/_tests/wallet/test_wallet_node.py +3 -3
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +8 -8
- chia/_tests/wallet/test_wallet_test_framework.py +1 -1
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +2 -2
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
- chia/_tests/wallet/wallet_block_tools.py +15 -7
- chia/_tests/weight_proof/test_weight_proof.py +3 -3
- chia/cmds/chia.py +0 -2
- chia/cmds/cmd_classes.py +3 -3
- chia/cmds/cmd_helpers.py +4 -4
- chia/cmds/cmds_util.py +2 -2
- chia/cmds/coin_funcs.py +3 -2
- chia/cmds/coins.py +1 -1
- chia/cmds/data.py +2 -2
- chia/cmds/data_funcs.py +3 -2
- chia/cmds/db_upgrade_func.py +2 -2
- chia/cmds/db_validate_func.py +15 -8
- chia/cmds/farm.py +2 -4
- chia/cmds/keys.py +0 -2
- chia/cmds/keys_funcs.py +1 -1
- chia/cmds/netspace_funcs.py +2 -1
- chia/cmds/param_types.py +2 -2
- chia/cmds/plotnft.py +2 -2
- chia/cmds/plotnft_funcs.py +2 -2
- chia/cmds/rpc.py +1 -1
- chia/cmds/show.py +1 -2
- chia/cmds/show_funcs.py +6 -3
- chia/cmds/signer.py +1 -2
- chia/cmds/sim.py +1 -2
- chia/cmds/sim_funcs.py +2 -2
- chia/cmds/wallet.py +2 -2
- chia/cmds/wallet_funcs.py +4 -11
- chia/consensus/block_body_validation.py +3 -4
- chia/consensus/block_creation.py +10 -6
- chia/consensus/block_header_validation.py +3 -4
- chia/consensus/block_record.py +2 -3
- chia/consensus/block_rewards.py +1 -1
- chia/consensus/blockchain.py +20 -17
- chia/consensus/blockchain_interface.py +5 -4
- chia/consensus/coinbase.py +2 -2
- chia/consensus/constants.py +1 -1
- chia/consensus/cost_calculator.py +2 -1
- chia/consensus/default_constants.py +4 -3
- chia/consensus/deficit.py +3 -2
- chia/consensus/difficulty_adjustment.py +8 -9
- chia/consensus/find_fork_point.py +4 -3
- chia/consensus/full_block_to_block_record.py +4 -3
- chia/consensus/get_block_challenge.py +4 -3
- chia/consensus/get_block_generator.py +3 -2
- chia/consensus/make_sub_epoch_summary.py +3 -2
- chia/consensus/multiprocess_validation.py +9 -4
- chia/consensus/pos_quality.py +1 -1
- chia/consensus/pot_iterations.py +4 -3
- chia/consensus/vdf_info_computation.py +4 -3
- chia/daemon/client.py +1 -1
- chia/daemon/keychain_server.py +1 -1
- chia/daemon/server.py +1 -1
- chia/daemon/windows_signal.py +1 -1
- chia/data_layer/data_layer.py +4 -3
- chia/data_layer/data_layer_errors.py +1 -1
- chia/data_layer/data_layer_util.py +2 -2
- chia/data_layer/data_layer_wallet.py +47 -69
- chia/data_layer/data_store.py +1 -1
- chia/data_layer/dl_wallet_store.py +5 -6
- chia/data_layer/download_data.py +1 -1
- chia/data_layer/s3_plugin_service.py +4 -4
- chia/data_layer/singleton_record.py +23 -0
- chia/data_layer/util/benchmark.py +2 -1
- chia/farmer/farmer.py +4 -6
- chia/farmer/farmer_api.py +4 -6
- chia/full_node/bitcoin_fee_estimator.py +2 -1
- chia/full_node/block_height_map.py +2 -2
- chia/full_node/block_store.py +8 -9
- chia/{util → full_node}/check_fork_next_block.py +2 -1
- chia/full_node/coin_store.py +10 -10
- chia/full_node/fee_estimate.py +2 -1
- chia/full_node/fee_estimation.py +2 -1
- chia/full_node/fee_estimator.py +2 -1
- chia/full_node/fee_estimator_interface.py +1 -1
- chia/full_node/fee_history.py +2 -1
- chia/full_node/fee_tracker.py +2 -1
- chia/full_node/full_node.py +15 -13
- chia/full_node/full_node_api.py +12 -32
- chia/full_node/full_node_store.py +4 -3
- chia/full_node/hint_management.py +2 -1
- chia/full_node/hint_store.py +3 -3
- chia/full_node/mempool.py +80 -12
- chia/full_node/mempool_check_conditions.py +6 -7
- chia/full_node/mempool_manager.py +168 -21
- chia/full_node/pending_tx_cache.py +2 -2
- chia/full_node/subscriptions.py +2 -2
- chia/full_node/sync_store.py +2 -3
- chia/full_node/tx_processing_queue.py +2 -1
- chia/full_node/weight_proof.py +5 -8
- chia/harvester/harvester.py +5 -3
- chia/harvester/harvester_api.py +2 -2
- chia/introducer/introducer.py +30 -2
- chia/introducer/introducer_api.py +9 -1
- chia/legacy/keyring.py +1 -2
- chia/plot_sync/exceptions.py +2 -1
- chia/plot_sync/receiver.py +2 -2
- chia/plot_sync/sender.py +1 -1
- chia/plotting/cache.py +2 -2
- chia/plotting/check_plots.py +4 -2
- chia/plotting/create_plots.py +1 -1
- chia/plotting/manager.py +3 -3
- chia/plotting/util.py +2 -2
- chia/pools/pool_config.py +1 -1
- chia/pools/pool_puzzles.py +23 -17
- chia/pools/pool_wallet.py +22 -9
- chia/pools/pool_wallet_info.py +2 -2
- chia/protocols/farmer_protocol.py +3 -6
- chia/protocols/full_node_protocol.py +3 -2
- chia/protocols/harvester_protocol.py +3 -4
- chia/protocols/pool_protocol.py +2 -2
- chia/protocols/shared_protocol.py +2 -1
- chia/protocols/timelord_protocol.py +4 -4
- chia/protocols/wallet_protocol.py +2 -2
- chia/rpc/data_layer_rpc_api.py +3 -4
- chia/rpc/data_layer_rpc_client.py +3 -2
- chia/rpc/farmer_rpc_api.py +2 -2
- chia/rpc/farmer_rpc_client.py +2 -1
- chia/rpc/full_node_rpc_api.py +3 -2
- chia/rpc/full_node_rpc_client.py +3 -2
- chia/rpc/harvester_rpc_api.py +2 -1
- chia/rpc/rpc_client.py +2 -2
- chia/rpc/rpc_server.py +1 -1
- chia/rpc/wallet_request_types.py +2 -62
- chia/rpc/wallet_rpc_api.py +98 -628
- chia/rpc/wallet_rpc_client.py +5 -253
- chia/seeder/crawl_store.py +1 -1
- chia/seeder/crawler.py +2 -2
- chia/seeder/peer_record.py +2 -1
- chia/seeder/start_crawler.py +3 -1
- chia/server/address_manager.py +2 -1
- chia/server/address_manager_store.py +1 -1
- chia/server/capabilities.py +2 -1
- chia/server/introducer_peers.py +2 -1
- chia/server/node_discovery.py +1 -1
- chia/server/outbound_message.py +2 -1
- chia/server/server.py +2 -2
- chia/server/start_data_layer.py +2 -1
- chia/server/start_farmer.py +3 -1
- chia/server/start_full_node.py +4 -2
- chia/server/start_harvester.py +3 -1
- chia/server/start_introducer.py +12 -1
- chia/server/start_service.py +2 -1
- chia/server/start_timelord.py +3 -1
- chia/server/start_wallet.py +3 -1
- chia/server/upnp.py +1 -2
- chia/server/ws_connection.py +3 -4
- chia/simulator/add_blocks_in_batches.py +5 -3
- chia/simulator/block_tools.py +16 -12
- chia/simulator/full_node_simulator.py +9 -14
- chia/simulator/setup_services.py +5 -3
- chia/simulator/simulator_full_node_rpc_api.py +3 -2
- chia/simulator/simulator_full_node_rpc_client.py +3 -2
- chia/simulator/simulator_protocol.py +3 -2
- chia/simulator/simulator_test_tools.py +2 -2
- chia/simulator/start_simulator.py +3 -2
- chia/simulator/wallet_tools.py +3 -4
- chia/timelord/iters_from_block.py +4 -4
- chia/timelord/timelord.py +7 -12
- chia/timelord/timelord_api.py +3 -3
- chia/timelord/timelord_state.py +4 -3
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +2 -2
- chia/types/blockchain_format/program.py +1 -1
- chia/types/blockchain_format/proof_of_space.py +3 -4
- chia/types/blockchain_format/tree_hash.py +1 -1
- chia/types/blockchain_format/vdf.py +3 -4
- chia/types/clvm_cost.py +1 -1
- chia/types/coin_record.py +4 -3
- chia/types/coin_spend.py +1 -1
- chia/types/eligible_coin_spends.py +9 -5
- chia/types/fee_rate.py +1 -1
- chia/types/generator_types.py +3 -3
- chia/types/internal_mempool_item.py +3 -2
- chia/types/mempool_item.py +10 -3
- chia/types/mempool_submission_status.py +2 -1
- chia/types/mojos.py +1 -1
- chia/types/peer_info.py +2 -1
- chia/types/transaction_queue_entry.py +2 -1
- chia/types/unfinished_header_block.py +4 -4
- chia/types/validation_state.py +2 -1
- chia/types/weight_proof.py +1 -9
- chia/util/augmented_chain.py +20 -9
- chia/util/block_cache.py +8 -4
- chia/util/condition_tools.py +2 -2
- chia/util/full_block_utils.py +3 -4
- chia/util/generator_tools.py +2 -2
- chia/util/initial-config.yaml +2 -11
- chia/util/network.py +2 -2
- chia/util/prev_transaction_block.py +2 -1
- chia/util/task_timing.py +1 -1
- chia/util/vdf_prover.py +3 -3
- chia/util/ws_message.py +1 -1
- chia/wallet/cat_wallet/cat_info.py +3 -2
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
- chia/wallet/cat_wallet/cat_utils.py +6 -4
- chia/wallet/cat_wallet/cat_wallet.py +16 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -1
- chia/wallet/coin_selection.py +5 -5
- chia/wallet/conditions.py +22 -16
- chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
- chia/wallet/derivation_record.py +2 -2
- chia/wallet/derive_keys.py +2 -2
- chia/wallet/did_wallet/did_info.py +3 -2
- chia/wallet/did_wallet/did_wallet.py +41 -19
- chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
- chia/wallet/driver_protocol.py +1 -1
- chia/wallet/lineage_proof.py +3 -2
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
- chia/wallet/nft_wallet/nft_info.py +5 -5
- chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
- chia/wallet/nft_wallet/nft_puzzles.py +21 -298
- chia/wallet/nft_wallet/nft_wallet.py +47 -62
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
- chia/wallet/nft_wallet/uncurry_nft.py +6 -8
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +3 -2
- chia/wallet/outer_puzzles.py +2 -1
- chia/wallet/puzzles/clawback/drivers.py +21 -8
- chia/wallet/puzzles/clawback/metadata.py +3 -2
- chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
- chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
- chia/wallet/puzzles/p2_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
- chia/wallet/puzzles/puzzle_utils.py +3 -2
- chia/wallet/puzzles/singleton_top_layer.py +26 -10
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
- chia/wallet/puzzles/tails.py +21 -129
- chia/wallet/signer_protocol.py +3 -2
- chia/wallet/singleton.py +12 -6
- chia/wallet/singleton_record.py +3 -2
- chia/wallet/trade_manager.py +31 -55
- chia/wallet/trade_record.py +3 -2
- chia/wallet/trading/offer.py +14 -13
- chia/wallet/trading/trade_store.py +3 -4
- chia/wallet/transaction_record.py +2 -2
- chia/wallet/util/blind_signer_tl.py +3 -2
- chia/wallet/util/compute_hints.py +3 -2
- chia/wallet/util/compute_memos.py +2 -2
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +1 -1
- chia/wallet/util/merkle_utils.py +1 -1
- chia/wallet/util/new_peak_queue.py +2 -1
- chia/wallet/util/notifications.py +5 -4
- chia/wallet/util/peer_request_cache.py +3 -2
- chia/wallet/util/puzzle_compression.py +6 -4
- chia/wallet/util/puzzle_decorator.py +6 -4
- chia/wallet/util/query_filter.py +3 -2
- chia/wallet/util/tx_config.py +3 -3
- chia/wallet/util/wallet_sync_utils.py +2 -2
- chia/wallet/util/wallet_types.py +2 -3
- chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
- chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
- chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
- chia/wallet/vc_wallet/vc_drivers.py +50 -68
- chia/wallet/vc_wallet/vc_store.py +2 -2
- chia/wallet/vc_wallet/vc_wallet.py +47 -15
- chia/wallet/wallet.py +51 -46
- chia/wallet/wallet_action_scope.py +4 -0
- chia/wallet/wallet_blockchain.py +12 -7
- chia/wallet/wallet_coin_record.py +3 -2
- chia/wallet/wallet_coin_store.py +3 -2
- chia/wallet/wallet_info.py +2 -1
- chia/wallet/wallet_interested_store.py +3 -2
- chia/wallet/wallet_nft_store.py +4 -4
- chia/wallet/wallet_node.py +3 -4
- chia/wallet/wallet_pool_store.py +3 -4
- chia/wallet/wallet_protocol.py +19 -5
- chia/wallet/wallet_puzzle_store.py +2 -2
- chia/wallet/wallet_retry_store.py +3 -6
- chia/wallet/wallet_singleton_store.py +2 -2
- chia/wallet/wallet_state_manager.py +20 -197
- chia/wallet/wallet_transaction_store.py +2 -2
- chia/wallet/wallet_user_store.py +2 -1
- chia/wallet/wallet_weight_proof_handler.py +3 -2
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3rc2.dist-info/RECORD +891 -0
- mozilla-ca/cacert.pem +64 -33
- chia/_tests/clvm/test_condition_codes.py +0 -13
- chia/_tests/cmds/wallet/test_dao.py +0 -565
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +0 -3
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
- chia/cmds/dao.py +0 -1064
- chia/cmds/dao_funcs.py +0 -598
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +0 -14
- chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
- chia/simulator/simulator_constants.py +0 -13
- chia/types/blockchain_format/foliage.py +0 -8
- chia/types/blockchain_format/pool_target.py +0 -5
- chia/types/blockchain_format/reward_chain_block.py +0 -6
- chia/types/blockchain_format/sized_bytes.py +0 -11
- chia/util/ints.py +0 -19
- chia/wallet/cat_wallet/dao_cat_info.py +0 -28
- chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +0 -61
- chia/wallet/dao_wallet/dao_utils.py +0 -811
- chia/wallet/dao_wallet/dao_wallet.py +0 -2119
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
- chia/wallet/payment.py +0 -33
- chia/wallet/puzzles/augmented_condition.clsp +0 -13
- chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
- chia/wallet/puzzles/condition_codes.clib +0 -77
- chia/wallet/puzzles/curry-and-treehash.clib +0 -102
- chia/wallet/puzzles/curry.clib +0 -135
- chia/wallet/puzzles/curry_by_index.clib +0 -16
- chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
- chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp +0 -35
- chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_lockup.clsp +0 -288
- chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal.clsp +0 -377
- chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_treasury.clsp +0 -115
- chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
- chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/json.clib +0 -25
- chia/wallet/puzzles/merkle_utils.clib +0 -18
- chia/wallet/puzzles/notification.clsp +0 -7
- chia/wallet/puzzles/notification.clsp.hex +0 -1
- chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
- chia/wallet/puzzles/p2_conditions.clsp +0 -3
- chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
- chia/wallet/puzzles/p2_parent.clsp +0 -19
- chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
- chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton.clsp +0 -30
- chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/settlement_payments.clsp +0 -49
- chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
- chia/wallet/puzzles/sha256tree.clib +0 -11
- chia/wallet/puzzles/singleton_launcher.clsp +0 -16
- chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_truths.clib +0 -21
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
- chia_blockchain-2.5.2rc2.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc2.dist-info}/entry_points.txt +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
(
|
|
2
|
-
(defun-inline cat_truth_data_to_truth_struct (innerpuzhash cat_struct my_id this_coin_info)
|
|
3
|
-
(c
|
|
4
|
-
(c
|
|
5
|
-
innerpuzhash
|
|
6
|
-
cat_struct
|
|
7
|
-
)
|
|
8
|
-
(c
|
|
9
|
-
my_id
|
|
10
|
-
this_coin_info
|
|
11
|
-
)
|
|
12
|
-
)
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
; CAT Truths is: ((Inner puzzle hash . (MOD hash . (MOD hash hash . TAIL hash))) . (my_id . (my_parent_info my_puzhash my_amount)))
|
|
16
|
-
|
|
17
|
-
(defun-inline my_inner_puzzle_hash_cat_truth (Truths) (f (f Truths)))
|
|
18
|
-
(defun-inline cat_struct_truth (Truths) (r (f Truths)))
|
|
19
|
-
(defun-inline my_id_cat_truth (Truths) (f (r Truths)))
|
|
20
|
-
(defun-inline my_coin_info_truth (Truths) (r (r Truths)))
|
|
21
|
-
(defun-inline my_amount_cat_truth (Truths) (f (r (r (my_coin_info_truth Truths)))))
|
|
22
|
-
(defun-inline my_full_puzzle_hash_cat_truth (Truths) (f (r (my_coin_info_truth Truths))))
|
|
23
|
-
(defun-inline my_parent_cat_truth (Truths) (f (my_coin_info_truth Truths)))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
; CAT mod_struct is: (MOD_HASH MOD_HASH_hash TAIL_PROGRAM TAIL_PROGRAM_hash)
|
|
27
|
-
|
|
28
|
-
(defun-inline cat_mod_hash_truth (Truths) (f (cat_struct_truth Truths)))
|
|
29
|
-
(defun-inline cat_mod_hash_hash_truth (Truths) (f (r (cat_struct_truth Truths))))
|
|
30
|
-
(defun-inline cat_tail_program_hash_truth (Truths) (f (r (r (cat_struct_truth Truths)))))
|
|
31
|
-
)
|
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
; Coins locked with this puzzle are spendable cats.
|
|
2
|
-
;
|
|
3
|
-
; Choose a list of n inputs (n>=1), I_1, ... I_n with amounts A_1, ... A_n.
|
|
4
|
-
;
|
|
5
|
-
; We put them in a ring, so "previous" and "next" have intuitive k-1 and k+1 semantics,
|
|
6
|
-
; wrapping so {n} and 0 are the same, ie. all indices are mod n.
|
|
7
|
-
;
|
|
8
|
-
; Each coin creates 0 or more coins with total output value O_k.
|
|
9
|
-
; Let D_k = the "debt" O_k - A_k contribution of coin I_k, ie. how much debt this input accumulates.
|
|
10
|
-
; Some coins may spend more than they contribute and some may spend less, ie. D_k need
|
|
11
|
-
; not be zero. That's okay. It's enough for the total of all D_k in the ring to be 0.
|
|
12
|
-
;
|
|
13
|
-
; A coin can calculate its own D_k since it can verify A_k (it's hashed into the coin id)
|
|
14
|
-
; and it can sum up `CREATE_COIN` conditions for O_k.
|
|
15
|
-
;
|
|
16
|
-
; Defines a "subtotal of debts" S_k for each coin as follows:
|
|
17
|
-
;
|
|
18
|
-
; S_1 = 0
|
|
19
|
-
; S_k = S_{k-1} + D_{k-1}
|
|
20
|
-
;
|
|
21
|
-
; Here's the main trick that shows the ring sums to 0.
|
|
22
|
-
; You can prove by induction that S_{k+1} = D_1 + D_2 + ... + D_k.
|
|
23
|
-
; But it's a ring, so S_{n+1} is also S_1, which is 0. So D_1 + D_2 + ... + D_k = 0.
|
|
24
|
-
; So the total debts must be 0, ie. no coins are created or destroyed.
|
|
25
|
-
;
|
|
26
|
-
; Each coin's solution includes I_{k-1}, I_k, and I_{k+1} along with proofs that I_{k}, and I_{k+1} are CATs of the same type.
|
|
27
|
-
; Each coin's solution includes S_{k-1}. It calculates D_k = O_k - A_k, and then S_k = S_{k-1} + D_{k-1}
|
|
28
|
-
;
|
|
29
|
-
; Announcements are used to ensure that each S_k follows the pattern is valid.
|
|
30
|
-
; Announcements automatically commit to their own coin id.
|
|
31
|
-
; Coin I_k creates an announcement that further commits to I_{k-1} and S_{k-1}.
|
|
32
|
-
;
|
|
33
|
-
; Coin I_k gets a proof that I_{k+1} is a cat, so it knows it must also create an announcement
|
|
34
|
-
; when spent. It checks that I_{k+1} creates an announcement committing to I_k and S_k.
|
|
35
|
-
;
|
|
36
|
-
; So S_{k+1} is correct iff S_k is correct.
|
|
37
|
-
;
|
|
38
|
-
; Coins also receive proofs that their neighbours are CATs, ensuring the announcements aren't forgeries.
|
|
39
|
-
; Inner puzzles and the CAT layer prepend `CREATE_COIN_ANNOUNCEMENT` with different prefixes to avoid forgeries.
|
|
40
|
-
; Ring announcements use 0xcb, and inner puzzles are given 0xca
|
|
41
|
-
;
|
|
42
|
-
; In summary, I_k generates a coin_announcement Y_k ("Y" for "yell") as follows:
|
|
43
|
-
;
|
|
44
|
-
; Y_k: hash of I_k (automatically), I_{k-1}, S_k
|
|
45
|
-
;
|
|
46
|
-
; Each coin creates an assert_coin_announcement to ensure that the next coin's announcement is as expected:
|
|
47
|
-
; Y_{k+1} : hash of I_{k+1}, I_k, S_{k+1}
|
|
48
|
-
;
|
|
49
|
-
; TLDR:
|
|
50
|
-
; I_k : coins
|
|
51
|
-
; A_k : amount coin k contributes
|
|
52
|
-
; O_k : amount coin k spend
|
|
53
|
-
; D_k : difference/delta that coin k incurs (A - O)
|
|
54
|
-
; S_k : subtotal of debts D_1 + D_2 ... + D_k
|
|
55
|
-
; Y_k : announcements created by coin k committing to I_{k-1}, I_k, S_k
|
|
56
|
-
;
|
|
57
|
-
; All conditions go through a "transformer" that looks for CREATE_COIN conditions
|
|
58
|
-
; generated by the inner solution, and wraps the puzzle hash ensuring the output is a cat.
|
|
59
|
-
;
|
|
60
|
-
; Three output conditions are prepended to the list of conditions for each I_k:
|
|
61
|
-
; (ASSERT_MY_ID I_k) to ensure that the passed in value for I_k is correct
|
|
62
|
-
; (CREATE_COIN_ANNOUNCEMENT I_{k-1} S_k) to create this coin's announcement
|
|
63
|
-
; (ASSERT_COIN_ANNOUNCEMENT hashed_announcement(Y_{k+1})) to ensure the next coin really is next and
|
|
64
|
-
; the relative values of S_k and S_{k+1} are correct
|
|
65
|
-
;
|
|
66
|
-
; This is all we need to do to ensure cats exactly balance in the inputs and outputs.
|
|
67
|
-
;
|
|
68
|
-
; Proof:
|
|
69
|
-
; Consider n, k, I_k values, O_k values, S_k and A_k as above.
|
|
70
|
-
; For the (CREATE_COIN_ANNOUNCEMENT Y_{k+1}) (created by the next coin)
|
|
71
|
-
; and (ASSERT_COIN_ANNOUNCEMENT hashed(Y_{k+1})) to match,
|
|
72
|
-
; we see that I_k can ensure that is has the correct value for S_{k+1}.
|
|
73
|
-
;
|
|
74
|
-
; By induction, we see that S_{m+1} = sum(i, 1, m) [O_i - A_i] = sum(i, 1, m) O_i - sum(i, 1, m) A_i
|
|
75
|
-
; So S_{n+1} = sum(i, 1, n) O_i - sum(i, 1, n) A_i. But S_{n+1} is actually S_1 = 0,
|
|
76
|
-
; so thus sum(i, 1, n) O_i = sum (i, 1, n) A_i, ie. output total equals input total.
|
|
77
|
-
|
|
78
|
-
;; GLOSSARY:
|
|
79
|
-
;; MOD_HASH: this code's sha256 tree hash
|
|
80
|
-
;; TAIL_PROGRAM_HASH: the program that determines if a coin can mint new cats, burn cats, and check if its lineage is valid if its parent is not a CAT
|
|
81
|
-
;; INNER_PUZZLE: an independent puzzle protecting the coins. Solutions to this puzzle are expected to generate `AGG_SIG` conditions and possibly `CREATE_COIN` conditions.
|
|
82
|
-
;; ---- items above are curried into the puzzle hash ----
|
|
83
|
-
;; inner_puzzle_solution: the solution to the inner puzzle
|
|
84
|
-
;; prev_coin_id: the id for the previous coin
|
|
85
|
-
;; tail_program_reveal: reveal of TAIL_PROGRAM_HASH required to run the program if desired
|
|
86
|
-
;; tail_solution: optional solution passed into tail_program
|
|
87
|
-
;; lineage_proof: optional proof that our coin's parent is a CAT
|
|
88
|
-
;; this_coin_info: (parent_id puzzle_hash amount)
|
|
89
|
-
;; next_coin_proof: (parent_id inner_puzzle_hash amount)
|
|
90
|
-
;; prev_subtotal: the subtotal between prev-coin and this-coin
|
|
91
|
-
;; extra_delta: an amount that is added to our delta and checked by the TAIL program
|
|
92
|
-
;;
|
|
93
|
-
|
|
94
|
-
(mod (
|
|
95
|
-
MOD_HASH ;; curried into puzzle
|
|
96
|
-
TAIL_PROGRAM_HASH ;; curried into puzzle
|
|
97
|
-
INNER_PUZZLE ;; curried into puzzle
|
|
98
|
-
inner_puzzle_solution ;; if invalid, INNER_PUZZLE will fail
|
|
99
|
-
lineage_proof ;; This is the parent's coin info, used to check if the parent was a CAT. Optional if using tail_program.
|
|
100
|
-
prev_coin_id ;; used in this coin's announcement, prev_coin ASSERT_COIN_ANNOUNCEMENT will fail if wrong
|
|
101
|
-
this_coin_info ;; verified with ASSERT_MY_COIN_ID
|
|
102
|
-
next_coin_proof ;; used to generate ASSERT_COIN_ANNOUNCEMENT
|
|
103
|
-
prev_subtotal ;; included in announcement, prev_coin ASSERT_COIN_ANNOUNCEMENT will fail if wrong
|
|
104
|
-
extra_delta ;; this is the "legal discrepancy" between your real delta and what you're announcing your delta is
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
;;;;; start library code
|
|
108
|
-
|
|
109
|
-
(include condition_codes.clib)
|
|
110
|
-
(include curry-and-treehash.clib)
|
|
111
|
-
(include cat_truths.clib)
|
|
112
|
-
(include utility_macros.clib)
|
|
113
|
-
|
|
114
|
-
(defconstant RING_MORPH_BYTE 0xcb)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
; take two lists and merge them into one
|
|
118
|
-
(defun merge_list (list_a list_b)
|
|
119
|
-
(if list_a
|
|
120
|
-
(c (f list_a) (merge_list (r list_a) list_b))
|
|
121
|
-
list_b
|
|
122
|
-
)
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
; cat_mod_struct = (MOD_HASH MOD_HASH_hash GENESIS_COIN_CHECKER GENESIS_COIN_CHECKER_hash)
|
|
126
|
-
|
|
127
|
-
(defun-inline mod_hash_from_cat_mod_struct (cat_mod_struct) (f cat_mod_struct))
|
|
128
|
-
(defun-inline mod_hash_hash_from_cat_mod_struct (cat_mod_struct) (f (r cat_mod_struct)))
|
|
129
|
-
(defun-inline tail_program_hash_from_cat_mod_struct (cat_mod_struct) (f (r (r cat_mod_struct))))
|
|
130
|
-
|
|
131
|
-
;;;;; end library code
|
|
132
|
-
|
|
133
|
-
;; return the puzzle hash for a cat with the given `GENESIS_COIN_CHECKER_hash` & `INNER_PUZZLE`
|
|
134
|
-
(defun-inline cat_puzzle_hash (cat_mod_struct inner_puzzle_hash)
|
|
135
|
-
(puzzle-hash-of-curried-function (mod_hash_from_cat_mod_struct cat_mod_struct)
|
|
136
|
-
inner_puzzle_hash
|
|
137
|
-
(sha256 ONE (tail_program_hash_from_cat_mod_struct cat_mod_struct))
|
|
138
|
-
(mod_hash_hash_from_cat_mod_struct cat_mod_struct)
|
|
139
|
-
)
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
;; assert `CREATE_COIN_ANNOUNCEMENT` doesn't contain the RING_MORPH_BYTE bytes so it cannot be used to cheat the coin ring
|
|
143
|
-
|
|
144
|
-
(defun-inline morph_condition (condition cat_mod_struct)
|
|
145
|
-
(if (= (f condition) CREATE_COIN)
|
|
146
|
-
(c CREATE_COIN
|
|
147
|
-
(c (cat_puzzle_hash cat_mod_struct (f (r condition)))
|
|
148
|
-
(r (r condition)))
|
|
149
|
-
)
|
|
150
|
-
(if (= (f condition) CREATE_COIN_ANNOUNCEMENT)
|
|
151
|
-
(assert (not (and
|
|
152
|
-
(= 33 (strlen (f (r condition))))
|
|
153
|
-
(= (substr (f (r condition)) 0 ONE) RING_MORPH_BYTE) ; lazy eval
|
|
154
|
-
))
|
|
155
|
-
; then
|
|
156
|
-
condition
|
|
157
|
-
)
|
|
158
|
-
condition
|
|
159
|
-
)
|
|
160
|
-
)
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
;; given a coin's parent, inner_puzzle and amount, and the cat_mod_struct, calculate the id of the coin
|
|
164
|
-
(defun-inline coin_id_for_proof (coin cat_mod_struct)
|
|
165
|
-
(calculate_coin_id (f coin) (cat_puzzle_hash cat_mod_struct (f (r coin))) (f (r (r coin))))
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
;; utility to fetch coin amount from coin
|
|
169
|
-
(defun-inline input_amount_for_coin (coin)
|
|
170
|
-
(f (r (r coin)))
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
;; calculate the hash of an announcement
|
|
174
|
-
;; we add 0xcb so ring announcements exist in a different namespace to announcements from inner_puzzles
|
|
175
|
-
(defun-inline calculate_annoucement_id (this_coin_id this_subtotal next_coin_id cat_mod_struct)
|
|
176
|
-
(sha256 next_coin_id RING_MORPH_BYTE (sha256tree (list this_coin_id this_subtotal)))
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
;; create the `ASSERT_COIN_ANNOUNCEMENT` condition that ensures the next coin's announcement is correct
|
|
180
|
-
(defun-inline create_assert_next_announcement_condition (this_coin_id this_subtotal next_coin_id cat_mod_struct)
|
|
181
|
-
(list ASSERT_COIN_ANNOUNCEMENT
|
|
182
|
-
(calculate_annoucement_id this_coin_id
|
|
183
|
-
this_subtotal
|
|
184
|
-
next_coin_id
|
|
185
|
-
cat_mod_struct
|
|
186
|
-
)
|
|
187
|
-
)
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
;; here we commit to I_{k-1} and S_k
|
|
191
|
-
;; we add 0xcb so ring announcements exist in a different namespace to announcements from inner_puzzles
|
|
192
|
-
(defun-inline create_announcement_condition (prev_coin_id prev_subtotal)
|
|
193
|
-
(list CREATE_COIN_ANNOUNCEMENT
|
|
194
|
-
(concat RING_MORPH_BYTE (sha256tree (list prev_coin_id prev_subtotal)))
|
|
195
|
-
)
|
|
196
|
-
)
|
|
197
|
-
|
|
198
|
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
199
|
-
|
|
200
|
-
;; this function takes a condition and returns an integer indicating
|
|
201
|
-
;; the value of all output coins created with CREATE_COIN. If it's not
|
|
202
|
-
;; a CREATE_COIN condition, it returns 0.
|
|
203
|
-
|
|
204
|
-
(defun-inline output_value_for_condition (condition)
|
|
205
|
-
(if (= (f condition) CREATE_COIN)
|
|
206
|
-
(f (r (r condition)))
|
|
207
|
-
0
|
|
208
|
-
)
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
;; add two conditions to the list of morphed conditions:
|
|
212
|
-
;; CREATE_COIN_ANNOUNCEMENT for my announcement
|
|
213
|
-
;; ASSERT_COIN_ANNOUNCEMENT for the next coin's announcement
|
|
214
|
-
(defun-inline generate_final_output_conditions
|
|
215
|
-
(
|
|
216
|
-
prev_subtotal
|
|
217
|
-
this_subtotal
|
|
218
|
-
morphed_conditions
|
|
219
|
-
prev_coin_id
|
|
220
|
-
this_coin_id
|
|
221
|
-
next_coin_id
|
|
222
|
-
cat_mod_struct
|
|
223
|
-
)
|
|
224
|
-
(c (create_announcement_condition prev_coin_id prev_subtotal)
|
|
225
|
-
(c (create_assert_next_announcement_condition this_coin_id this_subtotal next_coin_id cat_mod_struct)
|
|
226
|
-
morphed_conditions)
|
|
227
|
-
)
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
;; This next section of code loops through all of the conditions to do three things:
|
|
232
|
-
;; 1) Look for a "magic" value of -113 and, if one exists, filter it, and take note of the tail reveal and solution
|
|
233
|
-
;; 2) Morph any CREATE_COIN or CREATE_COIN_ANNOUNCEMENT conditions
|
|
234
|
-
;; 3) Sum the total output amount of all of the CREATE_COINs that are output by the inner puzzle
|
|
235
|
-
;;
|
|
236
|
-
;; After everything return a struct in the format (morphed_conditions . (output_sum . tail_reveal_and_solution))
|
|
237
|
-
;; If multiple magic conditions are specified, the later one will take precedence
|
|
238
|
-
|
|
239
|
-
(defun-inline condition_tail_reveal (condition) (f (r (r (r condition)))))
|
|
240
|
-
(defun-inline condition_tail_solution (condition) (f (r (r (r (r condition))))))
|
|
241
|
-
|
|
242
|
-
(defun cons_onto_first_and_add_to_second (morphed_condition output_value struct)
|
|
243
|
-
(c (c morphed_condition (f struct)) (c (+ output_value (f (r struct))) (r (r struct))))
|
|
244
|
-
)
|
|
245
|
-
|
|
246
|
-
(defun find_and_strip_tail_info (inner_conditions cat_mod_struct tail_reveal_and_solution)
|
|
247
|
-
(if inner_conditions
|
|
248
|
-
(if (= (output_value_for_condition (f inner_conditions)) -113) ; Checks this is a CREATE_COIN of value -113
|
|
249
|
-
(find_and_strip_tail_info
|
|
250
|
-
(r inner_conditions)
|
|
251
|
-
cat_mod_struct
|
|
252
|
-
(c (condition_tail_reveal (f inner_conditions)) (condition_tail_solution (f inner_conditions)))
|
|
253
|
-
)
|
|
254
|
-
(cons_onto_first_and_add_to_second
|
|
255
|
-
(morph_condition (f inner_conditions) cat_mod_struct)
|
|
256
|
-
(output_value_for_condition (f inner_conditions))
|
|
257
|
-
(find_and_strip_tail_info
|
|
258
|
-
(r inner_conditions)
|
|
259
|
-
cat_mod_struct
|
|
260
|
-
tail_reveal_and_solution
|
|
261
|
-
)
|
|
262
|
-
)
|
|
263
|
-
)
|
|
264
|
-
(c () (c 0 tail_reveal_and_solution))
|
|
265
|
-
)
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
;;;;;;;;;;;;;;;;;;;;;;;;;;; lineage checking
|
|
269
|
-
|
|
270
|
-
;; return true iff parent of `this_coin_info` is provably a cat
|
|
271
|
-
;; A 'lineage proof' consists of (parent_parent_id parent_INNER_puzzle_hash parent_amount)
|
|
272
|
-
;; We use this information to construct a coin who's puzzle has been wrapped in this MOD and verify that,
|
|
273
|
-
;; once wrapped, it matches our parent coin's ID.
|
|
274
|
-
(defun-inline is_parent_cat (
|
|
275
|
-
cat_mod_struct
|
|
276
|
-
parent_id
|
|
277
|
-
lineage_proof
|
|
278
|
-
)
|
|
279
|
-
(= parent_id
|
|
280
|
-
(calculate_coin_id (f lineage_proof)
|
|
281
|
-
(cat_puzzle_hash cat_mod_struct (f (r lineage_proof)))
|
|
282
|
-
(f (r (r lineage_proof)))
|
|
283
|
-
)
|
|
284
|
-
)
|
|
285
|
-
)
|
|
286
|
-
|
|
287
|
-
(defun check_lineage_or_run_tail_program
|
|
288
|
-
(
|
|
289
|
-
this_coin_info
|
|
290
|
-
tail_reveal_and_solution
|
|
291
|
-
parent_is_cat ; flag which says whether or not the parent CAT check ran and passed
|
|
292
|
-
lineage_proof
|
|
293
|
-
Truths
|
|
294
|
-
extra_delta
|
|
295
|
-
inner_conditions
|
|
296
|
-
)
|
|
297
|
-
(if tail_reveal_and_solution
|
|
298
|
-
(assert (= (sha256tree (f tail_reveal_and_solution)) (cat_tail_program_hash_truth Truths))
|
|
299
|
-
(merge_list
|
|
300
|
-
(a (f tail_reveal_and_solution)
|
|
301
|
-
(list
|
|
302
|
-
Truths
|
|
303
|
-
parent_is_cat
|
|
304
|
-
lineage_proof ; Lineage proof is only guaranteed to be true if parent_is_cat
|
|
305
|
-
extra_delta
|
|
306
|
-
inner_conditions
|
|
307
|
-
(r tail_reveal_and_solution)
|
|
308
|
-
)
|
|
309
|
-
)
|
|
310
|
-
inner_conditions
|
|
311
|
-
)
|
|
312
|
-
)
|
|
313
|
-
(assert parent_is_cat (not extra_delta)
|
|
314
|
-
inner_conditions
|
|
315
|
-
)
|
|
316
|
-
)
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
320
|
-
|
|
321
|
-
(defun stager_two (
|
|
322
|
-
Truths
|
|
323
|
-
(inner_conditions . (output_sum . tail_reveal_and_solution))
|
|
324
|
-
lineage_proof
|
|
325
|
-
prev_coin_id
|
|
326
|
-
this_coin_info
|
|
327
|
-
next_coin_id
|
|
328
|
-
prev_subtotal
|
|
329
|
-
extra_delta
|
|
330
|
-
)
|
|
331
|
-
(check_lineage_or_run_tail_program
|
|
332
|
-
this_coin_info
|
|
333
|
-
tail_reveal_and_solution
|
|
334
|
-
(if lineage_proof (is_parent_cat (cat_struct_truth Truths) (my_parent_cat_truth Truths) lineage_proof) ())
|
|
335
|
-
lineage_proof
|
|
336
|
-
Truths
|
|
337
|
-
extra_delta
|
|
338
|
-
(generate_final_output_conditions
|
|
339
|
-
prev_subtotal
|
|
340
|
-
; the expression on the next line calculates `this_subtotal` by adding the delta to `prev_subtotal`
|
|
341
|
-
(+ prev_subtotal (- (input_amount_for_coin this_coin_info) output_sum) extra_delta)
|
|
342
|
-
inner_conditions
|
|
343
|
-
prev_coin_id
|
|
344
|
-
(my_id_cat_truth Truths)
|
|
345
|
-
next_coin_id
|
|
346
|
-
(cat_struct_truth Truths)
|
|
347
|
-
)
|
|
348
|
-
)
|
|
349
|
-
)
|
|
350
|
-
|
|
351
|
-
; CAT TRUTHS struct is: ; CAT Truths is: ((Inner puzzle hash . (MOD hash . (MOD hash hash . TAIL hash))) . (my_id . (my_parent_info my_puzhash my_amount)))
|
|
352
|
-
; create truths - this_coin_info verified true because we calculated my ID from it!
|
|
353
|
-
; lineage proof is verified later by cat parent check or tail_program
|
|
354
|
-
|
|
355
|
-
(defun stager (
|
|
356
|
-
cat_mod_struct
|
|
357
|
-
inner_conditions
|
|
358
|
-
lineage_proof
|
|
359
|
-
inner_puzzle_hash
|
|
360
|
-
my_id
|
|
361
|
-
prev_coin_id
|
|
362
|
-
this_coin_info
|
|
363
|
-
next_coin_proof
|
|
364
|
-
prev_subtotal
|
|
365
|
-
extra_delta
|
|
366
|
-
)
|
|
367
|
-
(c (list ASSERT_MY_COIN_ID my_id) (stager_two
|
|
368
|
-
(cat_truth_data_to_truth_struct
|
|
369
|
-
inner_puzzle_hash
|
|
370
|
-
cat_mod_struct
|
|
371
|
-
my_id
|
|
372
|
-
this_coin_info
|
|
373
|
-
)
|
|
374
|
-
(find_and_strip_tail_info inner_conditions cat_mod_struct ())
|
|
375
|
-
lineage_proof
|
|
376
|
-
prev_coin_id
|
|
377
|
-
this_coin_info
|
|
378
|
-
(coin_id_for_proof next_coin_proof cat_mod_struct)
|
|
379
|
-
prev_subtotal
|
|
380
|
-
extra_delta
|
|
381
|
-
))
|
|
382
|
-
)
|
|
383
|
-
|
|
384
|
-
(stager
|
|
385
|
-
;; calculate cat_mod_struct, inner_puzzle_hash, coin_id
|
|
386
|
-
(list MOD_HASH (sha256 ONE MOD_HASH) TAIL_PROGRAM_HASH)
|
|
387
|
-
(a INNER_PUZZLE inner_puzzle_solution)
|
|
388
|
-
lineage_proof
|
|
389
|
-
(sha256tree INNER_PUZZLE)
|
|
390
|
-
(calculate_coin_id (f this_coin_info) (f (r this_coin_info)) (f (r (r this_coin_info))))
|
|
391
|
-
prev_coin_id ; ID
|
|
392
|
-
this_coin_info ; (parent_id puzzle_hash amount)
|
|
393
|
-
next_coin_proof ; (parent_id innerpuzhash amount)
|
|
394
|
-
prev_subtotal
|
|
395
|
-
extra_delta
|
|
396
|
-
)
|
|
397
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ff5effff04ff02ffff04ffff04ff05ffff04ffff0bff34ff0580ffff04ff0bff80808080ffff04ffff02ff17ff2f80ffff04ff5fffff04ffff02ff2effff04ff02ffff04ff17ff80808080ffff04ffff02ff2affff04ff02ffff04ff82027fffff04ff82057fffff04ff820b7fff808080808080ffff04ff81bfffff04ff82017fffff04ff8202ffffff04ff8205ffffff04ff820bffff80808080808080808080808080ffff04ffff01ffffffff3d46ff02ff333cffff0401ff01ff81cb02ffffff20ff02ffff03ff05ffff01ff02ff32ffff04ff02ffff04ff0dffff04ffff0bff7cffff0bff34ff2480ffff0bff7cffff0bff7cffff0bff34ff2c80ff0980ffff0bff7cff0bffff0bff34ff8080808080ff8080808080ffff010b80ff0180ffff02ffff03ffff22ffff09ffff0dff0580ff2280ffff09ffff0dff0b80ff2280ffff15ff17ffff0181ff8080ffff01ff0bff05ff0bff1780ffff01ff088080ff0180ffff02ffff03ff0bffff01ff02ffff03ffff09ffff02ff2effff04ff02ffff04ff13ff80808080ff820b9f80ffff01ff02ff56ffff04ff02ffff04ffff02ff13ffff04ff5fffff04ff17ffff04ff2fffff04ff81bfffff04ff82017fffff04ff1bff8080808080808080ffff04ff82017fff8080808080ffff01ff088080ff0180ffff01ff02ffff03ff17ffff01ff02ffff03ffff20ff81bf80ffff0182017fffff01ff088080ff0180ffff01ff088080ff018080ff0180ff04ffff04ff05ff2780ffff04ffff10ff0bff5780ff778080ffffff02ffff03ff05ffff01ff02ffff03ffff09ffff02ffff03ffff09ff11ff5880ffff0159ff8080ff0180ffff01818f80ffff01ff02ff26ffff04ff02ffff04ff0dffff04ff0bffff04ffff04ff81b9ff82017980ff808080808080ffff01ff02ff7affff04ff02ffff04ffff02ffff03ffff09ff11ff5880ffff01ff04ff58ffff04ffff02ff76ffff04ff02ffff04ff13ffff04ff29ffff04ffff0bff34ff5b80ffff04ff2bff80808080808080ff398080ffff01ff02ffff03ffff09ff11ff7880ffff01ff02ffff03ffff20ffff02ffff03ffff09ffff0121ffff0dff298080ffff01ff02ffff03ffff09ffff0cff29ff80ff3480ff5c80ffff01ff0101ff8080ff0180ff8080ff018080ffff0109ffff01ff088080ff0180ffff010980ff018080ff0180ffff04ffff02ffff03ffff09ff11ff5880ffff0159ff8080ff0180ffff04ffff02ff26ffff04ff02ffff04ff0dffff04ff0bffff04ff17ff808080808080ff80808080808080ff0180ffff01ff04ff80ffff04ff80ff17808080ff0180ffff02ffff03ff05ffff01ff04ff09ffff02ff56ffff04ff02ffff04ff0dffff04ff0bff808080808080ffff010b80ff0180ff0bff7cffff0bff34ff2880ffff0bff7cffff0bff7cffff0bff34ff2c80ff0580ffff0bff7cffff02ff32ffff04ff02ffff04ff07ffff04ffff0bff34ff3480ff8080808080ffff0bff34ff8080808080ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff2effff04ff02ffff04ff09ff80808080ffff02ff2effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ffff04ffff04ff30ffff04ff5fff808080ffff02ff7effff04ff02ffff04ffff04ffff04ff2fff0580ffff04ff5fff82017f8080ffff04ffff02ff26ffff04ff02ffff04ff0bffff04ff05ffff01ff808080808080ffff04ff17ffff04ff81bfffff04ff82017fffff04ffff02ff2affff04ff02ffff04ff8204ffffff04ffff02ff76ffff04ff02ffff04ff09ffff04ff820affffff04ffff0bff34ff2d80ffff04ff15ff80808080808080ffff04ff8216ffff808080808080ffff04ff8205ffffff04ff820bffff808080808080808080808080ff02ff5affff04ff02ffff04ff5fffff04ff3bffff04ffff02ffff03ff17ffff01ff09ff2dffff02ff2affff04ff02ffff04ff27ffff04ffff02ff76ffff04ff02ffff04ff29ffff04ff57ffff04ffff0bff34ff81b980ffff04ff59ff80808080808080ffff04ff81b7ff80808080808080ff8080ff0180ffff04ff17ffff04ff05ffff04ff8202ffffff04ffff04ffff04ff78ffff04ffff0eff5cffff02ff2effff04ff02ffff04ffff04ff2fffff04ff82017fff808080ff8080808080ff808080ffff04ffff04ff20ffff04ffff0bff81bfff5cffff02ff2effff04ff02ffff04ffff04ff15ffff04ffff10ff82017fffff11ff8202dfff2b80ff8202ff80ff808080ff8080808080ff808080ff138080ff80808080808080808080ff018080
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
; This is a "limitations_program" for use with cat.clsp.
|
|
2
|
-
(mod (
|
|
3
|
-
PUBKEY
|
|
4
|
-
Truths
|
|
5
|
-
parent_is_cat
|
|
6
|
-
lineage_proof
|
|
7
|
-
delta
|
|
8
|
-
inner_conditions
|
|
9
|
-
(
|
|
10
|
-
delegated_puzzle
|
|
11
|
-
delegated_solution
|
|
12
|
-
)
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
(include condition_codes.clib)
|
|
16
|
-
|
|
17
|
-
(defun sha256tree1 (TREE)
|
|
18
|
-
(if (l TREE)
|
|
19
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
20
|
-
(sha256 1 TREE)))
|
|
21
|
-
|
|
22
|
-
(c (list AGG_SIG_UNSAFE PUBKEY (sha256tree1 delegated_puzzle))
|
|
23
|
-
(a delegated_puzzle (c Truths (c parent_is_cat (c lineage_proof (c delta (c inner_conditions delegated_solution))))))
|
|
24
|
-
)
|
|
25
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff82027fff80808080ff80808080ffff02ff82027fffff04ff0bffff04ff17ffff04ff2fffff04ff5fffff04ff81bfff82057f80808080808080ffff04ffff01ff31ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
; This is a "limitations_program" for use with cat.clsp.
|
|
2
|
-
(mod (
|
|
3
|
-
PUBKEY
|
|
4
|
-
Truths
|
|
5
|
-
parent_is_cat
|
|
6
|
-
lineage_proof
|
|
7
|
-
delta
|
|
8
|
-
inner_conditions
|
|
9
|
-
_
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
(include condition_codes.clib)
|
|
13
|
-
|
|
14
|
-
(list (list AGG_SIG_ME PUBKEY delta)) ; Careful with a delta of zero, the bytecode is 80 not 00
|
|
15
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff02ffff04ff05ffff04ff5fff80808080ff8080ffff04ffff0132ff018080
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
; This is a TAIL for use with cat.clvm.
|
|
2
|
-
;
|
|
3
|
-
; This checker allows new CATs to be created if they have a particular coin id as parent
|
|
4
|
-
;
|
|
5
|
-
; The genesis_id is curried in, making this lineage_check program unique and giving the CAT it's uniqueness
|
|
6
|
-
(mod (
|
|
7
|
-
GENESIS_ID
|
|
8
|
-
Truths
|
|
9
|
-
parent_is_cat
|
|
10
|
-
lineage_proof
|
|
11
|
-
delta
|
|
12
|
-
inner_conditions
|
|
13
|
-
_
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
(include cat_truths.clib)
|
|
17
|
-
|
|
18
|
-
(if delta
|
|
19
|
-
(x)
|
|
20
|
-
(if (= (my_parent_cat_truth Truths) GENESIS_ID)
|
|
21
|
-
()
|
|
22
|
-
(x)
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff03ff2fffff01ff0880ffff01ff02ffff03ffff09ff2dff0280ff80ffff01ff088080ff018080ff0180
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
; This is a TAIL for use with cat.clvm.
|
|
2
|
-
;
|
|
3
|
-
; This checker allows new CATs to be created if they have a particular coin id as parent
|
|
4
|
-
;
|
|
5
|
-
; The genesis_id is curried in, making this lineage_check program unique and giving the CAT it's uniqueness
|
|
6
|
-
(mod (
|
|
7
|
-
GENESIS_ID
|
|
8
|
-
MINT_LAUNCHER_PUZZLE_HASH
|
|
9
|
-
Truths
|
|
10
|
-
parent_is_cat
|
|
11
|
-
lineage_proof
|
|
12
|
-
delta
|
|
13
|
-
inner_conditions
|
|
14
|
-
( ; solution
|
|
15
|
-
parent_parent_id
|
|
16
|
-
parent_amount
|
|
17
|
-
)
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
(include cat_truths.clib)
|
|
21
|
-
(include curry-and-treehash.clib)
|
|
22
|
-
|
|
23
|
-
(if delta
|
|
24
|
-
(x)
|
|
25
|
-
(if (= (my_parent_cat_truth Truths) GENESIS_ID)
|
|
26
|
-
()
|
|
27
|
-
(if
|
|
28
|
-
(=
|
|
29
|
-
(my_parent_cat_truth Truths)
|
|
30
|
-
(sha256
|
|
31
|
-
parent_parent_id
|
|
32
|
-
MINT_LAUNCHER_PUZZLE_HASH
|
|
33
|
-
parent_amount
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
()
|
|
37
|
-
(x)
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff03ff5fffff01ff0880ffff01ff02ffff03ffff09ff5bff0280ff80ffff01ff02ffff03ffff09ff5bffff0bff82027fff05ff82057f8080ff80ffff01ff088080ff018080ff018080ff0180
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
; This is a "limitations_program" for use with cat.clsp.
|
|
2
|
-
;
|
|
3
|
-
; This checker allows new CATs to be created if their parent has a particular puzzle hash
|
|
4
|
-
(mod (
|
|
5
|
-
GENESIS_PUZZLE_HASH
|
|
6
|
-
Truths
|
|
7
|
-
parent_is_cat
|
|
8
|
-
lineage_proof
|
|
9
|
-
delta
|
|
10
|
-
inner_conditions
|
|
11
|
-
(parent_parent_id parent_amount)
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
(include cat_truths.clib)
|
|
15
|
-
|
|
16
|
-
; Returns nil since we don't need to add any conditions
|
|
17
|
-
(if delta
|
|
18
|
-
(x)
|
|
19
|
-
(if (= (sha256 parent_parent_id GENESIS_PUZZLE_HASH parent_amount) (my_parent_cat_truth Truths))
|
|
20
|
-
()
|
|
21
|
-
(x)
|
|
22
|
-
)
|
|
23
|
-
)
|
|
24
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff03ff2fffff01ff0880ffff01ff02ffff03ffff09ffff0bff82013fff02ff8202bf80ff2d80ff80ffff01ff088080ff018080ff0180
|
|
File without changes
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from enum import Enum
|
|
5
|
-
from typing import Optional
|
|
6
|
-
|
|
7
|
-
from chia.types.blockchain_format.coin import Coin
|
|
8
|
-
from chia.types.blockchain_format.program import Program
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
|
-
from chia.util.ints import uint32, uint64
|
|
11
|
-
from chia.util.streamable import Streamable, streamable
|
|
12
|
-
from chia.wallet.lineage_proof import LineageProof
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@streamable
|
|
16
|
-
@dataclass(frozen=True)
|
|
17
|
-
class ProposalInfo(Streamable):
|
|
18
|
-
proposal_id: bytes32 # this is launcher_id
|
|
19
|
-
inner_puzzle: Program
|
|
20
|
-
amount_voted: uint64
|
|
21
|
-
yes_votes: uint64
|
|
22
|
-
current_coin: Coin
|
|
23
|
-
current_innerpuz: Optional[Program]
|
|
24
|
-
timer_coin: Optional[Coin] # if this is None then the proposal has finished
|
|
25
|
-
singleton_block_height: uint32 # Block height that current proposal singleton coin was created in
|
|
26
|
-
passed: bool
|
|
27
|
-
closed: bool
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@streamable
|
|
31
|
-
@dataclass(frozen=True)
|
|
32
|
-
class DAOInfo(Streamable):
|
|
33
|
-
treasury_id: bytes32
|
|
34
|
-
cat_wallet_id: uint32
|
|
35
|
-
dao_cat_wallet_id: uint32
|
|
36
|
-
proposals_list: list[ProposalInfo]
|
|
37
|
-
parent_info: list[tuple[bytes32, Optional[LineageProof]]] # {coin.name(): LineageProof}
|
|
38
|
-
current_treasury_coin: Optional[Coin]
|
|
39
|
-
current_treasury_innerpuz: Optional[Program]
|
|
40
|
-
singleton_block_height: uint32 # the block height that the current treasury singleton was created in
|
|
41
|
-
filter_below_vote_amount: uint64 # we ignore proposals with fewer votes than this - defaults to 1
|
|
42
|
-
assets: list[Optional[bytes32]]
|
|
43
|
-
current_height: uint64
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@streamable
|
|
47
|
-
@dataclass(frozen=True)
|
|
48
|
-
class DAORules(Streamable):
|
|
49
|
-
proposal_timelock: uint64
|
|
50
|
-
soft_close_length: uint64
|
|
51
|
-
attendance_required: uint64
|
|
52
|
-
pass_percentage: uint64
|
|
53
|
-
self_destruct_length: uint64
|
|
54
|
-
oracle_spend_delay: uint64
|
|
55
|
-
proposal_minimum_amount: uint64
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class ProposalType(Enum):
|
|
59
|
-
SPEND = "s"
|
|
60
|
-
UPDATE = "u"
|
|
61
|
-
MINT = "m"
|