BIP32

The BIP32 class provides methods to make derivation of hierarchical deterministic keys easier.

Importing the BIP32 class

1import { BIP32 } from "@ardenthq/sdk-cryptography";

Derive a key from a mnemonic

1BIP32.fromMnemonic('scout mushroom doctor prepare identify obvious soccer stage sudden already brass december million wish flower');

Derive a key from a seed

1BIP32.fromSeed('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');

Derive a key from a base58

1BIP32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi');

Derive a key from a public key

1BIP32.fromPublicKey('xpub6FnCn6nSzZAw5Tw7cgR9bi15UV96gLZhjDstkXXxvCLsUXBGXPdSnLFbdpq8p9HmGsApME5hQTZ3emM2rnY5agb9rXpVGyy3bdW6EEgAtqt');

Derive a key from a private key

1BIP32.fromPrivateKey('xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j');
Last updated 2 years ago
Edit Page
Share: