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,177 +0,0 @@
|
|
|
1
|
-
(mod (SINGLETON_STRUCT INNER_PUZZLE lineage_proof my_amount inner_solution)
|
|
2
|
-
|
|
3
|
-
;; SINGLETON_STRUCT = (MOD_HASH . (LAUNCHER_ID . LAUNCHER_PUZZLE_HASH))
|
|
4
|
-
|
|
5
|
-
; SINGLETON_STRUCT, INNER_PUZZLE are curried in by the wallet
|
|
6
|
-
|
|
7
|
-
; EXAMPLE SOLUTION '(0xfadeddab 0xdeadbeef 1 (0xdeadbeef 200) 50 ((51 0xfadeddab 100) (60 "trash") (51 deadbeef 0)))'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
; This puzzle is a wrapper around an inner smart puzzle which guarantees uniqueness.
|
|
11
|
-
; It takes its singleton identity from a coin with a launcher puzzle which guarantees that it is unique.
|
|
12
|
-
|
|
13
|
-
(include condition_codes.clib)
|
|
14
|
-
(include curry-and-treehash.clib)
|
|
15
|
-
(include singleton_truths.clib)
|
|
16
|
-
|
|
17
|
-
; takes a lisp tree and returns the hash of it
|
|
18
|
-
(defun sha256tree1 (TREE)
|
|
19
|
-
(if (l TREE)
|
|
20
|
-
(sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE)))
|
|
21
|
-
(sha256 1 TREE)
|
|
22
|
-
)
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
; "assert" is a macro that wraps repeated instances of "if"
|
|
26
|
-
; usage: (assert A0 A1 ... An R)
|
|
27
|
-
; all of A0, A1, ... An must evaluate to non-null, or an exception is raised
|
|
28
|
-
; return the value of R (if we get that far)
|
|
29
|
-
|
|
30
|
-
(defmacro assert items
|
|
31
|
-
(if (r items)
|
|
32
|
-
(list if (f items) (c assert (r items)) (q . (x)))
|
|
33
|
-
(f items)
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
(defun-inline mod_hash_for_singleton_struct (SINGLETON_STRUCT) (f SINGLETON_STRUCT))
|
|
38
|
-
(defun-inline launcher_id_for_singleton_struct (SINGLETON_STRUCT) (f (r SINGLETON_STRUCT)))
|
|
39
|
-
(defun-inline launcher_puzzle_hash_for_singleton_struct (SINGLETON_STRUCT) (r (r SINGLETON_STRUCT)))
|
|
40
|
-
|
|
41
|
-
;; return the full puzzlehash for a singleton with the innerpuzzle curried in
|
|
42
|
-
; puzzle-hash-of-curried-function is imported from curry-and-treehash.clib
|
|
43
|
-
(defun-inline calculate_full_puzzle_hash (SINGLETON_STRUCT inner_puzzle_hash)
|
|
44
|
-
(puzzle-hash-of-curried-function (mod_hash_for_singleton_struct SINGLETON_STRUCT)
|
|
45
|
-
inner_puzzle_hash
|
|
46
|
-
(sha256tree1 SINGLETON_STRUCT)
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
; assembles information from the solution to create our own full ID including asserting our parent is a singleton
|
|
51
|
-
(defun create_my_ID (SINGLETON_STRUCT full_puzzle_hash parent_parent parent_inner_puzzle_hash parent_amount my_amount)
|
|
52
|
-
(sha256 (sha256 parent_parent (calculate_full_puzzle_hash SINGLETON_STRUCT parent_inner_puzzle_hash) parent_amount)
|
|
53
|
-
full_puzzle_hash
|
|
54
|
-
my_amount)
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
;; take a boolean and a non-empty list of conditions
|
|
58
|
-
;; strip off the first condition if a boolean is set
|
|
59
|
-
;; this is used to remove `(CREATE_COIN xxx -113)`
|
|
60
|
-
;; pretty sneaky, eh?
|
|
61
|
-
(defun strip_first_condition_if (boolean condition_list)
|
|
62
|
-
(if boolean
|
|
63
|
-
(r condition_list)
|
|
64
|
-
condition_list
|
|
65
|
-
)
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
(defun-inline morph_condition (condition SINGLETON_STRUCT)
|
|
69
|
-
(list (f condition) (calculate_full_puzzle_hash SINGLETON_STRUCT (f (r condition))) (f (r (r condition))))
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
;; return the value of the coin created if this is a `CREATE_COIN` condition, or 0 otherwise
|
|
73
|
-
(defun-inline created_coin_value_or_0 (condition)
|
|
74
|
-
(if (= (f condition) CREATE_COIN)
|
|
75
|
-
(f (r (r condition)))
|
|
76
|
-
0
|
|
77
|
-
)
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
;; Returns a (bool . bool)
|
|
81
|
-
(defun odd_cons_m113 (output_amount)
|
|
82
|
-
(c
|
|
83
|
-
(= (logand output_amount 1) 1) ;; is it odd?
|
|
84
|
-
(= output_amount -113) ;; is it the escape value?
|
|
85
|
-
)
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
; Assert exactly one output with odd value exists - ignore it if value is -113
|
|
89
|
-
|
|
90
|
-
;; this function iterates over the output conditions from the inner puzzle & solution
|
|
91
|
-
;; and both checks that exactly one unique singleton child is created (with odd valued output),
|
|
92
|
-
;; and wraps the inner puzzle with this same singleton wrapper puzzle
|
|
93
|
-
;;
|
|
94
|
-
;; The special case where the output value is -113 means a child singleton is intentionally
|
|
95
|
-
;; *NOT* being created, thus forever ending this singleton's existence
|
|
96
|
-
|
|
97
|
-
(defun check_and_morph_conditions_for_singleton (SINGLETON_STRUCT conditions has_odd_output_been_found)
|
|
98
|
-
(if conditions
|
|
99
|
-
(morph_next_condition SINGLETON_STRUCT conditions has_odd_output_been_found (odd_cons_m113 (created_coin_value_or_0 (f conditions))))
|
|
100
|
-
(if has_odd_output_been_found
|
|
101
|
-
0
|
|
102
|
-
(x) ;; no odd output found
|
|
103
|
-
)
|
|
104
|
-
)
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
;; a continuation of `check_and_morph_conditions_for_singleton` with booleans `is_output_odd` and `is_output_m113`
|
|
108
|
-
;; precalculated
|
|
109
|
-
(defun morph_next_condition (SINGLETON_STRUCT conditions has_odd_output_been_found (is_output_odd . is_output_m113))
|
|
110
|
-
(assert
|
|
111
|
-
(not (all is_output_odd has_odd_output_been_found))
|
|
112
|
-
(strip_first_condition_if
|
|
113
|
-
is_output_m113
|
|
114
|
-
(c (if is_output_odd
|
|
115
|
-
(morph_condition (f conditions) SINGLETON_STRUCT)
|
|
116
|
-
(f conditions)
|
|
117
|
-
)
|
|
118
|
-
(check_and_morph_conditions_for_singleton SINGLETON_STRUCT (r conditions) (any is_output_odd has_odd_output_been_found))
|
|
119
|
-
)
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
; this final stager asserts our ID
|
|
125
|
-
; it also runs the innerpuz with the innersolution with the "truths" added
|
|
126
|
-
; it then passes that output conditions from the innerpuz to the morph conditions function
|
|
127
|
-
(defun stager_three (SINGLETON_STRUCT lineage_proof my_id full_puzhash innerpuzhash my_amount INNER_PUZZLE inner_solution)
|
|
128
|
-
(c (list ASSERT_MY_COIN_ID my_id) (check_and_morph_conditions_for_singleton SINGLETON_STRUCT (a INNER_PUZZLE (c (truth_data_to_truth_struct my_id full_puzhash innerpuzhash my_amount lineage_proof SINGLETON_STRUCT) inner_solution)) 0))
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
; this checks whether we are an eve spend or not and calculates our full coin ID appropriately and passes it on to the final stager
|
|
132
|
-
; if we are the eve spend it also adds the additional checks that our parent's puzzle is the standard launcher format and that out parent ID is the same as our singleton ID
|
|
133
|
-
|
|
134
|
-
(defun stager_two (SINGLETON_STRUCT lineage_proof full_puzhash innerpuzhash my_amount INNER_PUZZLE inner_solution)
|
|
135
|
-
(stager_three
|
|
136
|
-
SINGLETON_STRUCT
|
|
137
|
-
lineage_proof
|
|
138
|
-
(if (is_not_eve_proof lineage_proof)
|
|
139
|
-
(create_my_ID
|
|
140
|
-
SINGLETON_STRUCT
|
|
141
|
-
full_puzhash
|
|
142
|
-
(parent_info_for_lineage_proof lineage_proof)
|
|
143
|
-
(puzzle_hash_for_lineage_proof lineage_proof)
|
|
144
|
-
(amount_for_lineage_proof lineage_proof)
|
|
145
|
-
my_amount
|
|
146
|
-
)
|
|
147
|
-
(if (=
|
|
148
|
-
(launcher_id_for_singleton_struct SINGLETON_STRUCT)
|
|
149
|
-
(sha256 (parent_info_for_eve_proof lineage_proof) (launcher_puzzle_hash_for_singleton_struct SINGLETON_STRUCT) (amount_for_eve_proof lineage_proof))
|
|
150
|
-
)
|
|
151
|
-
(sha256 (launcher_id_for_singleton_struct SINGLETON_STRUCT) full_puzhash my_amount)
|
|
152
|
-
(x)
|
|
153
|
-
)
|
|
154
|
-
)
|
|
155
|
-
full_puzhash
|
|
156
|
-
innerpuzhash
|
|
157
|
-
my_amount
|
|
158
|
-
INNER_PUZZLE
|
|
159
|
-
inner_solution
|
|
160
|
-
)
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
; this calculates our current full puzzle hash and passes it to stager two
|
|
164
|
-
(defun stager_one (SINGLETON_STRUCT lineage_proof my_innerpuzhash my_amount INNER_PUZZLE inner_solution)
|
|
165
|
-
(stager_two SINGLETON_STRUCT lineage_proof (calculate_full_puzzle_hash SINGLETON_STRUCT my_innerpuzhash) my_innerpuzhash my_amount INNER_PUZZLE inner_solution)
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
; main
|
|
170
|
-
|
|
171
|
-
; if our value is not an odd amount then we are invalid
|
|
172
|
-
; this calculates my_innerpuzhash and passes all values to stager_one
|
|
173
|
-
(if (logand my_amount 1)
|
|
174
|
-
(stager_one SINGLETON_STRUCT lineage_proof (sha256tree1 INNER_PUZZLE) my_amount INNER_PUZZLE inner_solution)
|
|
175
|
-
(x)
|
|
176
|
-
)
|
|
177
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ffff18ff2fffff010180ffff01ff02ff36ffff04ff02ffff04ff05ffff04ff17ffff04ffff02ff26ffff04ff02ffff04ff0bff80808080ffff04ff2fffff04ff0bffff04ff5fff808080808080808080ffff01ff088080ff0180ffff04ffff01ffffffff4602ff3304ffff0101ff02ffff02ffff03ff05ffff01ff02ff5cffff04ff02ffff04ff0dffff04ffff0bff2cffff0bff24ff3880ffff0bff2cffff0bff2cffff0bff24ff3480ff0980ffff0bff2cff0bffff0bff24ff8080808080ff8080808080ffff010b80ff0180ff02ffff03ff0bffff01ff02ff32ffff04ff02ffff04ff05ffff04ff0bffff04ff17ffff04ffff02ff2affff04ff02ffff04ffff02ffff03ffff09ff23ff2880ffff0181b3ff8080ff0180ff80808080ff80808080808080ffff01ff02ffff03ff17ff80ffff01ff088080ff018080ff0180ffffffff0bffff0bff17ffff02ff3affff04ff02ffff04ff09ffff04ff2fffff04ffff02ff26ffff04ff02ffff04ff05ff80808080ff808080808080ff5f80ff0bff81bf80ff02ffff03ffff20ffff22ff4fff178080ffff01ff02ff7effff04ff02ffff04ff6fffff04ffff04ffff02ffff03ff4fffff01ff04ff23ffff04ffff02ff3affff04ff02ffff04ff09ffff04ff53ffff04ffff02ff26ffff04ff02ffff04ff05ff80808080ff808080808080ffff04ff81b3ff80808080ffff011380ff0180ffff02ff7cffff04ff02ffff04ff05ffff04ff1bffff04ffff21ff4fff1780ff80808080808080ff8080808080ffff01ff088080ff0180ffff04ffff09ffff18ff05ffff010180ffff010180ffff09ff05ffff01818f8080ff0bff2cffff0bff24ff3080ffff0bff2cffff0bff2cffff0bff24ff3480ff0580ffff0bff2cffff02ff5cffff04ff02ffff04ff07ffff04ffff0bff24ff2480ff8080808080ffff0bff24ff8080808080ffffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff26ffff04ff02ffff04ff09ff80808080ffff02ff26ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff02ff5effff04ff02ffff04ff05ffff04ff0bffff04ffff02ff3affff04ff02ffff04ff09ffff04ff17ffff04ffff02ff26ffff04ff02ffff04ff05ff80808080ff808080808080ffff04ff17ffff04ff2fffff04ff5fffff04ff81bfff80808080808080808080ffff04ffff04ff20ffff04ff17ff808080ffff02ff7cffff04ff02ffff04ff05ffff04ffff02ff82017fffff04ffff04ffff04ff17ff2f80ffff04ffff04ff5fff81bf80ffff04ff0bff05808080ff8202ff8080ffff01ff80808080808080ffff02ff2effff04ff02ffff04ff05ffff04ff0bffff04ffff02ffff03ff3bffff01ff02ff22ffff04ff02ffff04ff05ffff04ff17ffff04ff13ffff04ff2bffff04ff5bffff04ff5fff808080808080808080ffff01ff02ffff03ffff09ff15ffff0bff13ff1dff2b8080ffff01ff0bff15ff17ff5f80ffff01ff088080ff018080ff0180ffff04ff17ffff04ff2fffff04ff5fffff04ff81bfffff04ff82017fff8080808080808080808080ff02ffff03ff05ffff011bffff010b80ff0180ff018080
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
(mod (SINGLETON_STRUCT INNER_PUZZLE lineage_proof my_amount inner_solution)
|
|
2
|
-
|
|
3
|
-
;; SINGLETON_STRUCT = (MOD_HASH . (LAUNCHER_ID . LAUNCHER_PUZZLE_HASH))
|
|
4
|
-
|
|
5
|
-
; SINGLETON_STRUCT, INNER_PUZZLE are curried in by the wallet
|
|
6
|
-
|
|
7
|
-
; EXAMPLE SOLUTION '(0xfadeddab 0xdeadbeef 1 (0xdeadbeef 200) 50 ((51 0xfadeddab 100) (60 "trash") (51 deadbeef 0)))'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
; This puzzle is a wrapper around an inner smart puzzle which guarantees uniqueness.
|
|
11
|
-
; It takes its singleton identity from a coin with a launcher puzzle which guarantees that it is unique.
|
|
12
|
-
|
|
13
|
-
(include condition_codes.clib)
|
|
14
|
-
(include curry-and-treehash.clib) ; also imports the constant ONE == 1
|
|
15
|
-
(include singleton_truths.clib)
|
|
16
|
-
(include utility_macros.clib)
|
|
17
|
-
|
|
18
|
-
(defun-inline mod_hash_for_singleton_struct (SINGLETON_STRUCT) (f SINGLETON_STRUCT))
|
|
19
|
-
(defun-inline launcher_id_for_singleton_struct (SINGLETON_STRUCT) (f (r SINGLETON_STRUCT)))
|
|
20
|
-
(defun-inline launcher_puzzle_hash_for_singleton_struct (SINGLETON_STRUCT) (r (r SINGLETON_STRUCT)))
|
|
21
|
-
|
|
22
|
-
;; return the full puzzlehash for a singleton with the innerpuzzle curried in
|
|
23
|
-
; puzzle-hash-of-curried-function is imported from curry-and-treehash.clib
|
|
24
|
-
(defun-inline calculate_full_puzzle_hash (SINGLETON_STRUCT inner_puzzle_hash)
|
|
25
|
-
(puzzle-hash-of-curried-function (mod_hash_for_singleton_struct SINGLETON_STRUCT)
|
|
26
|
-
inner_puzzle_hash
|
|
27
|
-
(sha256tree SINGLETON_STRUCT)
|
|
28
|
-
)
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
(defun-inline morph_condition (condition SINGLETON_STRUCT)
|
|
32
|
-
(c (f condition) (c (calculate_full_puzzle_hash SINGLETON_STRUCT (f (r condition))) (r (r condition))))
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
(defun is_odd_create_coin (condition)
|
|
36
|
-
(and (= (f condition) CREATE_COIN) (logand (f (r (r condition))) 1))
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
; Assert exactly one output with odd value exists - ignore it if value is -113
|
|
40
|
-
|
|
41
|
-
;; this function iterates over the output conditions from the inner puzzle & solution
|
|
42
|
-
;; and both checks that exactly one unique singleton child is created (with odd valued output),
|
|
43
|
-
;; and wraps the inner puzzle with this same singleton wrapper puzzle
|
|
44
|
-
;;
|
|
45
|
-
;; The special case where the output value is -113 means a child singleton is intentionally
|
|
46
|
-
;; *NOT* being created, thus forever ending this singleton's existence
|
|
47
|
-
|
|
48
|
-
(defun check_and_morph_conditions_for_singleton (SINGLETON_STRUCT conditions has_odd_output_been_found)
|
|
49
|
-
(if conditions
|
|
50
|
-
; check if it's an odd create coin
|
|
51
|
-
(if (is_odd_create_coin (f conditions))
|
|
52
|
-
; check that we haven't already found one
|
|
53
|
-
(assert (not has_odd_output_been_found)
|
|
54
|
-
; then
|
|
55
|
-
(if (= (f (r (r (f conditions)))) -113)
|
|
56
|
-
; If it's the melt condition we don't bother prepending this condition
|
|
57
|
-
(check_and_morph_conditions_for_singleton SINGLETON_STRUCT (r conditions) ONE)
|
|
58
|
-
; If it isn't the melt condition, we morph it and prepend it
|
|
59
|
-
(c (morph_condition (f conditions) SINGLETON_STRUCT) (check_and_morph_conditions_for_singleton SINGLETON_STRUCT (r conditions) ONE))
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
(c (f conditions) (check_and_morph_conditions_for_singleton SINGLETON_STRUCT (r conditions) has_odd_output_been_found))
|
|
63
|
-
)
|
|
64
|
-
(assert has_odd_output_been_found ())
|
|
65
|
-
)
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
; assert that either the lineage proof is for a parent singleton, or, if it's for the launcher, verify it matched our launcher ID
|
|
69
|
-
; then return a condition asserting it actually is our parent ID
|
|
70
|
-
(defun verify_lineage_proof (SINGLETON_STRUCT parent_id is_not_launcher)
|
|
71
|
-
(assert (any is_not_launcher (= parent_id (launcher_id_for_singleton_struct SINGLETON_STRUCT)))
|
|
72
|
-
; then
|
|
73
|
-
(list ASSERT_MY_PARENT_ID parent_id)
|
|
74
|
-
)
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
; main
|
|
78
|
-
|
|
79
|
-
; if our value is not an odd amount then we are invalid
|
|
80
|
-
(assert (logand my_amount ONE)
|
|
81
|
-
; then
|
|
82
|
-
(c
|
|
83
|
-
(list ASSERT_MY_AMOUNT my_amount)
|
|
84
|
-
(c
|
|
85
|
-
; Verify the lineage proof by asserting our parent's ID
|
|
86
|
-
(verify_lineage_proof
|
|
87
|
-
SINGLETON_STRUCT
|
|
88
|
-
; calculate our parent's ID
|
|
89
|
-
(calculate_coin_id
|
|
90
|
-
(parent_info_for_lineage_proof lineage_proof)
|
|
91
|
-
(if (is_not_eve_proof lineage_proof) ; The PH calculation changes based on the lineage proof
|
|
92
|
-
(calculate_full_puzzle_hash SINGLETON_STRUCT (puzzle_hash_for_lineage_proof lineage_proof)) ; wrap the innerpuz in a singleton
|
|
93
|
-
(launcher_puzzle_hash_for_singleton_struct SINGLETON_STRUCT) ; Use the static launcher puzzle hash
|
|
94
|
-
)
|
|
95
|
-
(if (is_not_eve_proof lineage_proof) ; The position of "amount" changes based on the type on lineage proof
|
|
96
|
-
(amount_for_lineage_proof lineage_proof)
|
|
97
|
-
(amount_for_eve_proof lineage_proof)
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
(is_not_eve_proof lineage_proof)
|
|
101
|
-
)
|
|
102
|
-
; finally check all of the conditions for a single odd output to wrap
|
|
103
|
-
(check_and_morph_conditions_for_singleton SINGLETON_STRUCT (a INNER_PUZZLE inner_solution) 0)
|
|
104
|
-
)
|
|
105
|
-
)
|
|
106
|
-
)
|
|
107
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ffff03ffff18ff2fff3480ffff01ff04ffff04ff20ffff04ff2fff808080ffff04ffff02ff3effff04ff02ffff04ff05ffff04ffff02ff2affff04ff02ffff04ff27ffff04ffff02ffff03ff77ffff01ff02ff36ffff04ff02ffff04ff09ffff04ff57ffff04ffff02ff2effff04ff02ffff04ff05ff80808080ff808080808080ffff011d80ff0180ffff04ffff02ffff03ff77ffff0181b7ffff015780ff0180ff808080808080ffff04ff77ff808080808080ffff02ff3affff04ff02ffff04ff05ffff04ffff02ff0bff5f80ffff01ff8080808080808080ffff01ff088080ff0180ffff04ffff01ffffffff4947ff0233ffff0401ff0102ffffff20ff02ffff03ff05ffff01ff02ff32ffff04ff02ffff04ff0dffff04ffff0bff3cffff0bff34ff2480ffff0bff3cffff0bff3cffff0bff34ff2c80ff0980ffff0bff3cff0bffff0bff34ff8080808080ff8080808080ffff010b80ff0180ffff02ffff03ffff22ffff09ffff0dff0580ff2280ffff09ffff0dff0b80ff2280ffff15ff17ffff0181ff8080ffff01ff0bff05ff0bff1780ffff01ff088080ff0180ff02ffff03ff0bffff01ff02ffff03ffff02ff26ffff04ff02ffff04ff13ff80808080ffff01ff02ffff03ffff20ff1780ffff01ff02ffff03ffff09ff81b3ffff01818f80ffff01ff02ff3affff04ff02ffff04ff05ffff04ff1bffff04ff34ff808080808080ffff01ff04ffff04ff23ffff04ffff02ff36ffff04ff02ffff04ff09ffff04ff53ffff04ffff02ff2effff04ff02ffff04ff05ff80808080ff808080808080ff738080ffff02ff3affff04ff02ffff04ff05ffff04ff1bffff04ff34ff8080808080808080ff0180ffff01ff088080ff0180ffff01ff04ff13ffff02ff3affff04ff02ffff04ff05ffff04ff1bffff04ff17ff8080808080808080ff0180ffff01ff02ffff03ff17ff80ffff01ff088080ff018080ff0180ffffff02ffff03ffff09ff09ff3880ffff01ff02ffff03ffff18ff2dffff010180ffff01ff0101ff8080ff0180ff8080ff0180ff0bff3cffff0bff34ff2880ffff0bff3cffff0bff3cffff0bff34ff2c80ff0580ffff0bff3cffff02ff32ffff04ff02ffff04ff07ffff04ffff0bff34ff3480ff8080808080ffff0bff34ff8080808080ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff2effff04ff02ffff04ff09ff80808080ffff02ff2effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff02ffff03ffff21ff17ffff09ff0bff158080ffff01ff04ff30ffff04ff0bff808080ffff01ff088080ff0180ff018080
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
(
|
|
2
|
-
(defun-inline truth_data_to_truth_struct (my_id full_puzhash innerpuzhash my_amount lineage_proof singleton_struct) (c (c my_id full_puzhash) (c (c innerpuzhash my_amount) (c lineage_proof singleton_struct))))
|
|
3
|
-
|
|
4
|
-
(defun-inline my_id_truth (Truths) (f (f Truths)))
|
|
5
|
-
(defun-inline my_full_puzzle_hash_truth (Truths) (r (f Truths)))
|
|
6
|
-
(defun-inline my_inner_puzzle_hash_truth (Truths) (f (f (r Truths))))
|
|
7
|
-
(defun-inline my_amount_truth (Truths) (r (f (r Truths))))
|
|
8
|
-
(defun-inline my_lineage_proof_truth (Truths) (f (r (r Truths))))
|
|
9
|
-
(defun-inline singleton_struct_truth (Truths) (r (r (r Truths))))
|
|
10
|
-
|
|
11
|
-
(defun-inline singleton_mod_hash_truth (Truths) (f (singleton_struct_truth Truths)))
|
|
12
|
-
(defun-inline singleton_launcher_id_truth (Truths) (f (r (singleton_struct_truth Truths))))
|
|
13
|
-
(defun-inline singleton_launcher_puzzle_hash_truth (Truths) (f (r (r (singleton_struct_truth Truths)))))
|
|
14
|
-
|
|
15
|
-
(defun-inline parent_info_for_lineage_proof (lineage_proof) (f lineage_proof))
|
|
16
|
-
(defun-inline puzzle_hash_for_lineage_proof (lineage_proof) (f (r lineage_proof)))
|
|
17
|
-
(defun-inline amount_for_lineage_proof (lineage_proof) (f (r (r lineage_proof))))
|
|
18
|
-
(defun-inline is_not_eve_proof (lineage_proof) (r (r lineage_proof)))
|
|
19
|
-
(defun-inline parent_info_for_eve_proof (lineage_proof) (f lineage_proof))
|
|
20
|
-
(defun-inline amount_for_eve_proof (lineage_proof) (f (r lineage_proof)))
|
|
21
|
-
)
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff04ffff04ffff013cffff04ff05ff808080ff0280
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
; This is an outer puzzle for a coin that imposes a restriction that the coin can only be spent with an
|
|
2
|
-
; announcement from a "verified credential" whose proofs are present due to a DID in a list of authorized providers.
|
|
3
|
-
|
|
4
|
-
; A "verified credential" is defined as the following puzzle stack:
|
|
5
|
-
; - singleton top layer
|
|
6
|
-
; |_exigent metadata layer
|
|
7
|
-
; |_eml transfer program covenant adapter
|
|
8
|
-
; | |_covenant layer
|
|
9
|
-
; | |_initial puzzle (hashed)
|
|
10
|
-
; | | |_singleton top layer
|
|
11
|
-
; | | |_exigent metadata layer
|
|
12
|
-
; | | |_(mod (_ _ (provider tp)) (list (c provider ()) tp ())) (guaranteed metadata to be nil)
|
|
13
|
-
; | | |_p2 announced delegated puzzle
|
|
14
|
-
; | |_eml covenant morpher
|
|
15
|
-
; | |_eml update metadata with DID
|
|
16
|
-
; |_<inner puzzle>
|
|
17
|
-
; The information to construct a VC is contained in a highly optimized way within CREDENTIAL_STRUCT
|
|
18
|
-
;
|
|
19
|
-
; This puzzle does many things:
|
|
20
|
-
; - Tree hash of a partially revealed tree to come to a proof hash present in the accompanying VC singleton
|
|
21
|
-
; - Validate the revealed proofs with a curried proofs checker
|
|
22
|
-
; - Assert an announcement from a VC with a message of 0xca which signals this spend is ok
|
|
23
|
-
; - Wrap all of its children in this layer
|
|
24
|
-
; - Create an announcement in the 0xcd namespace of each output it is creating (for a VC to assert if it wishes)
|
|
25
|
-
; - Block any announcements coming from the inner puzzle in the 0xcd namespace
|
|
26
|
-
(mod
|
|
27
|
-
(
|
|
28
|
-
; We curry twice: first, all of the static information we need, then the hash of the program with all of that info
|
|
29
|
-
; this allows use to be more efficient when calculating our own hash (a (q . SELF_HASH) (c SELF_HASH (x INNER_PUZZLE 1)))
|
|
30
|
-
; curried first
|
|
31
|
-
CREDENTIAL_STRUCT
|
|
32
|
-
AUTHORIZED_PROVIDERS
|
|
33
|
-
PROOFS_CHECKER
|
|
34
|
-
; curried second
|
|
35
|
-
SELF_HASH
|
|
36
|
-
INNER_PUZZLE
|
|
37
|
-
proof_of_inclusions ; Proof that key/value pairs exist in a tree (the root of the tree is implicit from this)
|
|
38
|
-
proof_checker_solution ; solution to PROOFS_CHECKER program
|
|
39
|
-
provider_id ; the DID that is curried into the metadata of the VC that is authorizing this coin
|
|
40
|
-
credential_id ; the launcher ID of the VC that is authorizing this coin
|
|
41
|
-
credential_inner_puzhash ; The <inner puzzle> (see above) of the VC that is authorizing this coin
|
|
42
|
-
my_coin_id ; This coin's ID
|
|
43
|
-
inner_solution
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
(include curry.clib)
|
|
47
|
-
(include condition_codes.clib)
|
|
48
|
-
(include utility_macros.clib)
|
|
49
|
-
|
|
50
|
-
; take two lists and merge them into one
|
|
51
|
-
(defun merge_list (list_a list_b)
|
|
52
|
-
(if list_a
|
|
53
|
-
(c (f list_a) (merge_list (r list_a) list_b))
|
|
54
|
-
list_b
|
|
55
|
-
)
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
(defconstant announcement_namespace 0xcd)
|
|
59
|
-
(defconstant ONE 1)
|
|
60
|
-
|
|
61
|
-
(defun-inline wrap_puzhash
|
|
62
|
-
(
|
|
63
|
-
SELF_HASH
|
|
64
|
-
puzhash
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
(curry_hashes SELF_HASH
|
|
68
|
-
(sha256 ONE SELF_HASH)
|
|
69
|
-
puzhash
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
; Does three things:
|
|
74
|
-
; 1) Wraps create coins with this layer
|
|
75
|
-
; 2) Announces those create coins in a namespace
|
|
76
|
-
; 3) Raises on announcements from the inner puzzle that could possibly be in the namespace
|
|
77
|
-
(defun process_conditions
|
|
78
|
-
(
|
|
79
|
-
SELF_HASH
|
|
80
|
-
conditions
|
|
81
|
-
)
|
|
82
|
-
(if conditions
|
|
83
|
-
(if (= (f (f conditions)) CREATE_COIN)
|
|
84
|
-
(c
|
|
85
|
-
(list
|
|
86
|
-
CREATE_COIN_ANNOUNCEMENT
|
|
87
|
-
(concat
|
|
88
|
-
announcement_namespace
|
|
89
|
-
(sha256 (f (r (f conditions))) (f (r (r (f conditions)))))
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
(c
|
|
93
|
-
(c
|
|
94
|
-
CREATE_COIN
|
|
95
|
-
(c
|
|
96
|
-
(wrap_puzhash SELF_HASH (f (r (f conditions))))
|
|
97
|
-
(r (r (f conditions)))
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
(process_conditions SELF_HASH (r conditions))
|
|
101
|
-
)
|
|
102
|
-
)
|
|
103
|
-
; else - not a create coin
|
|
104
|
-
(assert (or
|
|
105
|
-
(not (= (f (f conditions)) CREATE_COIN_ANNOUNCEMENT)) ; some coin announcements should be blocked
|
|
106
|
-
(not (= 33 (strlen (f (r (f conditions)))))) ; we only care about blocking 0xcd + some_hash
|
|
107
|
-
(not (= announcement_namespace (substr (f (r (f conditions))) 0 ONE))) ; block prefix 0xcd
|
|
108
|
-
)
|
|
109
|
-
; then
|
|
110
|
-
(c
|
|
111
|
-
(f conditions)
|
|
112
|
-
(process_conditions SELF_HASH (r conditions))
|
|
113
|
-
)
|
|
114
|
-
)
|
|
115
|
-
)
|
|
116
|
-
; else - end of list
|
|
117
|
-
()
|
|
118
|
-
)
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
(defun create_vc_puzhash_stage_2
|
|
122
|
-
(
|
|
123
|
-
(
|
|
124
|
-
(
|
|
125
|
-
(
|
|
126
|
-
SINGLETON_MOD_HASH
|
|
127
|
-
.
|
|
128
|
-
SINGLETON_LAUNCHER_HASH
|
|
129
|
-
)
|
|
130
|
-
.
|
|
131
|
-
(
|
|
132
|
-
OWNERSHIP_LAYER_MOD_HASH
|
|
133
|
-
.
|
|
134
|
-
ADAPTER_MOD_HASH
|
|
135
|
-
)
|
|
136
|
-
)
|
|
137
|
-
.
|
|
138
|
-
(
|
|
139
|
-
INITIAL_SINGLETON_INNER_PUZHASH
|
|
140
|
-
.
|
|
141
|
-
(
|
|
142
|
-
TWO_AND_COVENANT_MOD_HASH ; (concat 2 COVENANT_MOD_HASH)
|
|
143
|
-
.
|
|
144
|
-
REST_COVENANT_ARGS_HASH ; ((c PARENT_MORPHER (c EML_DID_TP 1)) . ()) hashed
|
|
145
|
-
)
|
|
146
|
-
)
|
|
147
|
-
)
|
|
148
|
-
provider_id
|
|
149
|
-
credential_singleton_struct_hash
|
|
150
|
-
proof_hash
|
|
151
|
-
credential_inner_puzhash
|
|
152
|
-
tp_hash
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
(curry_hashes SINGLETON_MOD_HASH
|
|
156
|
-
credential_singleton_struct_hash
|
|
157
|
-
(curry_hashes OWNERSHIP_LAYER_MOD_HASH
|
|
158
|
-
(sha256 ONE OWNERSHIP_LAYER_MOD_HASH)
|
|
159
|
-
(sha256 TWO
|
|
160
|
-
(sha256 ONE provider_id)
|
|
161
|
-
(sha256 ONE proof_hash)
|
|
162
|
-
)
|
|
163
|
-
tp_hash
|
|
164
|
-
(sha256 ONE tp_hash)
|
|
165
|
-
credential_inner_puzhash
|
|
166
|
-
)
|
|
167
|
-
)
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
(defun create_vc_puzhash
|
|
171
|
-
(
|
|
172
|
-
CREDENTIAL_STRUCT
|
|
173
|
-
provider_id
|
|
174
|
-
credential_singleton_struct_hash
|
|
175
|
-
proof_hash
|
|
176
|
-
credential_inner_puzhash
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
(create_vc_puzhash_stage_2
|
|
180
|
-
CREDENTIAL_STRUCT
|
|
181
|
-
provider_id
|
|
182
|
-
credential_singleton_struct_hash
|
|
183
|
-
proof_hash
|
|
184
|
-
credential_inner_puzhash
|
|
185
|
-
(curry_hashes (r (r (f CREDENTIAL_STRUCT))) ; ADAPTER_MOD_HASH
|
|
186
|
-
(sha256
|
|
187
|
-
; apply
|
|
188
|
-
(two_sha256_one_a_kw)
|
|
189
|
-
(sha256
|
|
190
|
-
; func
|
|
191
|
-
(f (r (r CREDENTIAL_STRUCT))) ; TWO_AND_COVENANT_MOD_HASH
|
|
192
|
-
(sha256 TWO
|
|
193
|
-
; args
|
|
194
|
-
(sha256
|
|
195
|
-
(two_sha256_one_c_kw)
|
|
196
|
-
(sha256 TWO
|
|
197
|
-
(sha256 TWO
|
|
198
|
-
(sha256_one_one)
|
|
199
|
-
(sha256 ONE (curry_hashes (f (f (f CREDENTIAL_STRUCT))) ; SINGLETON_MOD_HASH
|
|
200
|
-
credential_singleton_struct_hash
|
|
201
|
-
(f (r CREDENTIAL_STRUCT)) ; INITIAL_SINGLETON_INNER_PUZHASH
|
|
202
|
-
))
|
|
203
|
-
)
|
|
204
|
-
(r (r (r CREDENTIAL_STRUCT))) ; REST_COVENANT_ARGS_HASH
|
|
205
|
-
)
|
|
206
|
-
)
|
|
207
|
-
(sha256_one)
|
|
208
|
-
)
|
|
209
|
-
)
|
|
210
|
-
)
|
|
211
|
-
)
|
|
212
|
-
)
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
; utility function that turns the output of two calls to collapse_tree_and_note_leaf_info into a single return value
|
|
216
|
-
(defun branch_hash_and_merge_info ((TREE1 PROOFS1) (TREE2 PROOFS2))
|
|
217
|
-
(list
|
|
218
|
-
(sha256 TWO TREE1 TREE2)
|
|
219
|
-
(merge_list PROOFS1 PROOFS2)
|
|
220
|
-
)
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
(defun collapse_tree_and_note_leaf_info (TREE PROOFS)
|
|
224
|
-
(if (l TREE)
|
|
225
|
-
(if (or (l (f TREE)) (l (r TREE))) ; If either side is a cons, we have not reached a leaf pair yet
|
|
226
|
-
(branch_hash_and_merge_info
|
|
227
|
-
(collapse_tree_and_note_leaf_info (f TREE) ())
|
|
228
|
-
; we favor right because merge_list merges from left
|
|
229
|
-
(collapse_tree_and_note_leaf_info (r TREE) PROOFS)
|
|
230
|
-
)
|
|
231
|
-
; else - both first and rest are atoms, we are at a key/value pair
|
|
232
|
-
(branch_hash_and_merge_info
|
|
233
|
-
(list (sha256 ONE (f TREE)) ())
|
|
234
|
-
(list (sha256 ONE (r TREE)) (c TREE PROOFS))
|
|
235
|
-
)
|
|
236
|
-
)
|
|
237
|
-
(list TREE PROOFS) ; All atoms that we reach must be pre-hashed subtrees
|
|
238
|
-
)
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
(defun main
|
|
242
|
-
(
|
|
243
|
-
CREDENTIAL_STRUCT
|
|
244
|
-
AUTHORIZED_PROVIDERS
|
|
245
|
-
PROOFS_CHECKER
|
|
246
|
-
SELF_HASH
|
|
247
|
-
proof_checker_solution
|
|
248
|
-
provider_id
|
|
249
|
-
credential_id
|
|
250
|
-
credential_inner_puzhash
|
|
251
|
-
my_coin_id
|
|
252
|
-
conditions
|
|
253
|
-
(tree_hash proofs)
|
|
254
|
-
)
|
|
255
|
-
|
|
256
|
-
(assert
|
|
257
|
-
; Run proof checker to make sure it doesn't return () (fail)
|
|
258
|
-
(a PROOFS_CHECKER (list proofs proof_checker_solution))
|
|
259
|
-
(in provider_id AUTHORIZED_PROVIDERS) ; VC needs to be in authorized list
|
|
260
|
-
; then
|
|
261
|
-
(c
|
|
262
|
-
(list ASSERT_MY_COIN_ID my_coin_id)
|
|
263
|
-
(c
|
|
264
|
-
(list ASSERT_PUZZLE_ANNOUNCEMENT
|
|
265
|
-
(sha256
|
|
266
|
-
(create_vc_puzhash
|
|
267
|
-
CREDENTIAL_STRUCT
|
|
268
|
-
provider_id
|
|
269
|
-
(sha256 TWO
|
|
270
|
-
(sha256 ONE (f (f (f CREDENTIAL_STRUCT)))) ; SINGLETON_MOD_HASH
|
|
271
|
-
(sha256 TWO
|
|
272
|
-
(sha256 ONE credential_id)
|
|
273
|
-
(sha256 ONE (r (f (f CREDENTIAL_STRUCT)))) ; SINGLETON_LAUNCHER_HASH
|
|
274
|
-
)
|
|
275
|
-
)
|
|
276
|
-
tree_hash
|
|
277
|
-
credential_inner_puzhash
|
|
278
|
-
)
|
|
279
|
-
(sha256 my_coin_id 0xca) ; my_coin_id because VC must announce specifically to us
|
|
280
|
-
)
|
|
281
|
-
)
|
|
282
|
-
(process_conditions
|
|
283
|
-
SELF_HASH
|
|
284
|
-
conditions
|
|
285
|
-
)
|
|
286
|
-
)
|
|
287
|
-
)
|
|
288
|
-
)
|
|
289
|
-
)
|
|
290
|
-
|
|
291
|
-
(main
|
|
292
|
-
CREDENTIAL_STRUCT
|
|
293
|
-
AUTHORIZED_PROVIDERS
|
|
294
|
-
PROOFS_CHECKER
|
|
295
|
-
SELF_HASH
|
|
296
|
-
proof_checker_solution
|
|
297
|
-
provider_id
|
|
298
|
-
credential_id
|
|
299
|
-
credential_inner_puzhash
|
|
300
|
-
my_coin_id
|
|
301
|
-
(a INNER_PUZZLE inner_solution)
|
|
302
|
-
(collapse_tree_and_note_leaf_info proof_of_inclusions ())
|
|
303
|
-
)
|
|
304
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ff02ffff01ff02ff2effff04ff02ffff04ff05ffff04ff0bffff04ff17ffff04ff2fffff04ff82017fffff04ff8202ffffff04ff8205ffffff04ff820bffffff04ff8217ffffff04ffff02ff5fff822fff80ffff04ffff02ff22ffff04ff02ffff04ff81bfffff01ff8080808080ff8080808080808080808080808080ffff04ffff01ffffffff463fff333cffff0102ff81cdffff04ffff0bff34ff09ff1380ffff04ffff02ff5effff04ff02ffff04ff15ffff04ff2bff8080808080ff808080ff02ffff03ff05ffff01ff0bff81f2ffff02ff26ffff04ff02ffff04ff09ffff04ffff02ff7cffff04ff02ffff04ff0dff80808080ff808080808080ffff0181d280ff0180ffffffff02ffff03ffff07ff0580ffff01ff02ffff03ffff02ffff03ffff07ff0980ffff01ff0101ffff01ff02ffff03ffff07ff0d80ffff01ff0101ff8080ff018080ff0180ffff01ff02ff5cffff04ff02ffff04ffff02ff22ffff04ff02ffff04ff09ffff01ff8080808080ffff04ffff02ff22ffff04ff02ffff04ff0dffff04ff0bff8080808080ff8080808080ffff01ff02ff5cffff04ff02ffff04ffff04ffff0bff24ff0980ffff01ff808080ffff04ffff04ffff0bff24ff0d80ffff04ffff04ff05ff0b80ff808080ff808080808080ff0180ffff01ff04ff05ffff04ff0bff80808080ff0180ffffa04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459aa09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ffa102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222a102a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c5ffff02ff5affff04ff02ffff04ff05ffff04ff0bffff04ff17ffff04ff2fffff04ff5fffff04ffff02ff7affff04ff02ffff04ff39ffff04ffff0bff81b2ffff0bff2dffff0bff34ffff0bff81f2ffff0bff34ffff0bff34ff81d2ffff0bff24ffff02ff7affff04ff02ffff04ff21ffff04ff17ffff04ff15ff8080808080808080ff3d8080ff8192808080ff8080808080ff808080808080808080ffff02ff7affff04ff02ffff04ff21ffff04ff17ffff04ffff02ff7affff04ff02ffff04ff29ffff04ffff0bff24ff2980ffff04ffff0bff34ffff0bff24ff0b80ffff0bff24ff2f8080ffff04ff81bfffff04ffff0bff24ff81bf80ffff04ff5fff808080808080808080ff808080808080ff0bff81b2ffff02ff26ffff04ff02ffff04ff05ffff04ffff02ff7cffff04ff02ffff04ff07ff80808080ff808080808080ffffff0bff34ffff0bff34ff81d2ff0580ffff0bff34ff0bff81928080ff02ffff03ff0bffff01ff03ffff09ff05ff1380ffff0101ffff02ff36ffff04ff02ffff04ff05ffff04ff1bff808080808080ff8080ff0180ffff02ffff03ffff02ff17ffff04ff8257ffffff04ff5fff80808080ffff01ff02ffff03ffff02ff36ffff04ff02ffff04ff81bfffff04ff0bff8080808080ffff01ff04ffff04ff20ffff04ff8205ffff808080ffff04ffff04ff30ffff04ffff0bffff02ff2affff04ff02ffff04ff05ffff04ff81bfffff04ffff0bff34ffff0bff24ff2180ffff0bff34ffff0bff24ff82017f80ffff0bff24ff31808080ffff04ff8227ffffff04ff8202ffff8080808080808080ffff0bff8205ffffff0181ca8080ff808080ffff02ff7effff04ff02ffff04ff2fffff04ff820bffff80808080808080ffff01ff088080ff0180ffff01ff088080ff0180ffff02ffff03ff05ffff01ff04ff09ffff02ff5effff04ff02ffff04ff0dffff04ff0bff808080808080ffff010b80ff0180ff02ffff03ff0bffff01ff02ffff03ffff09ff23ff2880ffff01ff04ffff04ff38ffff04ffff0eff2cffff0bff53ff81b38080ff808080ffff04ffff04ff28ffff04ffff02ff7affff04ff02ffff04ff05ffff04ffff0bff24ff0580ffff04ff53ff808080808080ff738080ffff02ff7effff04ff02ffff04ff05ffff04ff1bff80808080808080ffff01ff02ffff03ffff02ffff03ffff20ffff09ff23ff388080ffff01ff0101ffff01ff02ffff03ffff20ffff09ffff0121ffff0dff53808080ffff01ff0101ffff01ff02ffff03ffff20ffff09ff2cffff0cff53ff80ff24808080ffff01ff0101ff8080ff018080ff018080ff0180ffff01ff04ff13ffff02ff7effff04ff02ffff04ff05ffff04ff1bff808080808080ffff01ff088080ff018080ff0180ff8080ff0180ff018080
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
; This is a PROOFS_CHECKER for use with credential_restriction.clsp
|
|
2
|
-
;
|
|
3
|
-
; In an attempt to be as simple as possible, this puzzle is curried a list of key/value pairs sorted by keys. This sort
|
|
4
|
-
; is crucial to the program functioning as the key/value pairs of the proofs will be sorted before being compared to
|
|
5
|
-
; the curried list.
|
|
6
|
-
(mod
|
|
7
|
-
(
|
|
8
|
-
FLAGS ; must be sorted
|
|
9
|
-
proofs ; will be sorted
|
|
10
|
-
solution ; unused
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
(include utility_macros.clib)
|
|
14
|
-
|
|
15
|
-
(defun insertion_sort_by_keys (sorted insertions)
|
|
16
|
-
(if insertions
|
|
17
|
-
(if (or (not sorted) (>s (f (f insertions)) (f (f sorted))))
|
|
18
|
-
(insertion_sort_by_keys (c (f insertions) sorted) (r insertions))
|
|
19
|
-
(insertion_sort_by_keys (c (f sorted) (insertion_sort_by_keys (r sorted) (list (f insertions)))) (r insertions))
|
|
20
|
-
)
|
|
21
|
-
sorted
|
|
22
|
-
)
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
(defun merge_insertion_sort (proofs)
|
|
26
|
-
(if (r proofs)
|
|
27
|
-
(insertion_sort_by_keys (merge_insertion_sort (r proofs)) (merge_insertion_sort (list (f proofs))))
|
|
28
|
-
proofs
|
|
29
|
-
)
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
; This function checks that the revealed proofs START WITH the same key/value pairs as are in FLAGS. This is not for
|
|
33
|
-
; any particular reason except optimization. We don't really care if EXTRA proof pairs are revealed.
|
|
34
|
-
(defun compare_first_pairs_against_flags (subject comp)
|
|
35
|
-
(if subject
|
|
36
|
-
(if (logand (= (f (f subject)) (f (f comp))) (= (r (f subject)) (r (f comp))))
|
|
37
|
-
(compare_first_pairs_against_flags (r subject) (r comp))
|
|
38
|
-
()
|
|
39
|
-
)
|
|
40
|
-
1
|
|
41
|
-
)
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
(compare_first_pairs_against_flags FLAGS (merge_insertion_sort proofs))
|
|
45
|
-
)
|