# Sign message

Request a message signature on the wallet's Ethereum provider. Openfort's `useSignMessage` opens a confirmation screen showing exactly what's being signed, then resolves with the signature — no gas, no transaction. Try it live on the [UI configuration](/docs/products/embedded-wallet/react/ui/configuration#sign-message) page.

## Personal sign

:::info
This method uses Ethereum’s `personal_sign` RPC method.
:::

```tsx [SignMessage.tsx]
import { useSignMessage } from 'wagmi'

function SignMessage() {
  const { signMessage, data: signature, isPending, error } = useSignMessage()

  return (
    <div>
      <button
        onClick={() => signMessage({ message: 'Hello World' })}
        disabled={isPending}
      >
        {isPending ? 'Signing...' : 'Sign Message'}
      </button>

      {signature && <p>Signature: {signature}</p>}
      {error && <p>Error: {error.message}</p>}
    </div>
  )
}
```

:::info
Smart and Delegated accounts use [EIP-1271](https://eips.ethereum.org/EIPS/eip-1271) for
signature verification. The wagmi hooks are identical — the SDK handles the difference under the hood.
:::

## Typed data — EIP-712

Use `useSignTypedData` for structured, domain-separated signatures:

```tsx [SignTypedData.tsx]
import { useSignTypedData } from 'wagmi'

function SignTypedData() {
  const { signTypedData, data: signature, isPending, error } = useSignTypedData()

  const handleSign = () => {
    signTypedData({
      domain: {
        chainId: 1,
        name: 'Example DApp',
        verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
        version: '1',
      },
      types: {
        Mail: [
          { name: 'from', type: 'Person' },
          { name: 'to', type: 'Person' },
          { name: 'content', type: 'string' },
        ],
        Person: [
          { name: 'name', type: 'string' },
          { name: 'wallet', type: 'address' },
        ],
      },
      message: {
        from: { name: 'Alice', wallet: '0x2111111111111111111111111111111111111111' },
        to: { name: 'Bob', wallet: '0x3111111111111111111111111111111111111111' },
        content: 'Hello!',
      },
      primaryType: 'Mail',
    })
  }

  return (
    <div>
      <button onClick={handleSign} disabled={isPending}>
        {isPending ? 'Signing...' : 'Sign Typed Data'}
      </button>

      {signature && <p>Signature: {signature}</p>}
      {error && <p>Error: {error.message}</p>}
    </div>
  )
}
```
