Account

Key Management class. Enables the creation of a new Beo Account, importation of an existing account from an existing private key or seed, and message signing and verification functionality.

An Beo Account is generated from a randomly generated seed (number) from which an account private key, view key, and a public account address are derived. The private key lies at the root of an account. It is a highly sensitive secret and should be protected as it allows for creation of Beo Program executions and arbitrary value transfers. The View Key allows for decryption of a user's activity on the blockchain. The Address is the public address to which other users of Beo can send Beo credits and other records to. This class should only be used in environments where the safety of the underlying key material can be assured.

Kind: global class

account.encryptAccount(ciphertext) ⇒ PrivateKeyCiphertextarrow-up-right

Encrypt the account's private key with a password

Kind: instance method of Account

Param
Type

ciphertext

string

Example

let account = new Account();
let ciphertext = account.encryptAccount("password");

account.decryptRecord(ciphertext) ⇒ Recordarrow-up-right

Decrypts a Record in ciphertext form into plaintext

Kind: instance method of Account

Param
Type

ciphertext

string

Example

let account = new Account();
let record = account.decryptRecord("record1ciphertext");

account.decryptRecords(ciphertexts) ⇒ Array.<Record>arrow-up-right

Decrypts an array of Records in ciphertext form into plaintext

Kind: instance method of Account

Param
Type

ciphertexts

Array.<string>

Example

account.ownsRecordCiphertext(ciphertext) ⇒ booleanarrow-up-right

Determines whether the account owns a ciphertext record

Kind: instance method of Account

Param
Type

ciphertext

RecordCipherText | string

Example

account.sign(message) ⇒ Signaturearrow-up-right

Signs a message with the account's private key. Returns a Signature.

Kind: instance method of Account

Param
Type

message

Uint8Array

Example

account.verify(message, signature) ⇒ booleanarrow-up-right

Verifies the Signature on a message.

Kind: instance method of Account

Param
Type

message

Uint8Array

signature

Signature

Example

Account.fromCiphertext(ciphertext, password) ⇒ PrivateKey | Errorarrow-up-right

Attempts to create an account from a private key ciphertext

Kind: static method of Account

Param
Type

ciphertext

PrivateKeyCiphertext | string

password

string

Example

Last updated