/// <summary> /// A method to turn a public key into a bitcoin address encoded string /// </summary> /// <param name="pubKey">The public key to turn into the bitcoin address encoded string</param> /// <returns>A bitcoin address encoded string</returns> public static string GetBitcoinAdressEncodedStringFromPublicKey(PublicKey pubKey) { return(new BitcoinAddress(pubKey).BitcoinAddressEncodedString); }
/// <summary> /// Construct a BitcoinAddress from a PublicKey object /// </summary> /// <param name="publicKey">The public key to build the bitcoin address</param> public BitcoinAddress(PublicKey publicKey) : base(publicKey.Version, publicKey.PublicKeyHash) { }
/// <summary> /// Construct a BitcoinAddress from a PublicKey object and supply a version /// </summary> /// <param name="version">By supplying a version we have the option to force a version different to what is recorded wit hthe public key</param> /// <param name="publicKey">The public key used to build the bitcoin address</param> public BitcoinAddress(byte[] version, PublicKey publicKey) : base(Convert.ToInt32(version[0]), publicKey.PublicKeyHash) { }
/// <summary> /// A method to turn a public key into a bitcoin address encoded string with the option to supply a different version to what is recorded with the public key /// </summary> /// /// <param name="version">The Network version to use when creating the bitcoin address. Grab from BitcoinUtilities.Globals</param> /// <param name="pubKey">The public key to turn into the bitcoin address encoded string</param> /// <returns>A bitcoin address encoded string</returns> public static string GetBitcoinAdressEncodedStringFromPublicKey(byte[] version, PublicKey pubKey) { return(new BitcoinAddress(version, pubKey).BitcoinAddressEncodedString); }