@solana/kit · Keys and signatures

Solana error #3704004

KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY

Appears as Solana error #3704004; Decode this error by running `npx @solana/errors decode -- 3704004 '…'`

Message

The provided private key does not match the provided public key.

What it means

Key pair construction, signature byte lengths and key extractability.

What to do

  • Secret keys are 32 bytes (seed) or 64 bytes (seed + public key); signatures are 64 bytes.
  • Keys created with extractable: false cannot be exported later.

Decode it locally instead

npx @solana/errors decode -- 3704004 '<base64 context>'

In development, import from @solana/kit as usual and the full message is thrown. In production the message is stripped to keep bundles small; the error object still carries error.context with the same values this page decodes, and isSolanaError(err, SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY) lets you branch on it.

Decode another error

Try: