@arkade-os/sdk Documentation - v0.4.21
    Preparing search index...

    Class ArkNote

    ArkNotes are special virtual outputs in the Arkade protocol that can be created and spent without requiring any transactions. The server mints them, and they are encoded as base58 strings with a human-readable prefix, a preimage and a value.

    VtxoScript

    // Create an ArkNote
    const note = new ArkNote(preimage, 50000);

    // Encode to string
    const noteString = note.toString();

    // Decode from string
    const decodedNote = ArkNote.fromString(noteString);

    Implements

    Index

    Constructors

    • Create an ArkNote from a preimage and value.

      Parameters

      • preimage: Uint8Array

        32-byte preimage revealed to spend the note

      • value: number

        Note value in satoshis

      • HRP: string = ArkNote.DefaultHRP

        Optional human-readable prefix for string encoding

      Returns ArkNote

    Properties

    extraWitness?: Bytes[]
    forfeitTapLeafScript: TapLeafScript

    Tapleaf script used for the forfeit path.

    HRP: string = ArkNote.DefaultHRP

    Optional human-readable prefix for string encoding

    intentTapLeafScript: TapLeafScript

    Tapleaf script used for the intent path.

    preimage: Uint8Array

    32-byte preimage revealed to spend the note

    status: Status

    Onchain output status

    tapTree: Bytes
    txid: string

    Hashlock script backing the note.

    value: number

    Note value in satoshis

    vout: 0

    Transaction output index for this output

    vtxoScript: VtxoScript
    DefaultHRP: "arknote"
    FakeOutpointIndex: 0
    Length: number = ...
    PreimageLength: 32
    ValueLength: 4

    Methods

    • Encode the note as raw bytes.

      Returns Uint8Array

      Serialized note bytes

      decode

    • Encode the note to its human-readable base58 string form.

      Returns string

      Base58-encoded note string

      fromString

    • Decode a note from raw bytes.

      Parameters

      • data: Uint8Array

        Serialized note bytes

      • hrp: string = ArkNote.DefaultHRP

        Human-readable prefix expected for future string encoding

      Returns ArkNote

      Decoded ArkNote

      Error if the payload length is invalid

      encode

    • Decode a note from its base58 string form.

      Parameters

      • noteStr: string

        Base58-encoded note string

      • hrp: string = ArkNote.DefaultHRP

        Human-readable prefix expected on the note string

      Returns ArkNote

      Decoded ArkNote

      Error if the prefix or base58 payload is invalid

      toString