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

# Sign and verify

> Sign plain messages and EIP-712 typed data from a Server Wallet, with each signature verified against the wallet before it is returned.

Signing produces a signature without submitting a transaction. Both signing methods verify the result against the wallet before returning it, so a signature you receive has already been checked.

Signing requires an active wallet and uses the same idempotency IDs as [transfers](/wallets/sdk/server/transfers).

## Sign a plain message

```typescript theme={null}
const operationId = crypto.randomUUID()

const operation = await wallet.signMessage(operationId, 137, 'Hello OMS')

console.log('Signature:', operation.signature)
console.log('Verified:', operation.verified)
```

The operation returns with status `signed`. `signature` holds the hex signature and `verified` reports the wallet-aware verification result.

## Sign typed data

```typescript theme={null}
const operation = await wallet.signTypedData(operationId, 137, {
  domain: { name: 'Example', version: '1', chainId: 137 },
  types: {
    Order: [
      { name: 'asset', type: 'address' },
      { name: 'amount', type: 'uint256' },
    ],
  },
  primaryType: 'Order',
  message: {
    asset: '0x1111111111111111111111111111111111111111',
    amount: '1000000',
  },
})
```

`signTypedData` validates the EIP-712 domain and data before signing, then verifies the signature against the wallet. Invalid domains, unknown types, and values that do not match their declared types are rejected rather than signed.

## Treat typed-data signing as an authorization

The SDK validates that typed data is well formed. It cannot judge what a given payload authorizes, and that remains your responsibility.

<Warning>
  Do not expose `signTypedData` as a general-purpose endpoint that signs caller-supplied payloads. A signature over attacker-chosen typed data can authorize transfers, approvals, or contract calls that your application never intended. Construct the payload in your backend from values you control.
</Warning>

Continue with [balances](/wallets/sdk/server/balances) for reads that need no active wallet.
