RAILGUN Reloaded
    Preparing search index...

    Module @railgun-reloaded/wallet-node

    Source: dev d85e9dc

    @railgun-reloaded/wallet-node

    Hierarchical deterministic wallet and note management for the RAILGUN privacy system.

    wallet-node handles key derivation, note construction, token serialization, and commitment decryption.

    npm install @railgun-reloaded/wallet-node
    
    import {
    Mnemonic,
    RailgunWallet,
    initializeCryptographyLibs,
    } from '@railgun-reloaded/wallet-node'

    // Initialize cryptography (required once before any operations)
    await initializeCryptographyLibs()

    // Generate or use an existing mnemonic
    const mnemonic = Mnemonic.generate() // 12-word BIP39 phrase

    // Create a wallet
    const wallet = new RailgunWallet(mnemonic)

    // Access keys
    const spendingPubKey = wallet.getSpendingPublicKey() // [Uint8Array, Uint8Array]
    const viewingPubKey = wallet.getViewingPublicKey() // Uint8Array (32 bytes)
    const masterPubKey = wallet.getMasterPublicKey() // Uint8Array
    const nullifyingKey = wallet.getNullifyingKey() // Uint8Array
    wallet-node/
    src/
    index.ts Package entry point
    encoding.ts Byte utilities (hex, bigint, XOR, HMAC-SHA512)
    keys.ts Cryptographic key operations (ECDH, blinding, scalars)
    mnemonic/
    mnemonic.ts Mnemonic class (BIP39 generation and validation)
    wallet/
    types.ts Core type definitions (KeyNode, SpendingKeyPair, etc.)
    bip32.ts BIP32 HD key derivation (hardened, Uint8Array-based)
    derivation.ts Derivation path logic and node generation
    wallet-node.ts WalletNode class (key derivation and pair generation)
    railgun-wallet.ts RailgunWallet class (high-level wallet interface)
    notes/
    definitions.ts Note types, enums, constants (TokenType, SNARK_PRIME, etc.)
    token-utils.ts Token serialization, hashing, and validation
    address-utils.ts 0zk address encoding/decoding (bech32)
    commitment.ts Commitment formatting and decryption from on-chain data
    note.ts Note class (abstract base with hash and validation)
    shield-note.ts ShieldNote class (public -> private)
    transact-note.ts TransactNote class (private -> private)
    unshield-note.ts UnshieldNote class (private -> public)
    memo.ts Memo class (annotation data and memo text encryption/decryption)
    wallet-info.ts WalletInfo class (wallet info encoding for note annotations)
    test/
    *.test.ts Tests covering all modules
    npm install
    
    npm run build
    
    npm test
    
    npm run lint
    npm run lint:fix

    MIT

    Mnemonic
    Memo
    Note
    ShieldNote
    TransactNote
    UnshieldNote
    WalletInfo
    RailgunWallet
    WalletNode
    OutputType
    TXIDVersion
    ChainType
    sha512HMAC
    assertCryptoInitialized
    initializeCryptographyLibs
    getPublicSpendingKey
    getPublicViewingKey
    adjustBytes25519
    getPrivateScalarFromPrivateKey
    getSharedSymmetricKey
    getSharedSymmetricKeyLegacy
    scalarMultiplyJavascript
    getRandomScalar
    seedToScalar
    getBlindingScalar
    getNoteBlindingKeys
    unblindNoteKey
    unblindNoteKeyLegacy
    getCommitmentCiphertexts
    decryptCommitment
    decryptCommitmentAsReceiverOrSender
    buildShieldRequest
    computeTokenHashERC20
    computeTokenHashNFT
    computeTokenHash
    getReadableTokenAddress
    serializeTokenData
    getTokenDataERC20
    deserializeTokenData
    assertValidNoteToken
    deriveEphemeral7702Signer
    getPathSegments
    childKeyDerivationHardened
    getMasterKeyFromSeed
    derivePathsForIndex
    deriveNodes
    DecryptedCommitmentData
    LegacyTransactNoteSerialized
    TransactNoteSerialized
    TokenDataGetter
    poseidon → poseidon
    AddressData → AddressData
    Ciphertext → Ciphertext
    EncryptedCommitment → EncryptedCommitment
    GeneratedCommitment → GeneratedCommitment
    ShieldCommitment → ShieldCommitment
    TransactCommitment → TransactCommitment
    Unshield → Unshield
    TokenType → TokenType
    CommitmentCiphertext
    TokenData
    Chain
    LegacyCiphertext
    EncryptedData
    NoteAnnotationData
    NoteParams
    ShieldNoteParams
    ShieldNoteCreateParams
    ShieldRequest
    TransactNoteParams
    TransactNoteCreateParams
    UnshieldNoteParams
    UnshieldNoteCreateParams
    DeriveEphemeral7702SignerParams
    Ephemeral7702Signer
    KeyNode
    SpendingPublicKey
    SpendingKeyPair
    ViewingKeyPair
    WalletNodes
    SNARK_PRIME
    MEMO_SENDER_RANDOM_NULL
    SHIELD_PRIVATE_KEY_SIGNATURE_MESSAGE
    TOKEN_SUB_ID_NULL
    DERIVATION_PATH_PREFIXES