Class: Identity

Identity(settingsopt) → {Identity}

Manage a network identity.

Constructor

new Identity(settingsopt) → {Identity}

Create an instance of an Identity.
Parameters:
Name Type Attributes Description
settings Object <optional>
Settings for the Identity.
Properties
Name Type Attributes Default Description
seed String <optional>
BIP 39 seed phrase.
xprv String <optional>
Serialized BIP 32 master private key.
xpub String <optional>
Serialized BIP 32 master public key.
account Number <optional>
0 BIP 44 account index.
index Number <optional>
0 BIP 44 key index.
Source:
Returns:
Instance of the identity.
Type
Identity

Methods

sign(data) → {Signature}

Sign a buffer of data using BIP 340: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
Parameters:
Name Type Description
data Buffer Buffer of data to sign.
Source:
Returns:
Resulting signature (64 bytes).
Type
Signature

toString() → {String}

Retrieve the bech32m-encoded identity.
Source:
Returns:
Public identity.
Type
String