RAILGUN Reloaded
    Preparing search index...

    The WalletNode class 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.

    • Key Management: Handles chain key and chain code for cryptographic operations.
    • Mnemonic Support: Allows creation of wallet nodes from mnemonic phrases.
    • Key Derivation: Supports BIP32 hardened key derivation along specified paths.
    • Spending Key Pair: Generates spending key pairs for transactions.
    • Viewing Key Pair: Provides viewing key pairs for privacy-preserving operations.
    • Nullifying Key: Computes nullifying keys for advanced cryptographic use cases.
    • Master Public Key: Generates master public keys using Poseidon hash function.

    This class is designed for use in cryptographic wallet implementations, enabling secure key management and hierarchical deterministic wallet functionality.

    • poseidonFunc: A cryptographic hash function used for key computations.
    • bytesToBigInt: Utility for converting Uint8Array to bigint.
    • External functions for mnemonic seed generation, key derivation, and public key computation.
    • Ensure proper handling of Uint8Array and bigint conversions in cryptographic operations.
    • Optimize key storage to avoid recalculating keys repeatedly.
    • Implement missing TODOs for robust functionality.
    Index
    • Creates a new instance of WalletNode from a given mnemonic phrase.

      Parameters

      • mnemonic: string

        The mnemonic phrase used to generate the wallet node.

      Returns WalletNode

      A new WalletNode instance derived from the mnemonic.

    • Derives a new WalletNode along the specified BIP32 derivation path.

      Parameters

      • path: string

        The derivation path to follow (e.g., "m/44'/0'/0'")

      Returns WalletNode

      A new WalletNode instance derived from the path

      If the derivation path is invalid

    • Generates 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.

      Parameters

      • spendingPublicKey: [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>]

        A tuple containing two Uint8Arrays representing the spending public key.

      • nullifyingKey: Uint8Array

        A Uint8Array representing the nullifying key.

      Returns Uint8Array

      A Uint8Array representing the computed master public key.

      If initializeCryptographyLibs() has not been called.

    • 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.

      Returns ViewingKeyPair

      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.

      Returns Uint8Array

      The calculated nullifying key as a Uint8Array.

      If initializeCryptographyLibs() has not been called.