Skip to main content

benfenGetPublicKey

Benfen: get public key

Get public key from device using BIP32 path.

Use requirement

  • Firmware version required
    • UKey Lite 24 / UKey Lite 25 / UKey Core 26: 4.12.0
const result = await HardwareSDK.benfenGetPublicKey(connectId, deviceId, {
path: "m/44'/728'/0'/0'/0'",
showOnUKey: false,
});

Params

Optional common params

  • path - required string | Array<number> minimum length is 3. read more
  • showOnUKey - optional boolean whether to display public key on device

Returns:

  • success: boolean - True if successful
  • payload:
    • path: string - BIP32 path used
    • pub: string - Public key in hex format

Example:

const params = {
path: "m/44'/728'/0'/0'/0'",
showOnUKey: false,
};

// Single public key
const response = await HardwareSDK.benfenGetPublicKey(
connectId,
deviceId,
params,
);

// Batch public keys
const batchParams = {
bundle: [
{
path: "m/44'/728'/0'/0'/0'",
showOnUKey: false,
},
{
path: "m/44'/728'/1'/0'/0'",
showOnUKey: false,
},
],
};
const batchResponse = await HardwareSDK.benfenGetPublicKey(
connectId,
deviceId,
batchParams,
);