Skip to main content
CCC provides a unified message signing and verification API across all supported wallet types. The same code works whether the user is connected through MetaMask, JoyID, UniSat, OKX, Nostr, or a native CKB wallet — CCC handles the chain-specific encoding internally.

How it works

When you call signer.signMessage(), CCC:
  1. Encodes the message according to the connected chain’s convention (e.g. EIP-191 for EVM, BIP-322 for BTC).
  2. Asks the wallet to sign it.
  3. Returns a Signature object containing the raw signature string, the signer’s identity, and the sign type.
The static ccc.Signer.verifyMessage() method understands all supported sign types and dispatches to the correct verification function automatically.

Supported sign types

Sign a message

Call signer.signMessage() with a string or byte array. The method returns a Signature object.
sign.ts

The Signature object

Verify a signature

Static verification

Use the static ccc.Signer.verifyMessage() method when you have a Signature object and want to check it without a signer instance. This is useful on the server side or when verifying signatures from other users.

Instance verification

Call signer.verifyMessage() on the signer instance when you want to check that the current signer produced the signature.
Pass a raw string instead of a Signature object to verify a bare signature string using the current signer’s sign type and identity:

Full example

sign.ts

In a React component

sign-button.tsx
The Signature object must be serialized and stored if you want to verify it later (for example in a backend or on-chain). Serialize it with JSON.stringify(signature) and restore it with JSON.parse().

Next steps

Send CKB

Move beyond signing messages and compose a full transfer transaction.

Connect Wallet

Learn how to set up the wallet connector and retrieve a signer.