Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.17 KB

scdosignmessage.md

File metadata and controls

69 lines (51 loc) · 1.17 KB

scdoSignMessage

Use requirement

  • Firmware version required
    • Touch: 4.10.0

SCDO: sign message

Signs a message using the private key derived by given BIP32 path.

// Original message
const message = "Hello World";

// Convert to hex
const messageHex = Buffer.from(message).toString('hex');

const response = await HardwareSDK.scdoSignMessage(connectId, deviceId, {
    path: "m/44'/541'/0'/0/0",
    messageHex: messageHex
});

Params

Optional common params

  • pathrequired string | Array<number> minimum length is 3. read more
  • messageHexrequired string message to sign in hex format

Example

// Original message
const message = "Hello World";

// Convert to hex
const messageHex = Buffer.from(message).toString('hex');

const response = await HardwareSDK.scdoSignMessage(connectId, deviceId, {
    path: "m/44'/541'/0'/0/0",
    messageHex,
});

Result

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

Error

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