chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3rc1__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 +79 -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.3rc1.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3rc1.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.3rc1.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/entry_points.txt +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
(mod
|
|
2
|
-
(
|
|
3
|
-
MERKLE_ROOT
|
|
4
|
-
merkle_proof
|
|
5
|
-
puzzle_to_execute
|
|
6
|
-
inner_solution
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
(include utility_macros.clib)
|
|
10
|
-
(include merkle_utils.clib)
|
|
11
|
-
|
|
12
|
-
; takes a lisp tree and returns the hash of it
|
|
13
|
-
(defun sha256tree (TREE)
|
|
14
|
-
(if (l TREE)
|
|
15
|
-
(sha256 2 (sha256tree (f TREE)) (sha256tree (r TREE)))
|
|
16
|
-
(sha256 1 TREE)))
|
|
17
|
-
|
|
18
|
-
(assert (= MERKLE_ROOT (simplify_merkle_proof (sha256tree puzzle_to_execute) merkle_proof))
|
|
19
|
-
(a puzzle_to_execute inner_solution)
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ffff09ff05ffff02ff06ffff04ff02ffff04ffff0bffff0101ffff02ff04ffff04ff02ffff04ff17ff8080808080ffff04ff0bff808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff04ffff01ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff04ffff04ff02ffff04ff09ff80808080ffff02ff04ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff02ffff03ff1bffff01ff02ff06ffff04ff02ffff04ffff02ffff03ffff18ffff0101ff1380ffff01ff0bffff0102ff2bff0580ffff01ff0bffff0102ff05ff2b8080ff0180ffff04ffff04ffff17ff13ffff0181ff80ff3b80ff8080808080ffff010580ff0180ff018080
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff04ffff0101ff0280
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
(mod
|
|
2
|
-
(public_key conditions)
|
|
3
|
-
|
|
4
|
-
(include condition_codes.clib)
|
|
5
|
-
|
|
6
|
-
;; hash a tree
|
|
7
|
-
;; This is used to calculate a puzzle hash given a puzzle program.
|
|
8
|
-
(defun sha256tree1
|
|
9
|
-
(TREE)
|
|
10
|
-
(if (l TREE)
|
|
11
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
12
|
-
(sha256 1 TREE)
|
|
13
|
-
)
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
(c (list AGG_SIG_ME public_key (sha256tree1 conditions)) conditions)
|
|
17
|
-
|
|
18
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff0bff80808080ff80808080ff0b80ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
(mod
|
|
2
|
-
|
|
3
|
-
(public_key delegated_puzzle delegated_puzzle_solution)
|
|
4
|
-
|
|
5
|
-
(include condition_codes.clib)
|
|
6
|
-
|
|
7
|
-
;; hash a tree
|
|
8
|
-
;; This is used to calculate a puzzle hash given a puzzle program.
|
|
9
|
-
(defun sha256tree1
|
|
10
|
-
(TREE)
|
|
11
|
-
(if (l TREE)
|
|
12
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
13
|
-
(sha256 1 TREE)
|
|
14
|
-
)
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
(c (list AGG_SIG_ME public_key (sha256tree1 delegated_puzzle))
|
|
18
|
-
(a delegated_puzzle delegated_puzzle_solution))
|
|
19
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff0bff80808080ff80808080ffff02ff0bff178080ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
; build a pay-to delegated puzzle or hidden puzzle
|
|
2
|
-
; coins can be unlocked by signing a delegated puzzle and its solution
|
|
3
|
-
; OR by revealing the hidden puzzle and the underlying original key
|
|
4
|
-
|
|
5
|
-
; glossary of parameter names:
|
|
6
|
-
|
|
7
|
-
; hidden_puzzle: a "hidden puzzle" that can be revealed and used as an alternate
|
|
8
|
-
; way to unlock the underlying funds
|
|
9
|
-
;
|
|
10
|
-
; synthetic_key_offset: a private key cryptographically generated using the hidden
|
|
11
|
-
; puzzle and as inputs `original_public_key`
|
|
12
|
-
;
|
|
13
|
-
; SYNTHETIC_PUBLIC_KEY: the public key that is the sum of `original_public_key` and the
|
|
14
|
-
; public key corresponding to `synthetic_key_offset`
|
|
15
|
-
;
|
|
16
|
-
; original_public_key: a public key, where knowledge of the corresponding private key
|
|
17
|
-
; represents ownership of the file
|
|
18
|
-
;
|
|
19
|
-
; delegated_puzzle: a delegated puzzle, as in "graftroot", which should return the
|
|
20
|
-
; desired conditions.
|
|
21
|
-
;
|
|
22
|
-
; solution: the solution to the delegated puzzle
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(mod
|
|
26
|
-
; A puzzle should commit to `SYNTHETIC_PUBLIC_KEY`
|
|
27
|
-
;
|
|
28
|
-
; The solution should pass in 0 for `original_public_key` if it wants to use
|
|
29
|
-
; an arbitrary `delegated_puzzle` (and `solution`) signed by the
|
|
30
|
-
; `SYNTHETIC_PUBLIC_KEY` (whose corresponding private key can be calculated
|
|
31
|
-
; if you know the private key for `original_public_key`)
|
|
32
|
-
;
|
|
33
|
-
; Or you can solve the hidden puzzle by revealing the `original_public_key`,
|
|
34
|
-
; the hidden puzzle in `delegated_puzzle`, and a solution to the hidden puzzle.
|
|
35
|
-
|
|
36
|
-
(SYNTHETIC_PUBLIC_KEY original_public_key delegated_puzzle solution)
|
|
37
|
-
|
|
38
|
-
; "assert" is a macro that wraps repeated instances of "if"
|
|
39
|
-
; usage: (assert A0 A1 ... An R)
|
|
40
|
-
; all of A0, A1, ... An must evaluate to non-null, or an exception is raised
|
|
41
|
-
; return the value of R (if we get that far)
|
|
42
|
-
|
|
43
|
-
(defmacro assert items
|
|
44
|
-
(if (r items)
|
|
45
|
-
(list if (f items) (c assert (r items)) (q . (x)))
|
|
46
|
-
(f items)
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
(include condition_codes.clib)
|
|
51
|
-
|
|
52
|
-
;; hash a tree
|
|
53
|
-
;; This is used to calculate a puzzle hash given a puzzle program.
|
|
54
|
-
(defun sha256tree1
|
|
55
|
-
(TREE)
|
|
56
|
-
(if (l TREE)
|
|
57
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
58
|
-
(sha256 1 TREE)
|
|
59
|
-
)
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
; "is_hidden_puzzle_correct" returns true iff the hidden puzzle is correctly encoded
|
|
63
|
-
|
|
64
|
-
(defun-inline is_hidden_puzzle_correct (SYNTHETIC_PUBLIC_KEY original_public_key delegated_puzzle)
|
|
65
|
-
(=
|
|
66
|
-
SYNTHETIC_PUBLIC_KEY
|
|
67
|
-
(point_add
|
|
68
|
-
original_public_key
|
|
69
|
-
(pubkey_for_exp (sha256 original_public_key (sha256tree1 delegated_puzzle)))
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
; "possibly_prepend_aggsig" is the main entry point
|
|
75
|
-
|
|
76
|
-
(defun-inline possibly_prepend_aggsig (SYNTHETIC_PUBLIC_KEY original_public_key delegated_puzzle conditions)
|
|
77
|
-
(if original_public_key
|
|
78
|
-
(assert
|
|
79
|
-
(is_hidden_puzzle_correct SYNTHETIC_PUBLIC_KEY original_public_key delegated_puzzle)
|
|
80
|
-
conditions
|
|
81
|
-
)
|
|
82
|
-
(c (list AGG_SIG_ME SYNTHETIC_PUBLIC_KEY (sha256tree1 delegated_puzzle)) conditions)
|
|
83
|
-
)
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
; main entry point
|
|
87
|
-
|
|
88
|
-
(possibly_prepend_aggsig
|
|
89
|
-
SYNTHETIC_PUBLIC_KEY original_public_key delegated_puzzle
|
|
90
|
-
(a delegated_puzzle solution))
|
|
91
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
; build an M of N multisig puzzle
|
|
2
|
-
; coins are locked by N public keys, any M of which can delegate a sub-puzzle
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
; glossary of parameter names:
|
|
6
|
-
|
|
7
|
-
; public_key_list: a list of N public keys
|
|
8
|
-
|
|
9
|
-
; M: the M in "M of N"
|
|
10
|
-
|
|
11
|
-
; selectors: a list up of 0s and 1s up to size N where exactly M are 1s
|
|
12
|
-
; It's used to select public keys from public_key_list
|
|
13
|
-
|
|
14
|
-
; delegated_puzzle: the puzzle signed by the M public keys
|
|
15
|
-
; This puzzle must return a list of conditions
|
|
16
|
-
|
|
17
|
-
; solution: the solution to the delegated puzzle
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(mod
|
|
21
|
-
(M public_key_list selectors delegated_puzzle solution)
|
|
22
|
-
|
|
23
|
-
(include condition_codes.clib)
|
|
24
|
-
|
|
25
|
-
;; hash a tree
|
|
26
|
-
;; This is used to calculate a puzzle hash given a puzzle program.
|
|
27
|
-
(defun sha256tree1
|
|
28
|
-
(TREE)
|
|
29
|
-
(if (l TREE)
|
|
30
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
31
|
-
(sha256 1 TREE)
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
; "assert" is a macro that wraps repeated instances of "if"
|
|
36
|
-
; usage: (assert A0 A1 ... An R)
|
|
37
|
-
; all of A0, A1, ... An must evaluate to non-null, or an exception is raised
|
|
38
|
-
; return the value of R (if we get that far)
|
|
39
|
-
|
|
40
|
-
(defmacro assert items
|
|
41
|
-
(if (r items)
|
|
42
|
-
(list if (f items) (c assert (r items)) (q . (x)))
|
|
43
|
-
(f items)
|
|
44
|
-
)
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
; add_aggsig returns a list of conditions. It includes M AGG_SIG conditions
|
|
48
|
-
; corresponding to the given list of public keys (with the given hash)
|
|
49
|
-
; plus the conditions that come out of the delegated puzzle.
|
|
50
|
-
;
|
|
51
|
-
; hash is the hash of delegated_puzzle.
|
|
52
|
-
; Yes it's redundant since we include the delegated_puzzle itself,
|
|
53
|
-
; but we don't want to recalculate the hash multiple times as its expensive to do so
|
|
54
|
-
|
|
55
|
-
(defun add_aggsig (public_key_list hash delegated_puzzle solution)
|
|
56
|
-
(if public_key_list
|
|
57
|
-
(c (list AGG_SIG_UNSAFE (f public_key_list) hash)
|
|
58
|
-
(add_aggsig (r public_key_list) hash delegated_puzzle solution)
|
|
59
|
-
)
|
|
60
|
-
(a delegated_puzzle solution)
|
|
61
|
-
)
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
; choose_keys takes a list of selectors and the N public keys and
|
|
65
|
-
; returns a list of the M public keys chosen by the selectors
|
|
66
|
-
|
|
67
|
-
(defun choose_keys (selectors public_key_list)
|
|
68
|
-
(if selectors
|
|
69
|
-
(if (f selectors)
|
|
70
|
-
(c (f public_key_list) (choose_keys (r selectors) (r public_key_list)))
|
|
71
|
-
(choose_keys (r selectors) (r public_key_list)))
|
|
72
|
-
()
|
|
73
|
-
)
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
; count the number of non-0 values in the list of selectors and return it as an integer
|
|
78
|
-
|
|
79
|
-
(defun count_selectors (selectors)
|
|
80
|
-
(if selectors
|
|
81
|
-
(+
|
|
82
|
-
(count_selectors (r selectors))
|
|
83
|
-
(if (f selectors) 1 0)
|
|
84
|
-
)
|
|
85
|
-
0
|
|
86
|
-
)
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
; "solve_puzzle" is the main entry point
|
|
90
|
-
|
|
91
|
-
(defun-inline solve_puzzle (M public_key_list selectors delegated_puzzle solution)
|
|
92
|
-
; make sure we have exactly M selectors
|
|
93
|
-
(assert (= M (count_selectors selectors))
|
|
94
|
-
; return the AGG_SIG conditions plus the conditions from the delegated_puzzle
|
|
95
|
-
(add_aggsig (choose_keys selectors public_key_list)
|
|
96
|
-
(sha256tree1 delegated_puzzle)
|
|
97
|
-
delegated_puzzle
|
|
98
|
-
solution)
|
|
99
|
-
)
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
; main entry point
|
|
103
|
-
|
|
104
|
-
(solve_puzzle
|
|
105
|
-
M public_key_list
|
|
106
|
-
selectors delegated_puzzle solution
|
|
107
|
-
)
|
|
108
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ffff09ff05ffff02ff16ffff04ff02ffff04ff17ff8080808080ffff01ff02ff0cffff04ff02ffff04ffff02ff0affff04ff02ffff04ff17ffff04ff0bff8080808080ffff04ffff02ff1effff04ff02ffff04ff2fff80808080ffff04ff2fffff04ff5fff80808080808080ffff01ff088080ff0180ffff04ffff01ffff31ff02ffff03ff05ffff01ff04ffff04ff08ffff04ff09ffff04ff0bff80808080ffff02ff0cffff04ff02ffff04ff0dffff04ff0bffff04ff17ffff04ff2fff8080808080808080ffff01ff02ff17ff2f8080ff0180ffff02ffff03ff05ffff01ff02ffff03ff09ffff01ff04ff13ffff02ff0affff04ff02ffff04ff0dffff04ff1bff808080808080ffff01ff02ff0affff04ff02ffff04ff0dffff04ff1bff808080808080ff0180ff8080ff0180ffff02ffff03ff05ffff01ff10ffff02ff16ffff04ff02ffff04ff0dff80808080ffff02ffff03ff09ffff01ff0101ff8080ff018080ff8080ff0180ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff1effff04ff02ffff04ff09ff80808080ffff02ff1effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
(mod
|
|
2
|
-
(
|
|
3
|
-
MORPHER ; For no morphing, 1
|
|
4
|
-
parent_parent_id
|
|
5
|
-
parent_inner_puz
|
|
6
|
-
parent_amount
|
|
7
|
-
parent_solution
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
(include condition_codes.clib)
|
|
11
|
-
(include curry-and-treehash.clib)
|
|
12
|
-
|
|
13
|
-
(c
|
|
14
|
-
(list ASSERT_MY_PARENT_ID
|
|
15
|
-
(calculate_coin_id parent_parent_id (a MORPHER (sha256tree parent_inner_puz)) parent_amount)
|
|
16
|
-
)
|
|
17
|
-
(a parent_inner_puz parent_solution)
|
|
18
|
-
)
|
|
19
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff08ffff04ffff02ff0affff04ff02ffff04ff0bffff04ffff02ff05ffff02ff0effff04ff02ffff04ff17ff8080808080ffff04ff2fff808080808080ff808080ffff02ff17ff5f8080ffff04ffff01ffff4720ffff02ffff03ffff22ffff09ffff0dff0580ff0c80ffff09ffff0dff0b80ff0c80ffff15ff17ffff0181ff8080ffff01ff0bff05ff0bff1780ffff01ff088080ff0180ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff0effff04ff02ffff04ff09ff80808080ffff02ff0effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
(mod
|
|
2
|
-
(inner_puzzle_hash inner_puzzle inner_puzzle_solution)
|
|
3
|
-
|
|
4
|
-
;; hash a tree
|
|
5
|
-
;; This is used to calculate a puzzle hash given a puzzle program.
|
|
6
|
-
(defun sha256tree1
|
|
7
|
-
(TREE)
|
|
8
|
-
(if (l TREE)
|
|
9
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
10
|
-
(sha256 1 TREE)
|
|
11
|
-
)
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
(if (= inner_puzzle_hash (sha256tree1 inner_puzzle))
|
|
15
|
-
(a inner_puzzle inner_puzzle_solution)
|
|
16
|
-
(x)
|
|
17
|
-
)
|
|
18
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ffff09ff05ffff02ff02ffff04ff02ffff04ff0bff8080808080ffff01ff02ff0bff1780ffff01ff088080ff0180ffff04ffff01ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff02ffff04ff02ffff04ff09ff80808080ffff02ff02ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
(mod (SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH singleton_inner_puzzle_hash my_id)
|
|
2
|
-
|
|
3
|
-
; SINGLETON_MOD_HASH is the mod-hash for the singleton_top_layer puzzle
|
|
4
|
-
; LAUNCHER_ID is the ID of the singleton we are committed to paying to
|
|
5
|
-
; LAUNCHER_PUZZLE_HASH is the puzzle hash of the launcher
|
|
6
|
-
; singleton_inner_puzzle_hash is the innerpuzzlehash for our singleton at the current time
|
|
7
|
-
; my_id is the coin_id of the coin that this puzzle is locked into
|
|
8
|
-
|
|
9
|
-
(include condition_codes.clib)
|
|
10
|
-
(include curry-and-treehash.clib)
|
|
11
|
-
|
|
12
|
-
;; return the full puzzlehash for a singleton with the innerpuzzle curried in
|
|
13
|
-
; puzzle-hash-of-curried-function is imported from curry-and-treehash.clib
|
|
14
|
-
(defun-inline calculate_full_puzzle_hash (SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH inner_puzzle_hash)
|
|
15
|
-
(puzzle-hash-of-curried-function SINGLETON_MOD_HASH
|
|
16
|
-
inner_puzzle_hash
|
|
17
|
-
(sha256tree (c SINGLETON_MOD_HASH (c LAUNCHER_ID LAUNCHER_PUZZLE_HASH)))
|
|
18
|
-
)
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
(defun-inline claim_rewards (SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH singleton_inner_puzzle_hash my_id)
|
|
22
|
-
(list
|
|
23
|
-
(list ASSERT_PUZZLE_ANNOUNCEMENT (sha256 (calculate_full_puzzle_hash SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH singleton_inner_puzzle_hash) my_id))
|
|
24
|
-
(list CREATE_COIN_ANNOUNCEMENT '$')
|
|
25
|
-
(list ASSERT_MY_COIN_ID my_id))
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
; main
|
|
29
|
-
(claim_rewards SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH singleton_inner_puzzle_hash my_id)
|
|
30
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff18ffff04ffff0bffff02ff2effff04ff02ffff04ff05ffff04ff2fffff04ffff02ff3effff04ff02ffff04ffff04ff05ffff04ff0bff178080ff80808080ff808080808080ff5f80ff808080ffff04ffff04ff2cffff01ff248080ffff04ffff04ff10ffff04ff5fff808080ff80808080ffff04ffff01ffffff463fff02ff3c04ffff01ff0102ffff02ffff03ff05ffff01ff02ff16ffff04ff02ffff04ff0dffff04ffff0bff3affff0bff12ff3c80ffff0bff3affff0bff3affff0bff12ff2a80ff0980ffff0bff3aff0bffff0bff12ff8080808080ff8080808080ffff010b80ff0180ffff0bff3affff0bff12ff1480ffff0bff3affff0bff3affff0bff12ff2a80ff0580ffff0bff3affff02ff16ffff04ff02ffff04ff07ffff04ffff0bff12ff1280ff8080808080ffff0bff12ff8080808080ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff3effff04ff02ffff04ff09ff80808080ffff02ff3effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
;; Works with p2_singleton_via_delegated_puzzle
|
|
2
|
-
;; When we have many p2_singleton coins and want to aggregate them together
|
|
3
|
-
|
|
4
|
-
;; all coins make announcements of their puzhash, amount, and ID
|
|
5
|
-
;; the aggregator coin (the one creating the output) creates an announcement of the ID of each merge coin
|
|
6
|
-
;; each merge coin asserts that the aggregator has an announcement of their (the merge coin's) ID
|
|
7
|
-
;; The merge coins each create an announcement of 0 (equivalent to announcing their coin ID)
|
|
8
|
-
;; The aggregator asserts that there is a 0 announcement from each of the merge coins
|
|
9
|
-
|
|
10
|
-
;; merge coin announces 0 <-> aggregator asserts that merge coin ID announces 0
|
|
11
|
-
;; aggregator announces merge coin ID <-> merge coin asserts that aggregator announces my_id
|
|
12
|
-
|
|
13
|
-
(mod
|
|
14
|
-
(
|
|
15
|
-
my_id
|
|
16
|
-
my_puzhash
|
|
17
|
-
my_amount
|
|
18
|
-
list_of_parent_puzhash_amounts ; list of (parent_id puzhash amount) for the merge
|
|
19
|
-
output_parent_amount ; (parent_id amount) of the coin creating the output
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
(include condition_codes.clib)
|
|
23
|
-
(include curry-and-treehash.clib)
|
|
24
|
-
(include *standard-cl-21*)
|
|
25
|
-
|
|
26
|
-
(defun cons_announcements_to_output (coin_id output)
|
|
27
|
-
(c
|
|
28
|
-
(list ASSERT_COIN_ANNOUNCEMENT (sha256 coin_id 0))
|
|
29
|
-
(c
|
|
30
|
-
(list CREATE_COIN_ANNOUNCEMENT coin_id)
|
|
31
|
-
output
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
(defun for_parent_puzhash_amounts
|
|
37
|
-
(
|
|
38
|
-
my_puzhash
|
|
39
|
-
(@ coin_info_list ((@ first (parent puzhash amount)) . rest))
|
|
40
|
-
total
|
|
41
|
-
)
|
|
42
|
-
(if coin_info_list
|
|
43
|
-
(cons_announcements_to_output
|
|
44
|
-
(calculate_coin_id parent puzhash amount)
|
|
45
|
-
(for_parent_puzhash_amounts my_puzhash rest (+ total amount))
|
|
46
|
-
)
|
|
47
|
-
(list
|
|
48
|
-
(list ASSERT_HEIGHT_RELATIVE 5) ; TODO: should this be higher or lower?
|
|
49
|
-
(list CREATE_COIN my_puzhash total (list my_puzhash))
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
(defun-inline give_self_to_merge (my_id my_puzhash (@ output_info (parent amount)))
|
|
55
|
-
;; Coins being merged are asserting the output coin id, and insisting it has the same puzhash as them
|
|
56
|
-
;; This ensures that the puzzle which issues the CREATE_COIN condition is the same as this puzzle.
|
|
57
|
-
(list
|
|
58
|
-
(list CREATE_COIN_ANNOUNCEMENT 0)
|
|
59
|
-
(list ASSERT_COIN_ANNOUNCEMENT (sha256 (calculate_coin_id parent my_puzhash amount) my_id))
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
(c
|
|
66
|
-
(list ASSERT_MY_AMOUNT my_amount)
|
|
67
|
-
(c
|
|
68
|
-
(list ASSERT_MY_PUZZLEHASH my_puzhash)
|
|
69
|
-
(c
|
|
70
|
-
(list ASSERT_MY_COIN_ID my_id)
|
|
71
|
-
(if list_of_parent_puzhash_amounts
|
|
72
|
-
; we are making the output
|
|
73
|
-
(for_parent_puzhash_amounts my_puzhash list_of_parent_puzhash_amounts my_amount)
|
|
74
|
-
; we are letting another coin make the output
|
|
75
|
-
(give_self_to_merge my_id my_puzhash output_parent_amount)
|
|
76
|
-
)
|
|
77
|
-
)
|
|
78
|
-
)
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ffff0149ffff04ff17ffff01808080ffff04ffff04ffff0148ffff04ff0bffff01808080ffff04ffff04ffff0146ffff04ff05ffff01808080ffff02ffff03ff2fffff01ff02ffff01ff02ff0effff04ff02ffff04ff0bffff04ff2fffff04ff17ff808080808080ff0180ffff01ff02ffff01ff04ffff04ffff013cffff04ffff0180ffff01808080ffff04ffff04ffff013dffff04ffff0bffff02ff04ffff04ff02ffff04ffff05ff5f80ffff04ff0bffff04ffff05ffff06ff5f8080ff808080808080ff0580ffff01808080ffff01808080ff018080ff0180808080ffff04ffff01ffff02ffff03ffff22ffff09ffff0dff0580ffff012080ffff09ffff0dff0b80ffff012080ffff15ff17ffff0181ff8080ffff01ff02ffff01ff0bff05ff0bff1780ff0180ffff01ff02ffff01ff0880ff018080ff0180ffff04ffff04ffff013dffff04ffff0bff05ff8080ff808080ffff04ffff04ffff013cffff04ff05ff808080ff0b8080ff02ffff03ff0bffff01ff02ffff01ff02ff0affff04ff02ffff04ffff02ff04ffff04ff02ffff04ff23ffff04ff53ffff04ff8200b3ff808080808080ffff04ffff02ff0effff04ff02ffff04ff05ffff04ff1bffff04ffff10ff17ff8200b380ff808080808080ff8080808080ff0180ffff01ff02ffff01ff04ffff04ffff0152ffff04ffff0105ffff01808080ffff04ffff04ffff0133ffff04ff05ffff04ff17ffff04ffff04ff05ffff018080ffff018080808080ffff01808080ff018080ff0180ff018080
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
(mod (SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH SECONDS_DELAY DELAYED_PUZZLE_HASH p1 my_id)
|
|
2
|
-
|
|
3
|
-
;; This puzzle has two escape conditions: the regular "claim via singleton", and the
|
|
4
|
-
;; delayed "claim via puzzle hash", delayed by a fixed number of seconds.
|
|
5
|
-
|
|
6
|
-
; SINGLETON_MOD_HASH is the mod-hash for the singleton_top_layer puzzle
|
|
7
|
-
; LAUNCHER_ID is the ID of the singleton we are committed to paying to
|
|
8
|
-
; LAUNCHER_PUZZLE_HASH is the puzzle hash of the launcher
|
|
9
|
-
; SECONDS_DELAY is the number of seconds before the coin can be spent with `DELAYED_PUZZLE_HASH`
|
|
10
|
-
; DELAYED_PUZZLE_HASH is the puzzle hash of the delayed puzzle
|
|
11
|
-
; if my_id is passed in as () then this signals that we are trying to do a delayed spend case
|
|
12
|
-
; p1's meaning changes depending upon which case we're using
|
|
13
|
-
; if we are paying to singleton then p1 is singleton_inner_puzzle_hash
|
|
14
|
-
; if we are running the delayed case then p1 is the amount to output
|
|
15
|
-
|
|
16
|
-
(include condition_codes.clib)
|
|
17
|
-
(include curry-and-treehash.clib)
|
|
18
|
-
|
|
19
|
-
;; return the full puzzlehash for a singleton with the innerpuzzle curried in
|
|
20
|
-
; puzzle-hash-of-curried-function is imported from curry-and-treehash.clib
|
|
21
|
-
(defun-inline delayed_spend (SECONDS_DELAY DELAYED_PUZZLE_HASH amount)
|
|
22
|
-
(list
|
|
23
|
-
(list ASSERT_SECONDS_RELATIVE SECONDS_DELAY)
|
|
24
|
-
(list CREATE_COIN DELAYED_PUZZLE_HASH amount)
|
|
25
|
-
(list ASSERT_MY_AMOUNT amount)
|
|
26
|
-
)
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
;; return the full puzzlehash for a singleton with the innerpuzzle curried in
|
|
30
|
-
; puzzle-hash-of-curried-function is imported from curry-and-treehash.clib
|
|
31
|
-
(defun-inline calculate_full_puzzle_hash (SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH inner_puzzle_hash)
|
|
32
|
-
(puzzle-hash-of-curried-function SINGLETON_MOD_HASH
|
|
33
|
-
inner_puzzle_hash
|
|
34
|
-
(sha256tree (c SINGLETON_MOD_HASH (c LAUNCHER_ID LAUNCHER_PUZZLE_HASH)))
|
|
35
|
-
)
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
(defun-inline claim_rewards (SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH singleton_inner_puzzle_hash my_id)
|
|
39
|
-
(list
|
|
40
|
-
(list ASSERT_PUZZLE_ANNOUNCEMENT (sha256 (calculate_full_puzzle_hash SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH singleton_inner_puzzle_hash) my_id))
|
|
41
|
-
(list CREATE_COIN_ANNOUNCEMENT '$')
|
|
42
|
-
(list ASSERT_MY_COIN_ID my_id))
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
; main
|
|
46
|
-
(if my_id
|
|
47
|
-
(claim_rewards SINGLETON_MOD_HASH LAUNCHER_ID LAUNCHER_PUZZLE_HASH p1 my_id)
|
|
48
|
-
(delayed_spend SECONDS_DELAY DELAYED_PUZZLE_HASH p1)
|
|
49
|
-
)
|
|
50
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ff82017fffff01ff04ffff04ff38ffff04ffff0bffff02ff2effff04ff02ffff04ff05ffff04ff81bfffff04ffff02ff3effff04ff02ffff04ffff04ff05ffff04ff0bff178080ff80808080ff808080808080ff82017f80ff808080ffff04ffff04ff3cffff01ff248080ffff04ffff04ff28ffff04ff82017fff808080ff80808080ffff01ff04ffff04ff24ffff04ff2fff808080ffff04ffff04ff2cffff04ff5fffff04ff81bfff80808080ffff04ffff04ff10ffff04ff81bfff808080ff8080808080ff0180ffff04ffff01ffffff49ff463fffff5002ff333cffff04ff0101ffff02ff02ffff03ff05ffff01ff02ff36ffff04ff02ffff04ff0dffff04ffff0bff26ffff0bff2aff1280ffff0bff26ffff0bff26ffff0bff2aff3a80ff0980ffff0bff26ff0bffff0bff2aff8080808080ff8080808080ffff010b80ff0180ffff0bff26ffff0bff2aff3480ffff0bff26ffff0bff26ffff0bff2aff3a80ff0580ffff0bff26ffff02ff36ffff04ff02ffff04ff07ffff04ffff0bff2aff2a80ff8080808080ffff0bff2aff8080808080ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff3effff04ff02ffff04ff09ff80808080ffff02ff3effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
;; This puzzle holds an amount which can be spent via two spend paths:
|
|
2
|
-
;; 1. to a delegated puzzle provided our owner singleton creates a puzzle announcement of this coin's id and the delegated puzzle.
|
|
3
|
-
;; 2. coins of this puzzle type can be merged together without the owner singleton's permission. This spend type is useful for DAOs which use this puzzle to custody funds and want to keep a reasonable limit on the number of coins tracked by DAO wallets.
|
|
4
|
-
;; The AGGREGATOR_PUZZLE is curried in to preserve generality and so its logic can be updated without requiring any change to the spend to delegated path. Optionally the Aggregator puzzle can be `(x)` to close off this spend path
|
|
5
|
-
|
|
6
|
-
(mod (
|
|
7
|
-
SINGLETON_STRUCT
|
|
8
|
-
AGGREGATOR_PUZZLE
|
|
9
|
-
aggregator_solution ; (my_id my_puzhash list_of_parent_puzhash_amounts my_amount)
|
|
10
|
-
singleton_inner_puzhash
|
|
11
|
-
delegated_puzzle
|
|
12
|
-
delegated_solution
|
|
13
|
-
my_id
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
(include condition_codes.clib)
|
|
17
|
-
(include curry-and-treehash.clib)
|
|
18
|
-
|
|
19
|
-
(defun-inline calculate_full_puzzle_hash (SINGLETON_STRUCT singleton_inner_puzhash)
|
|
20
|
-
(puzzle-hash-of-curried-function (f SINGLETON_STRUCT)
|
|
21
|
-
singleton_inner_puzhash
|
|
22
|
-
(sha256tree SINGLETON_STRUCT)
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
(if aggregator_solution
|
|
27
|
-
; we are merging coins to make a larger coin
|
|
28
|
-
(a AGGREGATOR_PUZZLE aggregator_solution)
|
|
29
|
-
; we are being spent by our singleton
|
|
30
|
-
(c
|
|
31
|
-
(list
|
|
32
|
-
ASSERT_PUZZLE_ANNOUNCEMENT
|
|
33
|
-
(sha256
|
|
34
|
-
(calculate_full_puzzle_hash SINGLETON_STRUCT singleton_inner_puzhash)
|
|
35
|
-
(sha256tree (list my_id (sha256tree delegated_puzzle)))
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
(c
|
|
39
|
-
(list CREATE_COIN_ANNOUNCEMENT '$')
|
|
40
|
-
(c
|
|
41
|
-
(list ASSERT_MY_COIN_ID my_id)
|
|
42
|
-
(a delegated_puzzle delegated_solution)
|
|
43
|
-
)
|
|
44
|
-
)
|
|
45
|
-
)
|
|
46
|
-
)
|
|
47
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ff17ffff01ff02ff0bff1780ffff01ff04ffff04ff18ffff04ffff0bffff02ff2effff04ff02ffff04ff09ffff04ff2fffff04ffff02ff3effff04ff02ffff04ff05ff80808080ff808080808080ffff02ff3effff04ff02ffff04ffff04ff82017fffff04ffff02ff3effff04ff02ffff04ff5fff80808080ff808080ff8080808080ff808080ffff04ffff04ff2cffff01ff248080ffff04ffff04ff10ffff04ff82017fff808080ffff02ff5fff81bf8080808080ff0180ffff04ffff01ffffff463fff02ff3c04ffff01ff0102ffff02ffff03ff05ffff01ff02ff16ffff04ff02ffff04ff0dffff04ffff0bff3affff0bff12ff3c80ffff0bff3affff0bff3affff0bff12ff2a80ff0980ffff0bff3aff0bffff0bff12ff8080808080ff8080808080ffff010b80ff0180ffff0bff3affff0bff12ff1480ffff0bff3affff0bff3affff0bff12ff2a80ff0580ffff0bff3affff02ff16ffff04ff02ffff04ff07ffff04ffff0bff12ff1280ff8080808080ffff0bff12ff8080808080ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff3effff04ff02ffff04ff09ff80808080ffff02ff3effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
(mod notarized_payments
|
|
2
|
-
;; `notarized_payments` is a list of notarized coin payments
|
|
3
|
-
;; a notarized coin payment is `(nonce . ((puzzle_hash amount ...) (puzzle_hash amount ...) ...))`
|
|
4
|
-
;; Each notarized coin payment creates some `(CREATE_COIN puzzle_hash amount ...)` payments
|
|
5
|
-
;; and a `(CREATE_PUZZLE_ANNOUNCEMENT (sha256tree notarized_coin_payment))` announcement
|
|
6
|
-
;; The idea is the other side of this trade requires observing the announcement from a
|
|
7
|
-
;; `settlement_payments` puzzle hash as a condition of one or more coin spends.
|
|
8
|
-
|
|
9
|
-
(include condition_codes.clib)
|
|
10
|
-
(include utility_macros.clib)
|
|
11
|
-
|
|
12
|
-
(defun sha256tree (TREE)
|
|
13
|
-
(if (l TREE)
|
|
14
|
-
(sha256 2 (sha256tree (f TREE)) (sha256tree (r TREE)))
|
|
15
|
-
(sha256 1 TREE)
|
|
16
|
-
)
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
(defun create_coins_for_payment (payment_params so_far)
|
|
20
|
-
(if payment_params
|
|
21
|
-
(assert (> (f (r (f payment_params))) 0) ; assert the amount is positive
|
|
22
|
-
; then
|
|
23
|
-
(c (c CREATE_COIN (f payment_params)) (create_coins_for_payment (r payment_params) so_far))
|
|
24
|
-
)
|
|
25
|
-
so_far
|
|
26
|
-
)
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
(defun-inline create_announcement_for_payment (notarized_payment)
|
|
30
|
-
(list CREATE_PUZZLE_ANNOUNCEMENT
|
|
31
|
-
(sha256tree notarized_payment))
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
(defun-inline augment_condition_list (notarized_payment so_far)
|
|
35
|
-
(c
|
|
36
|
-
(create_announcement_for_payment notarized_payment)
|
|
37
|
-
(create_coins_for_payment (r notarized_payment) so_far)
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
(defun construct_condition_list (notarized_payments)
|
|
42
|
-
(if notarized_payments
|
|
43
|
-
(augment_condition_list (f notarized_payments) (construct_condition_list (r notarized_payments)))
|
|
44
|
-
()
|
|
45
|
-
)
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
(construct_condition_list notarized_payments)
|
|
49
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ff0affff04ff02ffff04ff03ff80808080ffff04ffff01ffff333effff02ffff03ff05ffff01ff04ffff04ff0cffff04ffff02ff1effff04ff02ffff04ff09ff80808080ff808080ffff02ff16ffff04ff02ffff04ff19ffff04ffff02ff0affff04ff02ffff04ff0dff80808080ff808080808080ff8080ff0180ffff02ffff03ff05ffff01ff02ffff03ffff15ff29ff8080ffff01ff04ffff04ff08ff0980ffff02ff16ffff04ff02ffff04ff0dffff04ff0bff808080808080ffff01ff088080ff0180ffff010b80ff0180ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff1effff04ff02ffff04ff09ff80808080ffff02ff1effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
(mod (singleton_full_puzzle_hash amount key_value_list)
|
|
2
|
-
|
|
3
|
-
(include condition_codes.clib)
|
|
4
|
-
|
|
5
|
-
; takes a lisp tree and returns the hash of it
|
|
6
|
-
(defun sha256tree1 (TREE)
|
|
7
|
-
(if (l TREE)
|
|
8
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
9
|
-
(sha256 1 TREE)
|
|
10
|
-
)
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
; main
|
|
14
|
-
(list (list CREATE_COIN singleton_full_puzzle_hash amount)
|
|
15
|
-
(list CREATE_COIN_ANNOUNCEMENT (sha256tree1 (list singleton_full_puzzle_hash amount key_value_list))))
|
|
16
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff04ffff04ff04ffff04ff05ffff04ff0bff80808080ffff04ffff04ff0affff04ffff02ff0effff04ff02ffff04ffff04ff05ffff04ff0bffff04ff17ff80808080ff80808080ff808080ff808080ffff04ffff01ff33ff3cff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff0effff04ff02ffff04ff09ff80808080ffff02ff0effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080
|