title: how to verify the signature of a message in phantom solana?
body: <p>I am trying to authenticate phantom wallet by signing it with a message I used below code to sign the message and it returns me a signature how can I verify that signature in the backend.</p>
  <pre><code>    const encodedMessage = new TextEncoder().encode(&quot;Message to sign&quot;);
      const signedMessage = await window.solana.request({
        method: &quot;signMessage&quot;,
        params: {
          message: encodedMessage,
          display: &quot;utf8&quot;, //hex,utf8
        },
      });
  </code></pre>
  <p>Here signed Message responds with this answer with publickey and a signature</p>
  <pre><code>{
      &quot;publicKey&quot;: &quot;Gy4xSKsLHXScRMVZgKt5f6BvDawp1JW8PrenA3GbakCK&quot;,
      &quot;signature&quot;: &quot;5BoNFSoV9WEafBnXon2ujPzH5zgjwZkXHL9vkHuUHEnc1AqLSN38LEx5XtAz68JFEt9RhvuhmPL3GkMPdMcQPuzN&quot;
  }
  </code></pre>