Class: Address

bitmessage/address. Address

new Address(optsopt)

Create a new Bitmessage address object.

Parameters:
Name Type Attributes Description
opts Object <optional>

Address options

Properties
Name Type Description
version number

Version number (4 by default)

stream number

Stream number (1 by default)

behavior Object

Pubkey features (DOES_ACK by default)

signPrivateKey Buffer

Signing private key

signPublicKey Buffer

Signing public key

encPrivateKey Buffer

Encryption private key

encPublicKey Buffer

Encryption public key

ripe Buffer

Keys RIPEMD hash

Source:

Methods

(static) decode(str) → {Address}

Parse Bitmessage address into address object.

Parameters:
Name Type Description
str string

Address string (with or without BM- prefix)

Source:
Returns:

Decoded address object.

Type
Address

(static) fromPassphrase(opts) → {Address}

Create a new Bitmessage address from passphrase.

Parameters:
Name Type Description
opts string | Object

Passphrase or address options

Properties
Name Type Attributes Description
passphrase string

Passphrase to generate address from

ripeLength number <optional>

Required length of the short RIPEMD hash (19 by default)

version number <optional>

Version number (4 by default)

stream number <optional>

Stream number (1 by default)

behavior Object <optional>

Pubkey features (DOES_ACK by default)

Source:
Returns:

New address object.

Type
Address

(static) fromRandom(optsopt) → {Address}

Create a new Bitmessage address with random encryption and signing private keys.

Parameters:
Name Type Attributes Description
opts Object <optional>

Address options

Properties
Name Type Description
ripeLength number

Required length of the short RIPEMD hash (19 by default)

version number

Version number (4 by default)

stream number

Stream number (1 by default)

behavior Object

Pubkey features (DOES_ACK by default)

Source:
Returns:

New address object.

Type
Address

(static) isAddress(obj) → {boolean}

Test if the given object is an Address instance.
NOTE: Implementation is just simple instanceof but it improves readability and consistent with isArray, isBuffer, etc.

Parameters:
Name Type Description
obj Object

Given object

Source:
Returns:
Type
boolean

clone() → {Address}

Create a copy of the address object.

Source:
Returns:

Cloned address.

Type
Address

encode() → {string}

Encode Bitmessage address object into address string.

Source:
Returns:

Address string.

Type
string

getBroadcastPrivateKey() → {Buffer}

Calculate the encryption key used to encrypt/decrypt broadcast objects.

Source:
Returns:

A 32-byte private key.

Type
Buffer

getBroadcastPublicKey() → {Buffer}

Calculate the corresponding public key for encryption key used to encrypt/decrypt broadcast objects.

Source:
Returns:

A 65-byte public key.

Type
Buffer

getPubkeyPrivateKey() → {Buffer}

Calculate the encryption key used to encrypt/decrypt pubkey objects.

Source:
Returns:

A 32-byte private key.

Type
Buffer

getPubkeyPublicKey() → {Buffer}

Calculate the corresponding public key for encryption key used to encrypt/decrypt pubkey objects.

Source:
Returns:

A 65-byte public key.

Type
Buffer

getShortRipe() → {Buffer}

Get the RIPEMD hash of the address keys without prefix nulls.

Source:
Returns:

A short RIPEMD hash.

Type
Buffer

getTag() → {Buffer}

Calculate the address tag.

Source:
Returns:

A 32-byte address tag.

Type
Buffer