Table of Contents

Class ArkAddress

Namespace
NArk.Abstractions
Assembly
NArk.Abstractions.dll

Bech32m-encoded Arkade address: a taproot x-only pubkey tagged with a server key and protocol version. Serialized as ark1… (mainnet) or tark1… (testnet).

public class ArkAddress : TaprootPubKey, IAddressableDestination, IDestination, IPubKey, IComparable<TaprootPubKey>
Inheritance
TaprootPubKey
ArkAddress
Implements
IAddressableDestination
IDestination
IPubKey
IComparable<TaprootPubKey>
Inherited Members
TaprootPubKey.ToBytes()
TaprootPubKey.GetAddress(Network)
TaprootPubKey.GetHashCode()
TaprootPubKey.VerifySignature(uint256, SchnorrSignature)
TaprootPubKey.CompareTo(TaprootPubKey)
TaprootPubKey.ScriptPubKey

Constructors

ArkAddress(ECXOnlyPubKey, ECXOnlyPubKey, int)

public ArkAddress(ECXOnlyPubKey tweakedKey, ECXOnlyPubKey serverKey, int version = 0)

Parameters

tweakedKey ECXOnlyPubKey
serverKey ECXOnlyPubKey
version int

ArkAddress(ECXOnlyPubKey, ECXOnlyPubKey, int, bool?)

public ArkAddress(ECXOnlyPubKey tweakedKey, ECXOnlyPubKey serverKey, int version, bool? isMainnet)

Parameters

tweakedKey ECXOnlyPubKey
serverKey ECXOnlyPubKey
version int
isMainnet bool?

ArkAddress(TaprootAddress, ECXOnlyPubKey, int, Network?)

public ArkAddress(TaprootAddress taprootAddress, ECXOnlyPubKey serverKey, int version = 0, Network? network = null)

Parameters

taprootAddress TaprootAddress
serverKey ECXOnlyPubKey
version int
network Network

Properties

ServerKey

The Arkade server's x-only pubkey embedded in this address.

public ECXOnlyPubKey ServerKey { get; }

Property Value

ECXOnlyPubKey

Version

Address format version byte. Currently always 0.

public int Version { get; }

Property Value

int

Methods

FromScriptPubKey(Script, ECXOnlyPubKey)

Extracts the x-only pubkey from a taproot scriptPubKey and wraps it as an ArkAddress.

public static ArkAddress FromScriptPubKey(Script scriptPubKey, ECXOnlyPubKey serverKey)

Parameters

scriptPubKey Script
serverKey ECXOnlyPubKey

Returns

ArkAddress

Parse(string)

Decodes a bech32m Arkade address string. Throws FormatException on invalid input.

public static ArkAddress Parse(string address)

Parameters

address string

Returns

ArkAddress

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(bool)

Encodes the address using the mainnet or testnet bech32m HRP.

public string ToString(bool isMainnet)

Parameters

isMainnet bool

Returns

string

TryParse(string, out ArkAddress?)

Tries to decode a bech32m Arkade address string. Returns false without throwing on invalid input.

public static bool TryParse(string address, out ArkAddress? arkAddress)

Parameters

address string
arkAddress ArkAddress

Returns

bool