跳到主要内容

nostrSignSchnorr

使用要求

  • 固件版本要求
    • UKey Lite 24 / UKey Lite 25: 1.1.0
    • UKey Core 26: 1.1.0

Nostr:签名 Schnorr

使用指定 BIP32 路径派生的私钥生成 Schnorr 签名,签名前请在设备上核对请求内容。

const result = await HardwareSDK.nostrSignSchnorr(connectId, deviceId, params);

参数

可选通用参数

  • path - 必需 string | Array<number>,字符串数组最小长度限制为 3更多信息
  • hash - 必需 string,Schnorr 哈希。

示例

const response = await HardwareSDK.nostrSignSchnorr(connectId, deviceId, {
path: "m/44'/1237'/1'/0/0",
hash: "9f3c72b4a8d1e67f20cb59d4ef1836aa74d05bc98e1a43f26b7d9c4e5fa8123d",
});

返回结果

{
success: true,
payload: {
path: string, // 使用的 BIP32 路径
rawHash: string, // 原始哈希
signature: string, // 签名结果
}
}

错误

{
success: false,
payload: {
error: string, // 错误消息
code: number // 错误码
}
}