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
-
TaprootPubKeyArkAddress
- Implements
-
IAddressableDestinationIDestinationIPubKeyIComparable<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
tweakedKeyECXOnlyPubKeyserverKeyECXOnlyPubKeyversionint
ArkAddress(ECXOnlyPubKey, ECXOnlyPubKey, int, bool?)
public ArkAddress(ECXOnlyPubKey tweakedKey, ECXOnlyPubKey serverKey, int version, bool? isMainnet)
Parameters
ArkAddress(TaprootAddress, ECXOnlyPubKey, int, Network?)
public ArkAddress(TaprootAddress taprootAddress, ECXOnlyPubKey serverKey, int version = 0, Network? network = null)
Parameters
taprootAddressTaprootAddressserverKeyECXOnlyPubKeyversionintnetworkNetwork
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
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
scriptPubKeyScriptserverKeyECXOnlyPubKey
Returns
Parse(string)
Decodes a bech32m Arkade address string. Throws FormatException on invalid input.
public static ArkAddress Parse(string address)
Parameters
addressstring
Returns
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
isMainnetbool
Returns
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
addressstringarkAddressArkAddress