Skip to main content

benfenSignMessage

Use requirement

  • Firmware version required
    • UKey Lite 24 / UKey Lite 25 / UKey Core 26: 4.12.0

Benfen: sign message

Sign a message using the private key derived by given BIP32 path. User needs to confirm the action on Ukey Wallet device.

const result = await HardwareSDK.benfenSignMessage(connectId, deviceId, {
path: "m/44'/728'/0'/0'/0'",
messageHex: "68656c6c6f", // "hello" in hex
});

Params

Optional common params

  • path - required string | Array<number> minimum length is 3. read more
  • messageHex - required string Message to sign in hex format

Returns

  • success - boolean True if successful
  • payload
    • signature - string Signature in hex format
    • address - string BFC format address used for signing

Example:

const params = {
path: "m/44'/728'/0'/0'/0'",
messageHex: "68656c6c6f", // "hello" in hex
};

const response = await HardwareSDK.benfenSignMessage(
connectId,
deviceId,
params,
);

Result

{
success: true,
payload: {
signature: string,
address: string.
}
}

Error

{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}