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

    Class ArkAddress

    ArkAddress allows creating and decoding bech32m-encoded Arkade addresses.

    An Arkade address is composed of:

    • a human readable prefix (hrp)
    • a version byte (1 byte)
    • a server public key (32 bytes)
    • a vtxo taproot public key (32 bytes)

    This is an Arkade-specific address format. It is distinct from the Taproot onchain address returned by VtxoScript.onchainAddress.

    VtxoScript

    const address = new ArkAddress(
    new Uint8Array(32), // server public key
    new Uint8Array(32), // vtxo taproot public key
    "ark"
    );

    const encoded = address.encode();
    console.log("address: ", encoded);

    const decoded = ArkAddress.decode(encoded);
    Index

    Constructors

    • Create an Arkade address from its server key, vtxo taproot public key, and prefix.

      Parameters

      • serverPubKey: Bytes

        32-byte Arkade server public key

      • vtxoTaprootKey: Bytes

        32-byte tweaked vtxo taproot public key

      • hrp: string

        Bech32 human-readable prefix

      • version: number = 0

        Address version byte

      Returns ArkAddress

      version = 0

      Error if either public key is not 32 bytes long

    Properties

    hrp: string

    Bech32 human-readable prefix

    serverPubKey: Bytes

    32-byte Arkade server public key

    version: number = 0

    Address version byte

    vtxoTaprootKey: Bytes

    32-byte tweaked vtxo taproot public key

    Accessors

    • get pkScript(): Bytes

      ScriptPubKey used to send non-dust funds to the address.

      Returns Bytes

    • get subdustPkScript(): Bytes

      ScriptPubKey used to send sub-dust funds to the address.

      Returns Bytes

    Methods

    • Encode the address to its bech32m string form.

      Returns string

      Bech32m-encoded Arkade address

      decode

    • Decode an Arkade address from its bech32m string form.

      Parameters

      • address: string

        Bech32m-encoded Arkade address

      Returns ArkAddress

      Decoded Arkade address

      Error if the address is malformed or has an invalid payload length

      encode