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

# Raw Signing (EVM)

> [card] Recommended: JavaScript SDK for React Native
>
> While this SDK is still supported, we recommend using newer [JavaScript SDK](https://docs.dynamic.xyz/docs/javascript/reference/react-native-quickstart.md), which is optimized for React Native, but also comes with a host of other benefits.

`signRawMessage` lets you sign a digest exactly as you supply it, with no prefixing or re-hashing by the SDK. Use it when you need full control over hashing and formatting — non-standard signing flows, or chain/app-specific message formats.

> [!NOTE]
>
> **`signRawMessage` is EVM-specific, and EVM is the only wallet that needs it.** On EVM, `signMessage` follows [ERC-191](https://eips.ethereum.org/EIPS/eip-191): it prefixes your input with `\x19Ethereum Signed Message:\n<length>` before hashing. `signRawMessage` exists to bypass that prefix.
>
> On Ed25519 chains there is no prefix to bypass — `signMessage` already produces a raw signature over the exact bytes you pass. To sign transaction digests for Solana, or for any chain derived from the Solana wallet, use `signMessage` and see the [Tier 2 and 3 chains technical overview](https://docs.dynamic.xyz/docs/react-native/chains/tier-2-chains/overview.md).

> [!WARNING]
>
> Raw signing is denied on any wallet that carries policy rules. See [Raw signing](https://docs.dynamic.xyz/docs/embedded-wallets/mpc/policies/overview.md#raw-signing) in the policies overview for how policies interact with raw signing.

## Basic raw signing (hash then sign)

Call `signRawMessage` on the WaaS client with a pre-hashed payload. See [Sign Raw Messages](https://docs.dynamic.xyz/docs/react-native/reference/wallets/embedded-wallets.md#sign-raw-messages) for the full hook-based example.

## Encoding options

Dynamic supports different encoding formats for your raw messages depending on what you need to hash/sign.

### Hexadecimal encoding

Most common for blockchain applications. The message is encoded as a hex string.

### UTF-8 text encoding

For plain text messages that don't require hex encoding.

```text theme={"system"}
Hello World
```

## Hash functions

Different hash functions serve different purposes in cryptographic signing.

### Keccak256 (Ethereum standard)

```typescript theme={"system"}
import { keccak256, stringToHex } from 'viem';

const message = "Hello World";
const hash = keccak256(stringToHex(message));
```

## Raw signing on non-EVM chains

Every Dynamic embedded wallet can sign arbitrary digests. Which method you call depends on whether the chain's default `signMessage` wraps your input:

| Curve family | Root wallet | Method | Why |
| - | - | - | - |
| secp256k1 | EVM | `signRawMessage` | `signMessage` adds the ERC-191 prefix, so a raw digest needs `signRawMessage` |
| Ed25519 | Solana | `signMessage` | Signs the exact bytes you pass — no prefix, so no separate raw API is needed |

Chains built on top of these wallets — Aptos, NEAR, Cardano and Mavryk from the Solana wallet; Cosmos, XRP and Tron from the EVM wallet — follow the same rule. See the [Tier 2 and 3 chains technical overview](https://docs.dynamic.xyz/docs/react-native/chains/tier-2-chains/overview.md) for the complete derive-and-sign pattern, and [Aptos](https://docs.dynamic.xyz/docs/react-native/chains/tier-2-chains/aptos.md) for a worked Ed25519 example.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.