Call the openSignatureRequestPopup function provided by the @stacks/connect package to trigger the display of the message signing prompt:
All of the methods included on this page accept a network option. By default, Connect uses a testnet network option. You can import a network configuration from the @stacks/network package:
Several parameters are available for calling openSignatureRequestPopup:
The openSignatureRequestPopup method from @stacks/connect allows you to specify an onFinish callback. This callback will be triggered after the user has successfully signed the message.
You can get the signature of the message via the arguments passed to onFinish. Your callback will be fired with a single data argument:
When you verify a signature, you're confirming that the message was indeed created by the claimed sender and that it hasn't been altered since it was signed. To do this, use the verifyMessageSignatureRsv function from the @stacks/encryption package: