Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lucid/src/core/mod.ts>Core.Bip32PublicKey

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
Go to Latest
class Core.Bip32PublicKey
import { Core } from "https://deno.land/x/lucid@0.7.7/src/core/mod.ts";
const { Bip32PublicKey } = Core;

Methods

derive(index)

derive this public key with the given index.

Errors

If the index is not a soft derivation index (< 0x80000000) then calling this method will fail.

Security considerations

  • hard derivation index cannot be soft derived with the public key

Hard derivation vs Soft derivation

If you pass an index below 0x80000000 then it is a soft derivation. The advantage of soft derivation is that it is possible to derive the public key too. I.e. derivation the private key with a soft derivation index and then retrieving the associated public key is equivalent to deriving the public key associated to the parent private key.

Hard derivation index does not allow public key derivation.

This is why deriving the private key should not fail while deriving the public key may fail (if the derivation index is invalid).