> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign Messages with Solana Libraries

> Sign text and binary messages using Solana Web3.js or Anchor with Para

Sign messages to prove ownership of a Solana address without submitting a transaction. This is commonly used for authentication and verification purposes.

<Card title="Setup Solana Libraries First" description="Configure Solana libraries with Para SDK before using these operations" href="/v3/react-native/guides/web3-operations/solana/setup-libraries" horizontal />

<Tabs>
  <Tab title="@solana/kit">
    ```typescript theme={null}
    import { useParaSolanaSigner } from "@getpara/react-native-wallet/solana";
    import { createSolanaRpc } from '@solana/kit';
    import { getUtf8Encoder } from '@solana/codecs-strings';
    import bs58 from 'bs58';

    const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");

    function SignMessage() {
      const { solanaSigner, isLoading } = useParaSolanaSigner({ rpc });

      const signMessage = async () => {
        if (!solanaSigner) return;

        const message = "Hello, Solana!";
        const messageBytes = new Uint8Array(getUtf8Encoder().encode(message));

        const signatureResult = await solanaSigner.signMessages([
          { content: messageBytes, signatures: {} }
        ]);

        const signatureBytes = signatureResult[0][solanaSigner.address];
        const signatureBase58 = bs58.encode(signatureBytes);

        return { message, signature: signatureBase58, signer: solanaSigner.address };
      };

      return <button onClick={signMessage}>Sign Message</button>;
    }
    ```
  </Tab>

  <Tab title="@solana/web3.js">
    ```typescript theme={null}
    import { useParaSolana } from './hooks/useParaSolana';
    import bs58 from 'bs58';

    function SignMessage() {
      const { signer } = useParaSolana();

      const signMessage = async () => {
        if (!signer) {
          console.error("No signer available. Connect wallet first.");
          return;
        }

        const message = "Hello, Solana!";
        const messageBytes = new TextEncoder().encode(message);

        const signature = await signer.signBytes(Buffer.from(messageBytes));
        const signatureBase58 = bs58.encode(signature);

        console.log("Message:", message);
        console.log("Signature:", signatureBase58);
        console.log("Signer:", signer.address);
      };

      return <button onClick={signMessage}>Sign Message</button>;
    }
    ```
  </Tab>

  <Tab title="Anchor">
    ```typescript theme={null}
    import { useParaAnchor } from './hooks/useParaAnchor';
    import { useParaSolana } from './hooks/useParaSolana';
    import bs58 from 'bs58';

    function SignMessage() {
      const provider = useParaAnchor();
      const { signer } = useParaSolana();

      const signMessage = async () => {
        if (!signer) {
          console.error("No signer available. Connect wallet first.");
          return;
        }

        const message = "Hello, Anchor!";
        const messageBytes = new TextEncoder().encode(message);

        const signature = await signer.signBytes(Buffer.from(messageBytes));
        const signatureBase58 = bs58.encode(signature);

        console.log("Message:", message);
        console.log("Signature:", signatureBase58);
        console.log("Signer:", provider.wallet.publicKey.toString());
      };

      return <button onClick={signMessage}>Sign Message</button>;
    }
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={3}>
  <Card title="Verify Signatures" description="Verify signed messages on-chain" href="/v3/react-native/guides/web3-operations/solana/verify-signatures" icon="shield-check" />

  <Card title="Execute Transactions" description="Sign and send transactions" href="/v3/react-native/guides/web3-operations/solana/execute-transactions" icon="paper-plane" />

  <Card title="Configure RPC" description="Set up custom RPC endpoints" href="/v3/react-native/guides/web3-operations/solana/configure-rpc" icon="server" />
</CardGroup>
