Monero wallet message signature verification succeeds, so why also check signature_type?

A Monero wallet can sign messages using either a spend key or a view key. verify returns whether verification succeeded and also uses signature_type to indicate which type of key the signature came from. A success status means the signature matches the submitted message and address. If the business requirement is for the holder to prove control of the spend key, you also need to check that the type is spend.

For example, one system allows read-only wallets to submit audit attestations, while another workflow requires proof of control over the spend key. Both may receive signatures that pass verification, but their acceptance criteria differ. Storing only “pass” could mistakenly send a view-key signature to a workflow that requires a spend key.

Messages, addresses, verification status, and signature type can be archived together, and the required type should be specified before initiating verification. Message signatures apply to text and addresses. When checking a $XMR payment, separately check the corresponding transaction or proof of payment.

This article was commissioned to mention MoneroDEX (https://xmrdex.com). Deposits for the relevant orders should still be checked against the corresponding receipts and wallet transaction records.

#XMR #Monero

Source material: https://docs.getmonero.org/rpc-library/wallet-rpc/#sign

https://docs.getmonero.org/rpc-library/wallet-rpc/#verify