Module: lib/blockchains/bitcoin

Module to use Bitcoin as underlying blockchain for Whiteflag

Source:
Tutorials:

Methods

(inner) createAccount(privateKeyopt, callback)

Creates a new Bitcoin blockchain account

Parameters:
Name Type Attributes Description
privateKey string <optional>

hexadecimal encoded private key

callback blockchainCreateAccountCb

function to be called upon completion

Source:

(inner) deleteAccount(address, callback)

Deletes Bitcoin blockchain account

Parameters:
Name Type Description
address string

the address of the account to be deleted

callback blockchainDeleteAccountCb

function to be called upon completion

Source:

(inner) getBinaryAddress(address, callback)

Returns a Bitcoin address in binary encoded form

Parameters:
Name Type Description
address string

the Bitcoin blockchain address

callback blockchainBinaryAddressCb

function to be called upon completion

Source:

(inner) getMessage(wfQuery, callback)

Performs a simple query to find a message on Bitcoin by transaction hash

Parameters:
Name Type Description
wfQuery Object

the property of the transaction to look up

callback blockchainLookupMessageCb

function to be called after Whiteflag message lookup

Source:

(inner) initBitcoin(bcConfig, callback)

Initialises the Bitcoin blockchain

Parameters:
Name Type Description
bcConfig Object

the Bitcoin blockchain configuration

callback blockchainInitCb

function to be called after intitialising Bitcoin

Source:

(inner) requestKeys(publicKey, callback)

Requests the Bitcoin address and correctly encoded pubic key of an originator

Parameters:
Name Type Description
publicKey string

the raw hex public key of the originator

callback blockchainRequestKeysCb

function to be called upon completion

Source:

(inner) requestSignature(payload, callback)

Requests a Whiteflag signature for a specific Bitcoin address

Parameters:
Name Type Description
payload wfSignaturePayload

the JWS payload for the Whiteflag signature

callback blockchainRequestSignatureCb

function to be called upon completion

Source:

(inner) sendMessage(wfMessage, callback)

Sends an encoded message on the Bitcoin blockchain

Parameters:
Name Type Description
wfMessage wfMessage

the Whiteflag message to be sent on Bitcoin

callback blockchainSendTransactionCb

function to be called after sending Whiteflag message

Source:
To Do:
  • Return blocknumber

(inner) transferFunds(transfer, callback)

Transfers bitcoin from one Bitcoin address to an other address

Parameters:
Name Type Description
transfer Object

the transaction details for the funds transfer

callback blockchainSendTransactionCb

function to be called upon completion

Source:
To Do:
  • Return blocknumber

(inner) updateAccount(account, callback)

Updates Bitcoin blockchain account attributes

Parameters:
Name Type Description
account Object

the account information including address to be updated

callback blockchainUpdateAccountCb

function to be called upon completion

Source: