[LABS-305] Extract signing functionality from wallet RPC to its own library #20317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the signing logic that was previously only accessible from the RPC into its own library. This minimizes the RPC logic and also provides this functionality to other wallet areas potentially.
(it also adds tests for the previously untested
sign_message_by_id)Note
Extracts message signing/verification into a shared util and refactors RPC and wallets to use it; adds tests for signing by NFT ID and address.
chia/wallet/util/signing.pywithsign_message()andverify_signature().sign_messagemethods fromWallet,DIDWallet, andNFTWallet; add helpers likeconvert_secret_key_to_synthetic()andcurrent_p2_puzzle_hash().wallet_rpc_api.py: delegateverify_signature,sign_message_by_address, andsign_message_by_idto new signing util; simplify key retrieval and signing flow.wallet_request_types.py: addsigning_mode_enumhelpers and properties; extend request/response types for signing.test_sign_message_by_nft_id(NFT signing across modes) andtest_sign_message_by_address.Written by Cursor Bugbot for commit 3d85e99. This will update automatically on new commits. Configure here.