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
|
File without changes
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
; The DID innerpuzzle is designed to sit inside the singleton layer and provide functionality related to being an identity.
|
|
2
|
-
; At the moment the two pieces of functionality are recovery and message creation.
|
|
3
|
-
; A DID's ID is it's Singleton ID
|
|
4
|
-
; Recovery is based around having a list of known other DIDs which can send messages approving you change the innerpuzzle of your DID singleton
|
|
5
|
-
|
|
6
|
-
(mod
|
|
7
|
-
(
|
|
8
|
-
INNER_PUZZLE ; Standard P2 inner puzzle, used to record the ownership of the DID.
|
|
9
|
-
RECOVERY_DID_LIST_HASH ; the list of DIDs that can send messages to you for recovery we store only the hash so that we don't have to reveal every time we make a message spend
|
|
10
|
-
NUM_VERIFICATIONS_REQUIRED ; how many of the above list are required for a recovery
|
|
11
|
-
SINGLETON_STRUCT ; my singleton_struct, formerly a Truth - ((SINGLETON_MOD_HASH, (LAUNCHER_ID, LAUNCHER_PUZZLE_HASH)))
|
|
12
|
-
METADATA ; Customized metadata, e.g KYC info
|
|
13
|
-
mode ; this indicates which spend mode we want. 0. Recovery mode 1. Run INNER_PUZZLE with p2_solution
|
|
14
|
-
my_amount_or_inner_solution ; In mode 0, we use this to recover our coin and assert it is our actual amount
|
|
15
|
-
; In mode 1 this is the solution of the inner P2 puzzle, only required in the create message mode and transfer mode.
|
|
16
|
-
new_inner_puzhash ; In recovery mode, this will be the new wallet DID puzzle hash
|
|
17
|
-
parent_innerpuzhash_amounts_for_recovery_ids ; during a recovery we need extra information about our recovery list coins
|
|
18
|
-
pubkey ; this is the new pubkey used for a recovery
|
|
19
|
-
recovery_list_reveal ; this is the reveal of the stored list of DIDs approved for recovery
|
|
20
|
-
my_id ; my coin ID
|
|
21
|
-
)
|
|
22
|
-
;message is the new puzzle in the recovery and standard spend cases
|
|
23
|
-
|
|
24
|
-
;MOD_HASH, MY_PUBKEY, RECOVERY_DID_LIST_HASH are curried into the puzzle
|
|
25
|
-
;EXAMPLE SOLUTION (0xcafef00d 0x12341234 0x923bf9a7856b19d335a65f12d68957d497e1f0c16c0e14baf6d120e60753a1ce 2 1 100 (q "source code") 0xdeadbeef 0xcafef00d ((0xdadadada 0xdad5dad5 200) () (0xfafafafa 0xfaf5faf5 200)) 0xfadeddab (0x22222222 0x33333333 0x44444444))
|
|
26
|
-
|
|
27
|
-
(include condition_codes.clib)
|
|
28
|
-
(include curry-and-treehash.clib)
|
|
29
|
-
|
|
30
|
-
; takes a lisp tree and returns the hash of it
|
|
31
|
-
(defun sha256tree1 (TREE)
|
|
32
|
-
(if (l TREE)
|
|
33
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
34
|
-
(sha256 1 TREE)
|
|
35
|
-
)
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
; recovery message module - gets values curried in to make the puzzle
|
|
39
|
-
(defun make_message_puzzle (recovering_coin newpuz pubkey)
|
|
40
|
-
(qq (q . (((unquote CREATE_COIN_ANNOUNCEMENT) (unquote recovering_coin)) ((unquote AGG_SIG_UNSAFE) (unquote pubkey) (unquote newpuz)))))
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
; this function creates the assert announcement for each message coin approving a recovery
|
|
44
|
-
(defun-inline create_consume_message (coin_id my_id new_innerpuz pubkey)
|
|
45
|
-
(list ASSERT_COIN_ANNOUNCEMENT (sha256 (sha256 coin_id (sha256tree1 (make_message_puzzle my_id new_innerpuz pubkey))) my_id))
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
; this function calculates a coin ID given the inner puzzle and singleton information
|
|
49
|
-
(defun create_coin_ID_for_recovery (SINGLETON_STRUCT launcher_id parent innerpuzhash amount)
|
|
50
|
-
(sha256 parent (calculate_full_puzzle_hash (c (f SINGLETON_STRUCT) (c launcher_id (r (r SINGLETON_STRUCT)))) innerpuzhash) amount)
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
; return the full puzzlehash for a singleton with the innerpuzzle curried in
|
|
55
|
-
; puzzle-hash-of-curried-function is imported from curry-and-treehash.clib
|
|
56
|
-
(defun-inline calculate_full_puzzle_hash (SINGLETON_STRUCT inner_puzzle_hash)
|
|
57
|
-
(puzzle-hash-of-curried-function (f SINGLETON_STRUCT)
|
|
58
|
-
inner_puzzle_hash
|
|
59
|
-
(sha256tree1 SINGLETON_STRUCT)
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
; this loops over our identities to check list, and checks if we have been given parent information for this identity
|
|
64
|
-
; the reason for this is because we might only require 3/5 of the IDs give approval messages for a recovery
|
|
65
|
-
; if we have the information for an identity then we create a consume message using that information
|
|
66
|
-
|
|
67
|
-
(defun check_messages_from_identities (SINGLETON_STRUCT num_verifications_required identities my_id new_puz parent_innerpuzhash_amounts_for_recovery_ids pubkey num_verifications)
|
|
68
|
-
(if identities
|
|
69
|
-
(if (f parent_innerpuzhash_amounts_for_recovery_ids)
|
|
70
|
-
; if we have parent information then we should create a consume coin condition
|
|
71
|
-
(c
|
|
72
|
-
(create_consume_message
|
|
73
|
-
; create coin_id from DID
|
|
74
|
-
(create_coin_ID_for_recovery
|
|
75
|
-
SINGLETON_STRUCT
|
|
76
|
-
(f identities)
|
|
77
|
-
(f (f parent_innerpuzhash_amounts_for_recovery_ids))
|
|
78
|
-
(f (r (f parent_innerpuzhash_amounts_for_recovery_ids)))
|
|
79
|
-
(f (r (r (f parent_innerpuzhash_amounts_for_recovery_ids)))))
|
|
80
|
-
my_id
|
|
81
|
-
new_puz
|
|
82
|
-
pubkey
|
|
83
|
-
)
|
|
84
|
-
(check_messages_from_identities
|
|
85
|
-
SINGLETON_STRUCT
|
|
86
|
-
num_verifications_required
|
|
87
|
-
(r identities)
|
|
88
|
-
my_id
|
|
89
|
-
new_puz
|
|
90
|
-
(r parent_innerpuzhash_amounts_for_recovery_ids)
|
|
91
|
-
pubkey
|
|
92
|
-
(+ num_verifications 1)
|
|
93
|
-
)
|
|
94
|
-
)
|
|
95
|
-
; if no parent information found for this identity, move on to next in list
|
|
96
|
-
(check_messages_from_identities
|
|
97
|
-
SINGLETON_STRUCT
|
|
98
|
-
(r identities)
|
|
99
|
-
my_id
|
|
100
|
-
new_puz
|
|
101
|
-
(r parent_innerpuzhash_amounts_for_recovery_ids)
|
|
102
|
-
pubkey
|
|
103
|
-
num_verifications
|
|
104
|
-
)
|
|
105
|
-
)
|
|
106
|
-
;if we're out of identites to check for, check we have enough
|
|
107
|
-
(if (> num_verifications (- num_verifications_required 1))
|
|
108
|
-
(list (list AGG_SIG_UNSAFE pubkey new_puz) )
|
|
109
|
-
(x)
|
|
110
|
-
)
|
|
111
|
-
)
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
;Spend modes:
|
|
115
|
-
;0 = recovery
|
|
116
|
-
;1 = run the INNER_PUZZLE
|
|
117
|
-
|
|
118
|
-
;MAIN
|
|
119
|
-
(if mode
|
|
120
|
-
; mode 1 - run INNER_PUZZLE
|
|
121
|
-
(a INNER_PUZZLE my_amount_or_inner_solution)
|
|
122
|
-
|
|
123
|
-
; mode 0 - recovery
|
|
124
|
-
(if (all (= (sha256tree1 recovery_list_reveal) RECOVERY_DID_LIST_HASH) (> NUM_VERIFICATIONS_REQUIRED 0))
|
|
125
|
-
(c (list ASSERT_MY_AMOUNT my_amount_or_inner_solution)
|
|
126
|
-
(c (list CREATE_COIN new_inner_puzhash my_amount_or_inner_solution (list new_inner_puzhash))
|
|
127
|
-
(c (list ASSERT_MY_COIN_ID my_id)
|
|
128
|
-
(check_messages_from_identities SINGLETON_STRUCT NUM_VERIFICATIONS_REQUIRED recovery_list_reveal my_id new_inner_puzhash parent_innerpuzhash_amounts_for_recovery_ids pubkey 0)
|
|
129
|
-
)
|
|
130
|
-
)
|
|
131
|
-
)
|
|
132
|
-
(x)
|
|
133
|
-
)
|
|
134
|
-
)
|
|
135
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ff81bfffff01ff02ff05ff82017f80ffff01ff02ffff03ffff22ffff09ffff02ff7effff04ff02ffff04ff8217ffff80808080ff0b80ffff15ff17ff808080ffff01ff04ffff04ff28ffff04ff82017fff808080ffff04ffff04ff34ffff04ff8202ffffff04ff82017fffff04ffff04ff8202ffff8080ff8080808080ffff04ffff04ff38ffff04ff822fffff808080ffff02ff26ffff04ff02ffff04ff2fffff04ff17ffff04ff8217ffffff04ff822fffffff04ff8202ffffff04ff8205ffffff04ff820bffffff01ff8080808080808080808080808080ffff01ff088080ff018080ff0180ffff04ffff01ffffffff313dff4946ffff0233ff3c04ffffff0101ff02ff02ffff03ff05ffff01ff02ff3affff04ff02ffff04ff0dffff04ffff0bff2affff0bff22ff3c80ffff0bff2affff0bff2affff0bff22ff3280ff0980ffff0bff2aff0bffff0bff22ff8080808080ff8080808080ffff010b80ff0180ffffff02ffff03ff17ffff01ff02ffff03ff82013fffff01ff04ffff04ff30ffff04ffff0bffff0bffff02ff36ffff04ff02ffff04ff05ffff04ff27ffff04ff82023fffff04ff82053fffff04ff820b3fff8080808080808080ffff02ff7effff04ff02ffff04ffff02ff2effff04ff02ffff04ff2fffff04ff5fffff04ff82017fff808080808080ff8080808080ff2f80ff808080ffff02ff26ffff04ff02ffff04ff05ffff04ff0bffff04ff37ffff04ff2fffff04ff5fffff04ff8201bfffff04ff82017fffff04ffff10ff8202ffffff010180ff808080808080808080808080ffff01ff02ff26ffff04ff02ffff04ff05ffff04ff37ffff04ff2fffff04ff5fffff04ff8201bfffff04ff82017fffff04ff8202ffff8080808080808080808080ff0180ffff01ff02ffff03ffff15ff8202ffffff11ff0bffff01018080ffff01ff04ffff04ff20ffff04ff82017fffff04ff5fff80808080ff8080ffff01ff088080ff018080ff0180ff0bff17ffff02ff5effff04ff02ffff04ff09ffff04ff2fffff04ffff02ff7effff04ff02ffff04ffff04ff09ffff04ff0bff1d8080ff80808080ff808080808080ff5f80ffff04ffff0101ffff04ffff04ff2cffff04ff05ff808080ffff04ffff04ff20ffff04ff17ffff04ff0bff80808080ff80808080ffff0bff2affff0bff22ff2480ffff0bff2affff0bff2affff0bff22ff3280ff0580ffff0bff2affff02ff3affff04ff02ffff04ff07ffff04ffff0bff22ff2280ff8080808080ffff0bff22ff8080808080ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff7effff04ff02ffff04ff09ff80808080ffff02ff7effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
chia/wallet/payment.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass, field
|
|
4
|
-
|
|
5
|
-
from chia.types.blockchain_format.program import Program
|
|
6
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
7
|
-
from chia.util.ints import uint64
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# This class is supposed to correspond to a CREATE_COIN condition
|
|
11
|
-
@dataclass(frozen=True)
|
|
12
|
-
class Payment:
|
|
13
|
-
puzzle_hash: bytes32
|
|
14
|
-
amount: uint64
|
|
15
|
-
memos: list[bytes] = field(default_factory=list)
|
|
16
|
-
|
|
17
|
-
def as_condition_args(self) -> list:
|
|
18
|
-
return [self.puzzle_hash, self.amount, self.memos]
|
|
19
|
-
|
|
20
|
-
def as_condition(self) -> Program:
|
|
21
|
-
return Program.to([51, *self.as_condition_args()])
|
|
22
|
-
|
|
23
|
-
def name(self) -> bytes32:
|
|
24
|
-
return self.as_condition().get_tree_hash()
|
|
25
|
-
|
|
26
|
-
@classmethod
|
|
27
|
-
def from_condition(cls, condition: Program) -> Payment:
|
|
28
|
-
python_condition: list = condition.as_python()
|
|
29
|
-
puzzle_hash, amount = python_condition[1:3]
|
|
30
|
-
memos: list[bytes] = []
|
|
31
|
-
if len(python_condition) > 3:
|
|
32
|
-
memos = python_condition[3]
|
|
33
|
-
return cls(bytes32(puzzle_hash), uint64(int.from_bytes(amount, "big")), memos)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff04ff02ffff02ff05ff0b8080
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
; See chia/types/condition_opcodes.py
|
|
2
|
-
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
; Unavailable until after 2.0 hard fork
|
|
6
|
-
(defconstant AGG_SIG_PARENT 43)
|
|
7
|
-
(defconstant AGG_SIG_PUZZLE 44)
|
|
8
|
-
(defconstant AGG_SIG_AMOUNT 45)
|
|
9
|
-
(defconstant AGG_SIG_PUZZLE_AMOUNT 46)
|
|
10
|
-
(defconstant AGG_SIG_PARENT_AMOUNT 47)
|
|
11
|
-
(defconstant AGG_SIG_PARENT_PUZZLE 48)
|
|
12
|
-
;
|
|
13
|
-
|
|
14
|
-
(defconstant AGG_SIG_UNSAFE 49)
|
|
15
|
-
(defconstant AGG_SIG_ME 50)
|
|
16
|
-
|
|
17
|
-
; the conditions below reserve coin amounts and have to be accounted for in output totals
|
|
18
|
-
|
|
19
|
-
(defconstant CREATE_COIN 51)
|
|
20
|
-
(defconstant RESERVE_FEE 52)
|
|
21
|
-
|
|
22
|
-
; the conditions below deal with announcements, for inter-coin communication
|
|
23
|
-
|
|
24
|
-
; coin announcements
|
|
25
|
-
(defconstant CREATE_COIN_ANNOUNCEMENT 60)
|
|
26
|
-
(defconstant ASSERT_COIN_ANNOUNCEMENT 61)
|
|
27
|
-
|
|
28
|
-
; puzzle announcements
|
|
29
|
-
(defconstant CREATE_PUZZLE_ANNOUNCEMENT 62)
|
|
30
|
-
(defconstant ASSERT_PUZZLE_ANNOUNCEMENT 63)
|
|
31
|
-
|
|
32
|
-
; coin-id
|
|
33
|
-
(defconstant ASSERT_CONCURRENT_SPEND 64)
|
|
34
|
-
; puzzle-hash
|
|
35
|
-
(defconstant ASSERT_CONCURRENT_PUZZLE 65)
|
|
36
|
-
|
|
37
|
-
; mask message ...
|
|
38
|
-
(defconstant SEND_MESSAGE 66)
|
|
39
|
-
(defconstant RECEIVE_MESSAGE 67)
|
|
40
|
-
|
|
41
|
-
; the conditions below let coins inquire about themselves
|
|
42
|
-
|
|
43
|
-
(defconstant ASSERT_MY_COIN_ID 70)
|
|
44
|
-
(defconstant ASSERT_MY_PARENT_ID 71)
|
|
45
|
-
(defconstant ASSERT_MY_PUZZLEHASH 72)
|
|
46
|
-
(defconstant ASSERT_MY_AMOUNT 73)
|
|
47
|
-
(defconstant ASSERT_MY_BIRTH_SECONDS 74)
|
|
48
|
-
(defconstant ASSERT_MY_BIRTH_HEIGHT 75)
|
|
49
|
-
(defconstant ASSERT_EPHEMERAL 76)
|
|
50
|
-
|
|
51
|
-
; the conditions below ensure that we're "far enough" in the future
|
|
52
|
-
|
|
53
|
-
; wall-clock time
|
|
54
|
-
(defconstant ASSERT_SECONDS_RELATIVE 80)
|
|
55
|
-
(defconstant ASSERT_SECONDS_ABSOLUTE 81)
|
|
56
|
-
|
|
57
|
-
; block index
|
|
58
|
-
(defconstant ASSERT_HEIGHT_RELATIVE 82)
|
|
59
|
-
(defconstant ASSERT_HEIGHT_ABSOLUTE 83)
|
|
60
|
-
|
|
61
|
-
; the conditions below ensure that we're "not too far" in the future
|
|
62
|
-
|
|
63
|
-
; wall-clock time
|
|
64
|
-
(defconstant ASSERT_BEFORE_SECONDS_RELATIVE 84)
|
|
65
|
-
(defconstant ASSERT_BEFORE_SECONDS_ABSOLUTE 85)
|
|
66
|
-
|
|
67
|
-
; block index
|
|
68
|
-
(defconstant ASSERT_BEFORE_HEIGHT_RELATIVE 86)
|
|
69
|
-
(defconstant ASSERT_BEFORE_HEIGHT_ABSOLUTE 87)
|
|
70
|
-
|
|
71
|
-
; A condition that is always true and always ignore all arguments
|
|
72
|
-
(defconstant REMARK 1)
|
|
73
|
-
|
|
74
|
-
; A condition whose first argument specifies its cost, but is unkown otherwise
|
|
75
|
-
; It's a place-holder for soft-forking in new conditions
|
|
76
|
-
(defconstant SOFTFORK 90)
|
|
77
|
-
)
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
;;
|
|
2
|
-
;; THIS FILE IS DEPRECATED and is only for legacy contracts.
|
|
3
|
-
;; Please use `curry.clib` going forward. It has a less stupid API.
|
|
4
|
-
;;
|
|
5
|
-
|
|
6
|
-
(
|
|
7
|
-
;; The code below is used to calculate of the tree hash of a curried function
|
|
8
|
-
;; without actually doing the curry, and using other optimization tricks
|
|
9
|
-
;; like unrolling `sha256tree`.
|
|
10
|
-
|
|
11
|
-
(defconstant ONE 1)
|
|
12
|
-
(defconstant TWO 2)
|
|
13
|
-
(defconstant A_KW #a)
|
|
14
|
-
(defconstant Q_KW #q)
|
|
15
|
-
(defconstant C_KW #c)
|
|
16
|
-
|
|
17
|
-
;; Given the tree hash `environment-hash` of an environment tree E
|
|
18
|
-
;; and the tree hash `parameter-hash` of a constant parameter P
|
|
19
|
-
;; return the tree hash of the tree corresponding to
|
|
20
|
-
;; `(c (q . P) E)`
|
|
21
|
-
;; This is the new environment tree with the addition parameter P curried in.
|
|
22
|
-
;;
|
|
23
|
-
;; Note that `(c (q . P) E)` = `(c . ((q . P) . (E . 0)))`
|
|
24
|
-
|
|
25
|
-
(defun-inline update-hash-for-parameter-hash (parameter-hash environment-hash)
|
|
26
|
-
(sha256 TWO (sha256 ONE C_KW)
|
|
27
|
-
(sha256 TWO (sha256 TWO (sha256 ONE Q_KW) parameter-hash)
|
|
28
|
-
(sha256 TWO environment-hash (sha256 ONE 0))))
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
;; This function recursively calls `update-hash-for-parameter-hash`, updating `environment-hash`
|
|
32
|
-
;; along the way.
|
|
33
|
-
|
|
34
|
-
(defun build-curry-list (reversed-curry-parameter-hashes environment-hash)
|
|
35
|
-
(if reversed-curry-parameter-hashes
|
|
36
|
-
(build-curry-list (r reversed-curry-parameter-hashes)
|
|
37
|
-
(update-hash-for-parameter-hash (f reversed-curry-parameter-hashes) environment-hash))
|
|
38
|
-
environment-hash
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
;; Given the tree hash `environment-hash` of an environment tree E
|
|
43
|
-
;; and the tree hash `function-hash` of a function tree F
|
|
44
|
-
;; return the tree hash of the tree corresponding to
|
|
45
|
-
;; `(a (q . F) E)`
|
|
46
|
-
;; This is the hash of a new function that adopts the new environment E.
|
|
47
|
-
;; This is used to build of the tree hash of a curried function.
|
|
48
|
-
;;
|
|
49
|
-
;; Note that `(a (q . F) E)` = `(a . ((q . F) . (E . 0)))`
|
|
50
|
-
|
|
51
|
-
(defun-inline tree-hash-of-apply (function-hash environment-hash)
|
|
52
|
-
(sha256 TWO (sha256 ONE A_KW)
|
|
53
|
-
(sha256 TWO (sha256 TWO (sha256 ONE Q_KW) function-hash)
|
|
54
|
-
(sha256 TWO environment-hash (sha256 ONE 0))))
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
;; DO NOT USE THIS FUNCTION GOING FORWARD. Having to pass the arguments in reverse order is stupid.
|
|
58
|
-
;; When I (RK) wrote this, I thought it was necessary, but of course, I was just being dumb
|
|
59
|
-
;; and it is not necessary. It's very confusing.
|
|
60
|
-
;;
|
|
61
|
-
;; function-hash:
|
|
62
|
-
;; the hash of a puzzle function, ie. a `mod`
|
|
63
|
-
;;
|
|
64
|
-
;; reversed-curry-parameter-hashes:
|
|
65
|
-
;; a list of pre-hashed trees representing parameters to be curried into the puzzle.
|
|
66
|
-
;; Note that this must be applied in REVERSED order. This may seem strange, but it greatly simplifies
|
|
67
|
-
;; the underlying code, since we calculate the tree hash from the bottom nodes up, and the last
|
|
68
|
-
;; parameters curried must have their hashes calculated first.
|
|
69
|
-
;;
|
|
70
|
-
;; we return the hash of the curried expression
|
|
71
|
-
;; (a (q . function-hash) (c (cp1 (c cp2 (c ... 1)...))))
|
|
72
|
-
;;
|
|
73
|
-
;; Note that from a user's perspective the hashes passed in here aren't simply
|
|
74
|
-
;; the hashes of the desired parameters, but their treehash representation since
|
|
75
|
-
;; that's the form we're assuming they take in the actual curried program.
|
|
76
|
-
|
|
77
|
-
;; DO NOT USE
|
|
78
|
-
(defun puzzle-hash-of-curried-function (function-hash . reversed-curry-parameter-hashes)
|
|
79
|
-
(tree-hash-of-apply function-hash
|
|
80
|
-
(build-curry-list reversed-curry-parameter-hashes (sha256 ONE ONE)))
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
(defconstant b32 32)
|
|
84
|
-
|
|
85
|
-
(defun-inline size_b32 (var)
|
|
86
|
-
(= (strlen var) b32)
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
(defun calculate_coin_id (parent puzzlehash amount)
|
|
90
|
-
(if (all (size_b32 parent) (size_b32 puzzlehash) (> amount -1))
|
|
91
|
-
(sha256 parent puzzlehash amount)
|
|
92
|
-
(x)
|
|
93
|
-
)
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
; takes a lisp tree and returns the hash of it
|
|
97
|
-
(defun sha256tree (TREE)
|
|
98
|
-
(if (l TREE)
|
|
99
|
-
(sha256 2 (sha256tree (f TREE)) (sha256tree (r TREE)))
|
|
100
|
-
(sha256 1 TREE)))
|
|
101
|
-
|
|
102
|
-
)
|
chia/wallet/puzzles/curry.clib
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
(
|
|
2
|
-
;; The code below is used to calculate of the tree hash of a curried function
|
|
3
|
-
;; without actually doing the curry, and using other optimization tricks
|
|
4
|
-
;; like unrolling `sha256tree`.
|
|
5
|
-
|
|
6
|
-
(defconstant TWO 2)
|
|
7
|
-
(defconstant constant_tree (
|
|
8
|
-
(0x4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a . ; = `(sha256 1)`
|
|
9
|
-
0x9dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2) . ; = `(sha256 1 1)` = `(sha256 1 #q)`
|
|
10
|
-
(0x02a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222 . ; = `(concat 2 (sha256 1 #a))`
|
|
11
|
-
0x02a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c5) ; = `(concat 2 (sha256 1 #c))`
|
|
12
|
-
)
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
; I looked into calculating the values of `constant_tree` because it's pretty easy to code-golf
|
|
16
|
-
; out an implementation that produces the values cheaper than just inlining them. The problem is,
|
|
17
|
-
; when do we calculate them? If there were a way to calculate it "before main" and include it in
|
|
18
|
-
; the globally-accessible constant table, we could do that. But we can't which means to be optimal,
|
|
19
|
-
; client code should call the "build table" code once, then pass it around to anyone that wants to
|
|
20
|
-
; call `curry` or `curry2`. This is pretty intrusive, so for now we'll just use the existing
|
|
21
|
-
; global constant infrastructure, and include it as a fixed table so the tree of four values will
|
|
22
|
-
; appear in all code that includes this file, and it will compress better in generators.
|
|
23
|
-
|
|
24
|
-
(defun-inline sha256_one _noargs (f (f constant_tree)))
|
|
25
|
-
(defun-inline sha256_one_one _noargs (r (f constant_tree)))
|
|
26
|
-
(defun-inline two_sha256_one_a_kw _noargs (f (r constant_tree)))
|
|
27
|
-
(defun-inline two_sha256_one_c_kw _noargs (r (r constant_tree)))
|
|
28
|
-
|
|
29
|
-
;; this returns the sha256 tree hash of expression F = `((q . a1) a2)`
|
|
30
|
-
(defun hash_expression_F (a1 a2)
|
|
31
|
-
(sha256 TWO (sha256 TWO (sha256_one_one) a1)
|
|
32
|
-
(sha256 TWO a2 (sha256_one)))
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
;; Given the tree hash `environment_hash` of an environment tree E
|
|
36
|
-
;; and the tree hash `parameter_hash` of a constant parameter P
|
|
37
|
-
;; return the tree hash of the tree corresponding to
|
|
38
|
-
;; `(c (q . P) E)`
|
|
39
|
-
;; This is the new environment tree with the addition parameter P curried in.
|
|
40
|
-
;;
|
|
41
|
-
;; Note that `(c (q . P) E)` = `(c . ((q . P) . (E . 0)))`
|
|
42
|
-
|
|
43
|
-
(defun-inline update_hash_for_parameter_hash (parameter_hash environment_hash)
|
|
44
|
-
(sha256 (two_sha256_one_c_kw) (hash_expression_F parameter_hash environment_hash))
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
;; Given the tree hash `environment_hash` of an environment tree E
|
|
48
|
-
;; and the tree hash `mod_hash` of a mod M
|
|
49
|
-
;; return the tree hash of the tree corresponding to
|
|
50
|
-
;; `(a (q . M) E)`
|
|
51
|
-
;; This is the hash of a new function that adopts the new environment E.
|
|
52
|
-
;; This is used to build of the tree hash of a curried function.
|
|
53
|
-
;;
|
|
54
|
-
;; Note that `(a (q . M) E)` = `(a . ((q . M) . (E . 0)))`
|
|
55
|
-
|
|
56
|
-
(defun-inline tree_hash_of_apply (mod_hash environment_hash)
|
|
57
|
-
(sha256 (two_sha256_one_a_kw) (hash_expression_F mod_hash environment_hash))
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
;; This function recursively calls `update_hash_for_parameter_hash`
|
|
61
|
-
|
|
62
|
-
(defun calculate_hash_of_curried_parameters (curry_parameter_hashes)
|
|
63
|
-
(if curry_parameter_hashes
|
|
64
|
-
(update_hash_for_parameter_hash (f curry_parameter_hashes) (calculate_hash_of_curried_parameters (r curry_parameter_hashes)))
|
|
65
|
-
(sha256_one_one)
|
|
66
|
-
)
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
;; mod_hash:
|
|
70
|
-
;; the hash of a puzzle function, ie. a `mod`
|
|
71
|
-
;;
|
|
72
|
-
;; curry_parameter_hashes:
|
|
73
|
-
;; a list of pre_hashed trees representing parameters to be curried into the puzzle.
|
|
74
|
-
;;
|
|
75
|
-
;; we return the hash of the curried expression
|
|
76
|
-
;; (a (q . mod_hash) (c (cp1 (c cp2 (c ... 1)...))))
|
|
77
|
-
;;
|
|
78
|
-
;; Note that from a user's perspective the hashes passed in here aren't simply
|
|
79
|
-
;; the hashes of the desired parameters, but their treehash representation since
|
|
80
|
-
;; that's the form we're assuming they take in the acutal curried program.
|
|
81
|
-
|
|
82
|
-
;; inline functions that take varargs don't seem to work, so we can't inline `curry`
|
|
83
|
-
|
|
84
|
-
(defun curry_hashes (mod_hash . curry_parameter_hashes)
|
|
85
|
-
(tree_hash_of_apply mod_hash
|
|
86
|
-
(calculate_hash_of_curried_parameters curry_parameter_hashes))
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
;; This is the macro version that inlines everything and expects varargs parameters.
|
|
91
|
-
;; It may be more efficient in some cases.
|
|
92
|
-
|
|
93
|
-
(defmacro curry_hashes_inline (mod_hash . curry_parameter_hashes)
|
|
94
|
-
(qq
|
|
95
|
-
(sha256
|
|
96
|
-
; apply
|
|
97
|
-
(two_sha256_one_a_kw)
|
|
98
|
-
(sha256 TWO
|
|
99
|
-
; func
|
|
100
|
-
(sha256 TWO
|
|
101
|
-
(sha256_one_one)
|
|
102
|
-
(unquote mod_hash)
|
|
103
|
-
)
|
|
104
|
-
(sha256 TWO
|
|
105
|
-
; args
|
|
106
|
-
(unquote (c build_pre_hashed_environment curry_parameter_hashes))
|
|
107
|
-
(sha256_one)
|
|
108
|
-
)
|
|
109
|
-
)
|
|
110
|
-
)
|
|
111
|
-
)
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
;; helper macro
|
|
116
|
-
|
|
117
|
-
(defmacro build_pre_hashed_environment curry_parameter_hashes
|
|
118
|
-
(qq
|
|
119
|
-
(sha256
|
|
120
|
-
(two_sha256_one_c_kw)
|
|
121
|
-
(sha256 TWO
|
|
122
|
-
(sha256 TWO
|
|
123
|
-
(sha256_one_one)
|
|
124
|
-
(unquote (f curry_parameter_hashes))
|
|
125
|
-
)
|
|
126
|
-
(sha256 TWO
|
|
127
|
-
(unquote (if (r curry_parameter_hashes) (c build_pre_hashed_environment (r curry_parameter_hashes)) (q . (sha256_one_one))))
|
|
128
|
-
(sha256_one)
|
|
129
|
-
)
|
|
130
|
-
)
|
|
131
|
-
)
|
|
132
|
-
)
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
)
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
(
|
|
2
|
-
(defun recurry_by_index_ordered (
|
|
3
|
-
index_value_pairs_list ; MUST BE ORDERED
|
|
4
|
-
current_position ; must be 0 on initial call
|
|
5
|
-
CURRENT_PARAMS ; current list of curry params
|
|
6
|
-
)
|
|
7
|
-
(if index_value_pairs_list
|
|
8
|
-
(if (= (f (f index_value_pairs_list)) current_position)
|
|
9
|
-
(c (r (f index_value_pairs_list)) (recurry_by_index_ordered (r index_value_pairs_list) (+ current_position 1) (r CURRENT_PARAMS)))
|
|
10
|
-
(c (f CURRENT_PARAMS) (recurry_by_index_ordered index_value_pairs_list (+ current_position 1) (r CURRENT_PARAMS)))
|
|
11
|
-
)
|
|
12
|
-
()
|
|
13
|
-
)
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
; This file is what the first form the CAT takes, and then it gets immediately eve spent out of here.
|
|
2
|
-
; This allows the coin to move into its real state already having been eve spent and validated to not be a fake CAT.
|
|
3
|
-
; The trick is that we won't know what the real state puzzlehash reveal is, but we will know what this is.
|
|
4
|
-
; Mint into this, eve spend out of this
|
|
5
|
-
(mod (
|
|
6
|
-
NEW_PUZZLE_HASH ; this is the CAT inner_puzzle
|
|
7
|
-
my_amount
|
|
8
|
-
tail_reveal
|
|
9
|
-
tail_solution
|
|
10
|
-
)
|
|
11
|
-
(include condition_codes.clib)
|
|
12
|
-
(list
|
|
13
|
-
(list CREATE_COIN NEW_PUZZLE_HASH my_amount (list NEW_PUZZLE_HASH))
|
|
14
|
-
(list ASSERT_MY_AMOUNT my_amount)
|
|
15
|
-
(list CREATE_COIN 0 -113 tail_reveal tail_solution) ; this is secure because anything but the real values won't work
|
|
16
|
-
)
|
|
17
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff06ffff04ff05ffff04ff0bffff04ffff04ff05ff8080ff8080808080ffff04ffff04ff04ffff04ff0bff808080ffff04ffff04ff06ffff04ff80ffff04ffff01818fffff04ff17ffff04ff2fff808080808080ff80808080ffff04ffff01ff4933ff018080
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
(mod (
|
|
2
|
-
TREASURY_SINGLETON_STRUCT
|
|
3
|
-
treasury_inner_puz_hash
|
|
4
|
-
parent_parent
|
|
5
|
-
new_puzzle_hash ; the full CAT puzzle
|
|
6
|
-
amount
|
|
7
|
-
)
|
|
8
|
-
(include condition_codes.clib)
|
|
9
|
-
(include curry-and-treehash.clib)
|
|
10
|
-
|
|
11
|
-
(defun calculate_singleton_puzzle_hash (PROPOSAL_SINGLETON_STRUCT inner_puzzle_hash)
|
|
12
|
-
(puzzle-hash-of-curried-function (f PROPOSAL_SINGLETON_STRUCT)
|
|
13
|
-
inner_puzzle_hash
|
|
14
|
-
(sha256tree PROPOSAL_SINGLETON_STRUCT)
|
|
15
|
-
)
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
(defun create_parent_conditions (parent_id new_puzzle_hash amount)
|
|
19
|
-
(list
|
|
20
|
-
(list ASSERT_COIN_ANNOUNCEMENT (sha256 parent_id (sha256tree (list 'm' new_puzzle_hash))))
|
|
21
|
-
(list ASSERT_MY_PARENT_ID parent_id)
|
|
22
|
-
)
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
(c
|
|
26
|
-
(list CREATE_COIN new_puzzle_hash amount (list new_puzzle_hash))
|
|
27
|
-
(c
|
|
28
|
-
(list ASSERT_MY_AMOUNT amount)
|
|
29
|
-
(create_parent_conditions
|
|
30
|
-
(sha256 parent_parent (calculate_singleton_puzzle_hash TREASURY_SINGLETON_STRUCT treasury_inner_puz_hash) ONE)
|
|
31
|
-
new_puzzle_hash
|
|
32
|
-
amount
|
|
33
|
-
)
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff34ffff04ff2fffff04ff5fffff04ffff04ff2fff8080ff8080808080ffff04ffff04ff28ffff04ff5fff808080ffff02ff36ffff04ff02ffff04ffff0bff17ffff02ff26ffff04ff02ffff04ff05ffff04ff0bff8080808080ff3c80ffff04ff2fffff04ff5fff8080808080808080ffff04ffff01ffffff3dff4947ffff0233ff0401ffff01ff02ff02ffff03ff05ffff01ff02ff3affff04ff02ffff04ff0dffff04ffff0bff2affff0bff3cff2c80ffff0bff2affff0bff2affff0bff3cff1280ff0980ffff0bff2aff0bffff0bff3cff8080808080ff8080808080ffff010b80ff0180ffffff02ff2effff04ff02ffff04ff09ffff04ff0bffff04ffff02ff3effff04ff02ffff04ff05ff80808080ff808080808080ff04ffff04ff10ffff04ffff0bff05ffff02ff3effff04ff02ffff04ffff04ffff016dffff04ff0bff808080ff8080808080ff808080ffff04ffff04ff38ffff04ff05ff808080ff808080ffff0bff2affff0bff3cff2480ffff0bff2affff0bff2affff0bff3cff1280ff0580ffff0bff2affff02ff3affff04ff02ffff04ff07ffff04ffff0bff3cff3c80ff8080808080ffff0bff3cff8080808080ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff3effff04ff02ffff04ff09ff80808080ffff02ff3effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
; This code is the end state of a proposal or a dividend.
|
|
2
|
-
; It is an oracle which simply recreates itself and emits an announcement that it has concluded operation
|
|
3
|
-
|
|
4
|
-
(mod (SINGLETON_STRUCT DAO_FINISHED_STATE_MOD_HASH my_amount)
|
|
5
|
-
(include condition_codes.clib)
|
|
6
|
-
(include curry-and-treehash.clib)
|
|
7
|
-
(include *standard-cl-21*)
|
|
8
|
-
|
|
9
|
-
(defun wrap_in_singleton (SINGLETON_STRUCT my_inner_puzhash)
|
|
10
|
-
(puzzle-hash-of-curried-function (f SINGLETON_STRUCT)
|
|
11
|
-
my_inner_puzhash
|
|
12
|
-
(sha256tree SINGLETON_STRUCT)
|
|
13
|
-
)
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
(defun recreate_self (SINGLETON_STRUCT DAO_FINISHED_STATE_MOD_HASH)
|
|
17
|
-
(puzzle-hash-of-curried-function DAO_FINISHED_STATE_MOD_HASH
|
|
18
|
-
(sha256 ONE DAO_FINISHED_STATE_MOD_HASH)
|
|
19
|
-
(sha256tree SINGLETON_STRUCT)
|
|
20
|
-
)
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
(let
|
|
25
|
-
(
|
|
26
|
-
(my_inner_puzhash (recreate_self SINGLETON_STRUCT DAO_FINISHED_STATE_MOD_HASH))
|
|
27
|
-
)
|
|
28
|
-
(list
|
|
29
|
-
(list ASSERT_MY_PUZZLEHASH (wrap_in_singleton SINGLETON_STRUCT my_inner_puzhash))
|
|
30
|
-
(list ASSERT_MY_AMOUNT my_amount)
|
|
31
|
-
(list CREATE_COIN my_inner_puzhash my_amount)
|
|
32
|
-
(list CREATE_PUZZLE_ANNOUNCEMENT 0)
|
|
33
|
-
)
|
|
34
|
-
)
|
|
35
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ffff0148ffff04ffff02ff16ffff04ff02ffff04ffff05ffff06ff018080ffff04ffff02ff1effff04ff02ffff04ff05ffff04ff0bff8080808080ff8080808080ffff01808080ffff04ffff04ffff0149ffff04ffff05ffff06ffff06ffff06ff0180808080ffff01808080ffff04ffff04ffff0133ffff04ffff02ff1effff04ff02ffff04ff05ffff04ff0bff8080808080ffff04ffff05ffff06ffff06ffff06ff0180808080ffff0180808080ffff04ffff04ffff013effff04ffff0180ffff01808080ffff018080808080ffff04ffff01ffffff02ffff03ff05ffff01ff02ffff01ff02ff08ffff04ff02ffff04ffff06ff0580ffff04ffff0bffff0102ffff0bffff0101ffff010480ffff0bffff0102ffff0bffff0102ffff0bffff0101ffff010180ffff05ff058080ffff0bffff0102ff0bffff0bffff0101ffff018080808080ff8080808080ff0180ffff01ff02ffff010bff018080ff0180ff0bffff0102ffff01a0a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222ffff0bffff0102ffff0bffff0102ffff01a09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ff0580ffff0bffff0102ffff02ff08ffff04ff02ffff04ff07ffff01ffa09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b280808080ffff01a04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a808080ffff02ffff03ffff07ff0580ffff01ff02ffff01ff0bffff0102ffff02ff0affff04ff02ffff04ffff05ff0580ff80808080ffff02ff0affff04ff02ffff04ffff06ff0580ff8080808080ff0180ffff01ff02ffff01ff0bffff0101ff0580ff018080ff0180ffff02ff0cffff04ff02ffff04ff09ffff04ff0bffff04ffff02ff0affff04ff02ffff04ff05ff80808080ff808080808080ff02ff0cffff04ff02ffff04ff0bffff04ffff0bffff0101ff0b80ffff04ffff02ff0affff04ff02ffff04ff05ff80808080ff808080808080ff018080
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7f3cc356732907933a8f9b1ccf16f71735d07340eb38c847aa402e97d75eb40b
|