Class HDPubKey
Extended (hierarchical deterministic) public key
Inheritance
Namespace: Netmavryk.Keys
Assembly: Netmavryk.dll
Syntax
public class HDPubKey : object
Properties
| Improve this Doc View SourceAddress
Public key hash
Declaration
public string Address { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ChainCode
32 bytes of entropy added to the public key to enable deriving secure child keys
Declaration
public byte[] ChainCode { get; }
Property Value
| Type | Description |
|---|---|
| System.Byte[] |
PubKey
Public key
Declaration
public PubKey PubKey { get; }
Property Value
| Type | Description |
|---|---|
| PubKey |
Methods
| Improve this Doc View SourceDerive(HDPath)
Derives an extended child key at the given path relative to the current key
Declaration
public HDPubKey Derive(HDPath path)
Parameters
| Type | Name | Description |
|---|---|---|
| HDPath | path | HD key path |
Returns
| Type | Description |
|---|---|
| HDPubKey | Derived extended child key |
Derive(Int32, Boolean)
Derives an extended child key at the given index
Declaration
public HDPubKey Derive(int index, bool hardened = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of the child key, starting from zero |
| System.Boolean | hardened | If true, hardened derivation will be performed |
Returns
| Type | Description |
|---|---|
| HDPubKey | Derived extended child key |
Derive(String)
Derives an extended child key at the given path relative to the current key
Declaration
public HDPubKey Derive(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | HD key path string, formatted like m/44'/1729'/0/0' |
Returns
| Type | Description |
|---|---|
| HDPubKey | Derived extended child key |
FromPubKey(PubKey, Byte[])
Creates an extended (hierarchical deterministic) public key from the given public key and chain code
Declaration
public static HDPubKey FromPubKey(PubKey pubKey, byte[] chainCode)
Parameters
| Type | Name | Description |
|---|---|---|
| PubKey | pubKey | Public key |
| System.Byte[] | chainCode | 32 bytes of entropy to be added to the public key |
Returns
| Type | Description |
|---|---|
| HDPubKey | Extended public key |
Verify(Byte[], Byte[])
Verifies a signature of the given array of bytes
Declaration
public bool Verify(byte[] data, byte[] signature)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | data | Original data bytes |
| System.Byte[] | signature | Signature to verify |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the signature is valid, otherwise false |
Verify(String, String)
Verifies a signature of the given message string
Declaration
public bool Verify(string message, string signature)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Original message string |
| System.String | signature | Signature to verify |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the signature is valid, otherwise false |