Skip to main content

index/functions/signPersonalMessage.md

signPersonalMessage(privateKey, prefix, message): string

Personal-sign hash and signature: keccak256(prefix + message), both hashed VERBATIM with no further EIP-191 wrapping. Passing prefix = calculatePersonalSignPrefix(message) reproduces a wallet's personal_sign of message. Gala Wallet's gala_signChainDto (personal-sign scheme) hashes prefix + the exact string it is handed, which can differ from the bare message (see the signatureOverPrefixlessBody vectors); that quirk is why the two inputs stay separate.

Parameters​

ParameterType
privateKeyUint8Array
prefixstring
messagestring

Returns​

string