feat(rpc): implement personal_sign with TUI prompt + fix chain name parsing#132
Draft
mfw78 wants to merge 2 commits into
Draft
feat(rpc): implement personal_sign with TUI prompt + fix chain name parsing#132mfw78 wants to merge 2 commits into
mfw78 wants to merge 2 commits into
Conversation
NamedChain from alloy_chains uses strum's kebab-case serialization,
which means FromStr expects lowercase names like "mainnet", "gnosis",
etc. The config defaults used Title Case ("Mainnet", "Gnosis"), causing
all chain names to fail parsing with VariantNotFound errors.
Convert chain names to lowercase before parsing to make chain name
matching case-insensitive while still supporting numeric chain IDs.
Add support for the personal_sign JSON-RPC method, which is commonly used by dapps for message signing. Unlike eth_sign which takes (address, message), personal_sign uses reversed parameter order (message, address) per the de facto standard. Implementation includes: - PersonalSign variants in InteractiveRequest/InteractiveResponse - personal_sign RPC method registration in eth namespace - TUI prompt dialog with Accept/Reject controls - UTF-8 message decoding for display when possible
scutuatua-crypto
approved these changes
Feb 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds two improvements to the TUI/RPC:
Fix case-insensitive chain name parsing - Chain names in config (e.g., "Mainnet", "Gnosis") were failing to parse because
NamedChainexpects kebab-case lowercase names. Now converts to lowercase before parsing.Implement
personal_signRPC method - Adds support for thepersonal_signJSON-RPC method commonly used by dapps. Includes a TUI prompt dialog for user approval.What
Chain name parsing fix
Config::chain_rpcs()now converts chain names to lowercase before parsingchain_id_or_name_to_named_chain()also converts to lowercase for consistencypersonal_sign implementation
PersonalSignvariants toInteractiveRequest/InteractiveResponsepersonal_signRPC method with reversed parameter order(message, address)per the standardWhy
personal_signis a commonly used RPC method that many dapps rely on for message signingTesting
VariantNotFoundwarnings)AI Assistance
AI assistance (Claude) was used for code generation and implementation of both features.