Constructs a new instance of the WalletNode class.
A KeyNode object containing the chainKey and chainCode used to initialize the WalletNode.
StaticfromCreates a new instance of WalletNode from a given mnemonic phrase.
The mnemonic phrase used to generate the wallet node.
A new WalletNode instance derived from the mnemonic.
Derives a new WalletNode along the specified BIP32 derivation path.
The derivation path to follow (e.g., "m/44'/0'/0'")
A new WalletNode instance derived from the path
Gets the spending key pair for this wallet node.
SpendingKeyPair object containing privateKey (Uint8Array) and pubkey (tuple of two Uint8Arrays)
StaticgetGenerates the master public key using the provided spending public key and nullifying key. This function utilizes the Poseidon hash function to compute the master public key.
A tuple containing two Uint8Arrays representing the spending public key.
A Uint8Array representing the nullifying key.
A Uint8Array representing the computed master public key.
Retrieves the viewing key pair associated with the wallet node.
The viewing key pair consists of a private key and a public viewing key.
The private key is derived from the node's chain key, and the public viewing key
is generated using the getPublicViewingKey function.
ViewingKeyPair object containing privateKey and pubkey (both Uint8Arrays)
Generates the nullifying key for the wallet node. This method calculates the nullifying key using the private key obtained from the viewing key pair and applies the Poseidon hash function.
The calculated nullifying key as a Uint8Array.
The
WalletNodeclass provides functionality for hierarchical deterministic wallet management, including key derivation, cryptographic operations, and key pair generation. It encapsulates chain key and chain code properties, which are essential for secure key management and derivation.Features:
Usage:
This class is designed for use in cryptographic wallet implementations, enabling secure key management and hierarchical deterministic wallet functionality.
Dependencies:
poseidonFunc: A cryptographic hash function used for key computations.bytesToBigInt: Utility for converting Uint8Array to bigint.Notes: