Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
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.
signRawMessage is EVM-specific, and EVM is the only wallet that needs it. On EVM, signMessage follows ERC-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.

Basic raw signing (hash then sign)

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.

Hash functions

Different hash functions serve different purposes in cryptographic signing.

Keccak256 (Ethereum standard)

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: 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 for the complete derive-and-sign pattern, and Aptos for a worked Ed25519 example.
Last modified on September 1, 2026