RAILGUN Reloaded
    Preparing search index...

    Abstract base class for all note types. Provides common properties and serialization interface.

    Hierarchy (View Summary)

    Index
    • Validates that random value is the correct length (16 bytes).

      Parameters

      • random: string

        The random value to validate (hex string)

      Returns void

      If validation fails

    • Validates the caller input of an outbound note factory.

      Parameters

      • params: NoteCreateParams

        The value, token data, optional random, and optional master public key

      • tokenTypes: TokenType[]

        The token types the factory accepts

      Returns void

      If a parameter is invalid

    • Computes the note hash from npk, token hash, and value.

      Parameters

      • npk: Uint8Array

        The note public key as a Uint8Array

      • tokenHash: Uint8Array

        The token hash as a Uint8Array

      • value: bigint

        The note value as a bigint

      Returns Uint8Array

      The note hash as a Uint8Array

      If initializeCryptographyLibs() has not been called.

    • Computes the note public key (NPK) from a master public key and random value. NPK = poseidon(masterPublicKey, random)

      Parameters

      • masterPublicKey: Uint8Array

        The receiver's master public key as a Uint8Array

      • random: Uint8Array

        The note random value as a Uint8Array (16 bytes)

      Returns Uint8Array

      The note public key as a Uint8Array

      If initializeCryptographyLibs() has not been called.

    • Computes the nullifier for a note at a given leaf index. The nullifier uniquely identifies a note when it is spent.

      Parameters

      • nullifyingKey: Uint8Array

        The wallet's nullifying key as a Uint8Array

      • leafIndex: bigint

        The note's position in the merkle tree

      Returns Uint8Array

      The nullifier as a Uint8Array

      If initializeCryptographyLibs() has not been called.

    • Serializes the note to a Uint8Array. Must be implemented by subclasses.

      Returns Uint8Array

      The serialized note

    notePublicKey: string

    The note public key (npk) as a hex string

    value: bigint

    The note value as a bigint

    tokenData: TokenData

    The token data containing address, type, and subID

    tokenHash: string

    The token hash as a hex string

    random: string

    Random value (16 bytes hex string)