Skip to main content

HD Key

The CryptoHDKey class represents hierarchical deterministic key information.

This is an instruction provided by the UKey Wallet hardware, which includes the extended public key information.

Inputs

FieldValue TypeMeaning
isMasterbooleanWhether it is a master key
isPrivateKeybooleanWhether it is a private key
keyBufferThe key data
chainCodeBufferThe chain code
useInfoCryptoCoinInfoUsage information
originCryptoKeypathThe origin path
childrenCryptoKeypathThe children path
parentFingerprintBufferThe parent fingerprint
namestringThe name (optional)
notestringThe note (optional)

Note Values

  • 'account.standard' – BIP44 Standard account
  • 'account.ledger_live' – Ledger Live account
  • 'account.ledger_legacy' – Ledger Legacy account

UR Demo

UR:CRYPTO-HDKEY/PDAXHDCLAOZTRDKBTKFPRFKBCWVEWYBGDPNTCPVLEOENJSWMBKFTLTRESNWTNLTLMKJYVYMWBSAAHDCXCSBNNLLNBZIAJZTPKPPKJOSTCEZSJEKGYKJOCSKNHFTPSWTIGHVABDIEGTBWWLTEAHTAADEHOYADCSFNAMTAADDYOYADLNCSDWYKCSFNYKAEYKATTAADDYOYADLRAEWKLAWKAYAEASINFPIAIAJLKPJTJYCXEHBKKOGHISINJKCXINJKCXHSC

Decode Demo

import { URDecoder } from "@ngraveio/bc-ur";
import { CryptoHDKey } from "@keystonehq/bc-ur-registry";

const dec = new URDecoder();
// Feed each scanned frame string into the decoder
// feed each scanned frame into dec.receivePart(frame)

if (dec.isComplete()) {
const ur = dec.resultUR(); // the decoded UR should be of type 'crypto-hdkey'
const hdkey = CryptoHDKey.fromCBOR(ur.cbor);

const name = hdkey.getName();
const note = hdkey.getNote();
const chainCode = hdkey.getChainCode();
const origin = hdkey.getOrigin();
const xfp = origin?.getSourceFingerprint();
}