Summary

Members Descriptions
namespaceBitprim
classConstants

namespace Bitprim

Summary

Members Descriptions
classBitprim::Binary Represents a binary filter.
classBitprim::Block Represents a full Bitcoin blockchain block.
classBitprim::BlockReader Allows user to read a specific set of blocks from the blockchain.
classBitprim::Chain Represents the Bitcoin blockchain; meant to offer its different interfaces (query, mining, network)
classBitprim::Executor Controls the execution of the Bitprim bitcoin node.
classBitprim::Header Represents a full Bitcoin blockchain block.
classBitprim::HeaderReader Helper for reading the header for each block in a specific set of blocks.
classBitprim::Input Represents a Transaction input.
classBitprim::Logger
classBitprim::MerkleBlock Merkle tree representation of a blockchain block.
classBitprim::Output Represents one of the outputs of a Transaction.
classBitprim::OutputPoint Transaction hash and index pair representing one of the transaction outputs.
classBitprim::PaymentAddress Represents a Bitcoin wallet address.
classBitprim::Point Represents one of the transaction inputs. It's a transaction hash and index pair.
classBitprim::Script Represents a transaction script.
classBitprim::StealthCompact Stealth payment related data.
classBitprim::Transaction Represents a Bitcoin transaction.

class Bitprim::Binary

class Bitprim::Binary
  : public IDisposable

Represents a binary filter.

Summary

Members Descriptions
public inlineBinary() Create an empty binary object.
public inlineBinary(string hexString) Creates a binary filter from a binary string.
public inlineBinary(UIntPtr bitsSize,byte [] blocks,UIntPtr n) Creates a binary filter from an int array.

Members

public inlineBinary()

Create an empty binary object.

public inlineBinary(string hexString)

Creates a binary filter from a binary string.

Parameters

  • hexString Binary string. Example: '10111010101011011111000000001101'

public inlineBinary(UIntPtr bitsSize,byte [] blocks,UIntPtr n)

Creates a binary filter from an int array.

Parameters

  • bitsSize Elements size

  • blocks Filter representation. Example: '[186,173,240,13]'.

  • n Array length in amount of elements.

class Bitprim::Block

class Bitprim::Block
  : public IDisposable

Represents a full Bitcoin blockchain block.

Summary

Members Descriptions
public inline boolIsFinal(UIntPtr height) Returns true iif every transaction in the block is final or not.
public inline boolIsValidCoinbaseClaim(UIntPtr height) Given a block height, return true iif its coinbase claim is not higher than the deserved reward.
public inline boolIsValidCoinbaseScript(UIntPtr height) Returns true iif the block's coinbase script is valid.
public inlineTransaction`[GetNthTransaction](#class_bitprim_1_1_block_1a6502536ef8e41ed742a0d5c1d7f93976)(UIntPtr n)` Given a position in the block, returns the corresponding transaction.
public inline UInt64GetBlockReward(UIntPtr height) Reward = Subsidy + Fees, for the block at the given height.
public inline UIntPtrGetSerializedSize(UInt32 version) Block size in bytes.
public inline UIntPtrGetSignatureOperationsCount(bool bip16Active) Amount of signature operations in the block.
public inline UIntPtrGetTotalInputs(bool withCoinbase) The sum of all inputs of all transactions in the block.

Members

public inline boolIsFinal(UIntPtr height)

Returns true iif every transaction in the block is final or not.

Parameters

  • height

Returns

public inline boolIsValidCoinbaseClaim(UIntPtr height)

Given a block height, return true iif its coinbase claim is not higher than the deserved reward.

Parameters

  • height The height which identifies the block to examine

Returns

True iif 1 if coinbase claim is not higher than the deserved reward.

public inline boolIsValidCoinbaseScript(UIntPtr height)

Returns true iif the block's coinbase script is valid.

Parameters

  • height The block's height. Identifies it univocally.

Returns

True iif the block's coinbase script is valid.

public inlineTransaction`[GetNthTransaction](#class_bitprim_1_1_block_1a6502536ef8e41ed742a0d5c1d7f93976)(UIntPtr n)`

Given a position in the block, returns the corresponding transaction.

Parameters

  • n Zero-based index

Returns

Full transaction object

public inline UInt64GetBlockReward(UIntPtr height)

Reward = Subsidy + Fees, for the block at the given height.

Parameters

  • height Block height in the chain; identifies it univocally.

Returns

UInt64 representation of the block's reward.

public inline UIntPtrGetSerializedSize(UInt32 version)

Block size in bytes.

Parameters

  • version Protocol version.

Returns

UInt64 representation of the block size in bytes.

public inline UIntPtrGetSignatureOperationsCount(bool bip16Active)

Amount of signature operations in the block.

Parameters

  • bip16Active Iif true, count bip16 active operations.

Returns

The amount of signature operations in this block

public inline UIntPtrGetTotalInputs(bool withCoinbase)

The sum of all inputs of all transactions in the block.

Parameters

  • withCoinbase Iif true, consider coinbase transactions.

Returns

UInt64 representation of the sum

class Bitprim::BlockReader

class Bitprim::BlockReader
  : public IDisposable

Allows user to read a specific set of blocks from the blockchain.

Summary

Members Descriptions
public inlineBlockReader()
public inlineBlockReader(HashList start,byte [] stop)
public inline UInt64GetSerializedSize(UInt32 version) The sum of the sizes of the read blocks.
public inline voidReset() Go back to the beginning of the block set.

Members

public inlineBlockReader()

public inlineBlockReader(HashList start,byte [] stop)

public inline UInt64GetSerializedSize(UInt32 version)

The sum of the sizes of the read blocks.

Parameters

  • version Protocol version to consider when calculating block size.

Returns

UInt64 representation of the sum

public inline voidReset()

Go back to the beginning of the block set.

class Bitprim::Chain

Represents the Bitcoin blockchain; meant to offer its different interfaces (query, mining, network)

Summary

Members Descriptions
public inline voidFetchBlockHeight(byte [] blockHash,Action< int, UInt64 > handler) Given a block hash, it queries the chain asynchronously for the block's height. Return right away and uses a callback to return the result.
public inline Tuple< int, UInt64 >GetBlockHeight(byte [] blockHash) Given a block hash, it queries the chain asynchronously for the block's height. Blocks until block height is retrieved.
public inline voidFetchLastHeight(Action< int, UInt64 > handler) Gets the height of the highest block in the local copy of the blockchain, asynchronously.
public inline Tuple< int, UInt64 >GetLastHeight() Gets the height of the highest block in the local copy of the blockchain, synchronously. It blocks until height is retrieved.
public inline voidFetchBlockByHash(byte [] blockHash,Action< int,Block> handler) Given a block hash, retrieve the full block it identifies, asynchronously.
public inline Tuple< int,Block, UInt64 >GetBlockByHash(byte [] blockHash) Given a block hash, get the full block it identifies, synchronously.
public inline voidFetchBlockByHeight(UInt64 height,Action< int,Block> handler) Given a block height, retrieve the full block it identifies, asynchronously.
public inline Tuple< int,Block, UInt64 >GetBlockByHeight(UInt64 height) Given a block height, get the full block it identifies, synchronously.
public inline voidFetchBlockHeaderByHash(byte [] blockHash,Action< int,Header> handler) Given a block hash, get the header from the block it identifies, asynchronously.
public inline Tuple< int,Header, UInt64 >GetBlockHeaderByHash(byte [] blockHash) Given a block hash, get the header from the block it identifies, synchronously.
public inline voidFetchBlockHeaderByHeight(UInt64 height,Action< int,Header> handler) Given a block height, get the header from the block it identifies, asynchronously.
public inline Tuple< int,Header, UInt64 >GetBlockHeaderByHeight(UInt64 height) Given a block height, get the header from the block it identifies, synchronously.
public inline voidFetchMerkleBlockByHash(byte [] blockHash,Action< int,MerkleBlock, UInt64 > handler) Given a block hash, get the merkle block from the block it identifies, asynchronously.
public inline Tuple< int,MerkleBlock, UInt64 >GetMerkleBlockByHash(byte [] blockHash) Given a block hash, get the merkle block from the block it identifies, synchronously.
public inline voidFetchMerkleBlockByHeight(UInt64 height,Action< int,MerkleBlock, UInt64 > handler) Given a block height, get the merkle block from the block it identifies, asynchronously.
public inline Tuple< int,MerkleBlock, UInt64 >GetMerkleBlockByHeight(UInt64 height) Given a block height, get the merkle block from the block it identifies, synchronously.
public inline voidFetchCompactBlockByHash(byte [] blockHash,Action< int, CompactBlock > handler) Given a block hash, get the compact block from the block it identifies, asynchronously.
public inline Tuple< int, CompactBlock, UInt64 >GetCompactBlockByHash(byte [] blockHash) Given a block hash, get the compact block from the block it identifies, synchronously.
public inline voidFetchCompactBlockByHeight(UInt64 height,Action< int, CompactBlock > handler) Given a block height, get the compact block from the block it identifies, asynchronously.
public inline Tuple< int, CompactBlock, UInt64 >GetCompactBlockByHeight(UInt64 height) Given a block height, get the compact block from the block it identifies, synchronously.
public inline voidFetchTransaction(byte [] txHash,bool requireConfirmed,Action< int,Transaction, UInt64, UInt64 > handler) Get a transaction by its hash, asynchronously.
public inline Tuple< int,Transaction, UInt64, UInt64 >GetTransaction(byte [] txHash,bool requireConfirmed) Get a transaction by its hash, synchronously.
public inline voidFetchTransactionPosition(byte [] txHash,bool requireConfirmed,Action< int, UInt64, UInt64 > handler) Given a transaction hash, it fetches the height and position inside the block, asynchronously.
public inline Tuple< int, UInt64, UInt64 >GetTransactionPosition(byte [] txHash,bool requireConfirmed) Given a transaction hash, it fetches the height and position inside the block, synchronously.
public inline voidFetchSpend(OutputPointoutputPoint,Action< int,Point> handler) Fetch the transaction input which spends the indicated output.
public inline voidFetchHistory(PaymentAddressaddress,UInt64 limit,UInt64 fromHeight,Action< int, HistoryCompactList > handler) Get a list of output points, values, and spends for a given payment address (asynchronously)
public inline Tuple< int, HistoryCompactList >GetHistory(PaymentAddressaddress,UInt64 limit,UInt64 fromHeight) Get a list of output points, values, and spends for a given payment address (synchronously)
public inline voidFetchStealth(Binaryfilter,UInt64 fromHeight,Action< int, StealthCompactList > handler) Get metadata on potential payment transactions by stealth filter. Given a filter and a height in the chain, it queries the chain for transactions matching the given filter.
public inline voidFetchBlockLocator(BlockIndexList indexes,Action< int,HeaderReader> handler) Given a list of indexes, fetch a header reader for them, asynchronously
public inline Tuple< int,HeaderReader>GetBlockLocator(BlockIndexList indexes) Given a list of indexes, fetch a header reader for them, synchronously
public inline voidSubscribeToBlockChain(Action< UInt64, BlockList, BlockList > handler) Be notified (called back) when the local copy of the blockchain is reorganized.
public inline voidSubscribeToTransaction(Action< UInt64, BlockList, BlockList > handler) Be notified (called back) when the local copy of the blockchain is updated at the transaction level.
public inline voidOrganizeBlock(Blockblock,Action< int > handler) Given a block, organize it (async).
public inline intOrganizeBlockSync(Blockblock) Given a block, organize it (sync).
public inline voidOrganizeTransaction(Transactiontransaction,Action< int > handler) Given a transaction, organize it (async).
public inline intOrganizeTransactionSync(Transactiontransaction) Given a transaction, organize it (sync)
public inline voidValidateTransaction(Transactiontransaction,Action handler) Determine if a transaction is valid for submission to the blockchain.

Members

public inline voidFetchBlockHeight(byte [] blockHash,Action< int, UInt64 > handler)

Given a block hash, it queries the chain asynchronously for the block's height. Return right away and uses a callback to return the result.

Parameters

  • blockHash 32-byte array representation of the block hash. Identifies it univocally.

  • handler Callback which will be invoked when the block height is found.

public inline Tuple< int, UInt64 >GetBlockHeight(byte [] blockHash)

Given a block hash, it queries the chain asynchronously for the block's height. Blocks until block height is retrieved.

Parameters

  • blockHash 32-byte array representation of the block hash. Identifies it univocally.

Returns

The block height

public inline voidFetchLastHeight(Action< int, UInt64 > handler)

Gets the height of the highest block in the local copy of the blockchain, asynchronously.

Parameters

  • handler Callback which will be called once the last height is retrieved.

public inline Tuple< int, UInt64 >GetLastHeight()

Gets the height of the highest block in the local copy of the blockchain, synchronously. It blocks until height is retrieved.

Returns

Error code (0 = success) and height

public inline voidFetchBlockByHash(byte [] blockHash,Action< int,Block> handler)

Given a block hash, retrieve the full block it identifies, asynchronously.

Parameters

  • blockHash 32 bytes of the block hash

  • handler Callback which will be called when the block is retrieved.

public inline Tuple< int,Block, UInt64 >GetBlockByHash(byte [] blockHash)

Given a block hash, get the full block it identifies, synchronously.

Parameters

  • blockHash 32 bytes of the block hash

Returns

Error code (0 = success) and full block

public inline voidFetchBlockByHeight(UInt64 height,Action< int,Block> handler)

Given a block height, retrieve the full block it identifies, asynchronously.

Parameters

  • height Block height

  • handler Callback which will be called when the block is retrieved.

public inline Tuple< int,Block, UInt64 >GetBlockByHeight(UInt64 height)

Given a block height, get the full block it identifies, synchronously.

Parameters

Returns

Error code (0 = success) and full block

public inline voidFetchBlockHeaderByHash(byte [] blockHash,Action< int,Header> handler)

Given a block hash, get the header from the block it identifies, asynchronously.

Parameters

  • blockHash 32 bytes of the block hash

  • handler Callback which will be called when the header is retrieved

public inline Tuple< int,Header, UInt64 >GetBlockHeaderByHash(byte [] blockHash)

Given a block hash, get the header from the block it identifies, synchronously.

Parameters

  • blockHash 32 bytes of the block hash

Returns

Error code (0 = success), full block header and block height

public inline voidFetchBlockHeaderByHeight(UInt64 height,Action< int,Header> handler)

Given a block height, get the header from the block it identifies, asynchronously.

Parameters

  • height Block height

  • handler Callback which will be invoked when the block header is retrieved

public inline Tuple< int,Header, UInt64 >GetBlockHeaderByHeight(UInt64 height)

Given a block height, get the header from the block it identifies, synchronously.

Parameters

Returns

Error code (0 = success), full block header, and height

public inline voidFetchMerkleBlockByHash(byte [] blockHash,Action< int,MerkleBlock, UInt64 > handler)

Given a block hash, get the merkle block from the block it identifies, asynchronously.

Parameters

  • blockHash 32 bytes of the block hash

  • handler Callback which will be invoked when the Merkle block is retrieved

public inline Tuple< int,MerkleBlock, UInt64 >GetMerkleBlockByHash(byte [] blockHash)

Given a block hash, get the merkle block from the block it identifies, synchronously.

Parameters

  • blockHash 32 bytes of the block hash

Returns

Error code (0 = success), full Merkle block and height

public inline voidFetchMerkleBlockByHeight(UInt64 height,Action< int,MerkleBlock, UInt64 > handler)

Given a block height, get the merkle block from the block it identifies, asynchronously.

Parameters

  • height Desired block height

  • handler Callback which will be invoked when the Merkle block is retrieved

public inline Tuple< int,MerkleBlock, UInt64 >GetMerkleBlockByHeight(UInt64 height)

Given a block height, get the merkle block from the block it identifies, synchronously.

Parameters

  • height Desired block height

Returns

Error code (0 = success), full Merkle block and height

public inline voidFetchCompactBlockByHash(byte [] blockHash,Action< int, CompactBlock > handler)

Given a block hash, get the compact block from the block it identifies, asynchronously.

Parameters

  • blockHash 32 bytes of the block hash

  • handler Callback which will be invoked when the compact block is retrieved

public inline Tuple< int, CompactBlock, UInt64 >GetCompactBlockByHash(byte [] blockHash)

Given a block hash, get the compact block from the block it identifies, synchronously.

Parameters

  • blockHash 32 bytes of the block hash

Returns

Error code (0 = success), full compact block and height

public inline voidFetchCompactBlockByHeight(UInt64 height,Action< int, CompactBlock > handler)

Given a block height, get the compact block from the block it identifies, asynchronously.

Parameters

  • height Desired block height

  • handler Callback which will be invoked when the compact block is retrieved

public inline Tuple< int, CompactBlock, UInt64 >GetCompactBlockByHeight(UInt64 height)

Given a block height, get the compact block from the block it identifies, synchronously.

Parameters

  • height Desired block height

Returns

Error code (0 = success), full compact block and height

public inline voidFetchTransaction(byte [] txHash,bool requireConfirmed,Action< int,Transaction, UInt64, UInt64 > handler)

Get a transaction by its hash, asynchronously.

Parameters

  • txHash 32 bytes of transaction hash

  • requireConfirmed True iif the transaction must belong to a block

  • handler Callback which will be invoked when the transaction is retrieved

public inline Tuple< int,Transaction, UInt64, UInt64 >GetTransaction(byte [] txHash,bool requireConfirmed)

Get a transaction by its hash, synchronously.

Parameters

  • txHash 32 bytes of transaction hash

  • requireConfirmed True iif the transaction must belong to a block

Returns

Error code (0 = success), full transaction, index inside block and height

public inline voidFetchTransactionPosition(byte [] txHash,bool requireConfirmed,Action< int, UInt64, UInt64 > handler)

Given a transaction hash, it fetches the height and position inside the block, asynchronously.

Parameters

  • txHash 32 bytes of transaction hash

  • requireConfirmed True iif the transaction must belong to a block

  • handler Callback which will be invoked when the transaction position is retrieved

public inline Tuple< int, UInt64, UInt64 >GetTransactionPosition(byte [] txHash,bool requireConfirmed)

Given a transaction hash, it fetches the height and position inside the block, synchronously.

Parameters

  • txHash 32 bytes of transaction hash

  • requireConfirmed True iif the transaction must belong to a block

Returns

Error code (0 = success), index in block (zero based) and block height

public inline voidFetchSpend(OutputPointoutputPoint,Action< int,Point> handler)

Fetch the transaction input which spends the indicated output.

Parameters

  • outputPoint Tx hash and index pair where the output was spent.

  • handler Callback which will be called when spend is retrieved

public inline voidFetchHistory(PaymentAddressaddress,UInt64 limit,UInt64 fromHeight,Action< int, HistoryCompactList > handler)

Get a list of output points, values, and spends for a given payment address (asynchronously)

Parameters

  • address Bitcoin payment address to search

  • limit Maximum amount of results to fetch

  • fromHeight Starting point to search for transactions

  • handler Callback which will be called when the history is retrieved

public inline Tuple< int, HistoryCompactList >GetHistory(PaymentAddressaddress,UInt64 limit,UInt64 fromHeight)

Get a list of output points, values, and spends for a given payment address (synchronously)

Parameters

  • address Bitcoin payment address to search

  • limit Maximum amount of results to fetch

  • fromHeight Starting point to search for transactions

Returns

Error code (0 = success), HistoryCompactList

public inline voidFetchStealth(Binaryfilter,UInt64 fromHeight,Action< int, StealthCompactList > handler)

Get metadata on potential payment transactions by stealth filter. Given a filter and a height in the chain, it queries the chain for transactions matching the given filter.

Parameters

  • filter Must be at least 8 bits in length. example "10101010"

  • fromHeight Starting height in the chain to search for transactions

  • handler Callback which will be called when the stealth list is retrieved

public inline voidFetchBlockLocator(BlockIndexList indexes,Action< int,HeaderReader> handler)

Given a list of indexes, fetch a header reader for them, asynchronously

Parameters

  • indexes Block indexes

  • handler Callback which will called when the reader is retrieved

public inline Tuple< int,HeaderReader>GetBlockLocator(BlockIndexList indexes)

Given a list of indexes, fetch a header reader for them, synchronously

Parameters

Returns

Error code (0 = success), HeaderReader

public inline voidSubscribeToBlockChain(Action< UInt64, BlockList, BlockList > handler)

Be notified (called back) when the local copy of the blockchain is reorganized.

Parameters

  • handler Callback which will be called when blocks are added or removed. The callback returns 3 parameters:

  • Height (UInt64): The chain height at which reorganization takes place

  • Incoming (Blocklist): Incoming blocks (added to the blockchain).

  • Outgoing (Blocklist): Outgoing blocks (removed from the blockchain).

public inline voidSubscribeToTransaction(Action< UInt64, BlockList, BlockList > handler)

Be notified (called back) when the local copy of the blockchain is updated at the transaction level.

Parameters

  • handler Callback which will be called when a transaction is added.

public inline voidOrganizeBlock(Blockblock,Action< int > handler)

Given a block, organize it (async).

Parameters

  • block The block to organize

  • handler Callback which will be called when organization is complete.

public inline intOrganizeBlockSync(Blockblock)

Given a block, organize it (sync).

Parameters

  • block The block to organize.

Returns

Error code (0 = success)

public inline voidOrganizeTransaction(Transactiontransaction,Action< int > handler)

Given a transaction, organize it (async).

Parameters

  • transaction The transaction to organize.

  • handler Callback which will be called when organization is complete.

public inline intOrganizeTransactionSync(Transactiontransaction)

Given a transaction, organize it (sync)

Parameters

  • transaction The transaction to organize

Returns

Error code (0 = success)

public inline voidValidateTransaction(Transactiontransaction,Action handler)

Determine if a transaction is valid for submission to the blockchain.

Parameters

  • transaction Transaction to validate

  • handler Callback which will be called when validation is complete.

class Bitprim::Executor

class Bitprim::Executor
  : public IDisposable

Controls the execution of the Bitprim bitcoin node.

Summary

Members Descriptions
public inlineExecutor(string configFile,int stdOut,int stdErr) Create executor. Does not init database or start execution yet.
public inlineExecutor(string configFile,IntPtr stdOut,IntPtr stdErr) = default Create executor. Does not init database or start execution yet.
public inline intInitChain() Initialize the local dabatase structure.
public inline intRun(Action< int > handler) Starts running the node; blockchain starts synchronizing (downloading). The call returns right away, and the handler is invoked when the node actually starts running.
public inline intRunWait() Starts running the node; blockchain start synchronizing (downloading). Call blocks until node starts running.
public inline voidStop() Stops the node; that includes all activies, such as synchronization and networking.

Members

public inlineExecutor(string configFile,int stdOut,int stdErr)

Create executor. Does not init database or start execution yet.

Parameters

  • configFile Path to configuration file.

  • stdOut File descriptor for redirecting standard output. If zero, output goes to debug file.

  • stdErr File descriptor for redirecting standard error output. If zero, output goes to error file.

public inlineExecutor(string configFile,IntPtr stdOut,IntPtr stdErr) = default

Create executor. Does not init database or start execution yet.

Parameters

  • configFile Path to configuration file.

  • stdOut Handle for redirecting standard output. If IntPtr.Zero, output goes to debug file.

  • stdErr Handle for redirecting standard output. If IntPtr.Zero, output goes to debug file.

public inline intInitChain()

Initialize the local dabatase structure.

Returns

public inline intRun(Action< int > handler)

Starts running the node; blockchain starts synchronizing (downloading). The call returns right away, and the handler is invoked when the node actually starts running.

Parameters

  • handler Callback which will be invoked when node starts running.

Returns

Error code (0 = success)

public inline intRunWait()

Starts running the node; blockchain start synchronizing (downloading). Call blocks until node starts running.

Returns

Error code (0 = success)

public inline voidStop()

Stops the node; that includes all activies, such as synchronization and networking.

class Bitprim::Header

class Bitprim::Header
  : public IDisposable

Represents a full Bitcoin blockchain block.

Summary

Members Descriptions

Members

class Bitprim::HeaderReader

class Bitprim::HeaderReader
  : public IDisposable

Helper for reading the header for each block in a specific set of blocks.

Summary

Members Descriptions
public inlineHeaderReader() Create an empty reader.
public inlineHeaderReader(HashList start,byte [] stop) Create a reader with predefined start hashes and stop hash.
public inline UInt64GetSerializedSize(UInt32 version) The sum of the header sizes for this set.
public inline voidReset() Go back to first block in the set.

Members

public inlineHeaderReader()

Create an empty reader.

public inlineHeaderReader(HashList start,byte [] stop)

Create a reader with predefined start hashes and stop hash.

Parameters

  • start When all of these blocks are synced, start reading.

  • stop Stop at this block.

public inline UInt64GetSerializedSize(UInt32 version)

The sum of the header sizes for this set.

Parameters

  • version Protocol version to consider when calculating header size.

Returns

Sum of header sizes.

public inline voidReset()

Go back to first block in the set.

class Bitprim::Input

class Bitprim::Input
  : public IDisposable

Represents a Transaction input.

Summary

Members Descriptions
public inlineInput() Create an empty input.
public inlineInput(OutputpreviousOutput,Scriptscript,UInt32 sequence) Create an input from a previous output, a script and a sequence number.
public inline UIntPtrGetSerializedSize(bool wire) Input size in bytes.
public inline UIntPtrGetSignatureOperationsCount(bool bip16Active) Total amount of sigops (signature operations) in the input script.

Members

public inlineInput()

Create an empty input.

public inlineInput(OutputpreviousOutput,Scriptscript,UInt32 sequence)

Create an input from a previous output, a script and a sequence number.

Parameters

  • previousOutput The output to spend.

  • script Input script.

  • sequence Zero-based, indexes this input in the input set.

public inline UIntPtrGetSerializedSize(bool wire)

Input size in bytes.

Parameters

  • wire Iif true, consider 4 extra bytes from wire field.

Returns

Size in bytes.

public inline UIntPtrGetSignatureOperationsCount(bool bip16Active)

Total amount of sigops (signature operations) in the input script.

Parameters

  • bip16Active Iif true, count BIP 16 active sig ops

Returns

Sigops count.

class Bitprim::Logger

Summary

Members Descriptions

Members

class Bitprim::MerkleBlock

class Bitprim::MerkleBlock
  : public IDisposable

Merkle tree representation of a blockchain block.

Summary

Members Descriptions
public inline byte []GetNthHash(int n) Get the Nth transaction hash from the block.
public inline UInt64GetSerializedSize(UInt32 version) Block size in bytes (as a Merkle block, not as a full block).
public inline voidReset() Delete all the data inside the block.

Members

public inline byte []GetNthHash(int n)

Get the Nth transaction hash from the block.

Parameters

  • n Zerp-based index.

Returns

Transaction hash in 32 byte array format.

public inline UInt64GetSerializedSize(UInt32 version)

Block size in bytes (as a Merkle block, not as a full block).

Parameters

  • version Protocol version to consider when calculating size.

Returns

Size in bytes.

public inline voidReset()

Delete all the data inside the block.

class Bitprim::Output

class Bitprim::Output
  : public IDisposable

Represents one of the outputs of a Transaction.

Summary

Members Descriptions
public inlineOutput() Create an empty output.
public inlineOutput(UInt64 value,Scriptscript) Create an output from a value and a script.
public inline UIntPtrGetSerializedSize(bool wire) Output size in bytes.

Members

public inlineOutput()

Create an empty output.

public inlineOutput(UInt64 value,Scriptscript)

Create an output from a value and a script.

Parameters

  • value In Satoshis.

  • script Output script.

public inline UIntPtrGetSerializedSize(bool wire)

Output size in bytes.

Parameters

  • wire If true, size will include size of 'uint32' for storing spender height.

Returns

Size in bytes.

class Bitprim::OutputPoint

class Bitprim::OutputPoint
  : public IDisposable

Transaction hash and index pair representing one of the transaction outputs.

Summary

Members Descriptions
public inlineOutputPoint() Create an empty output point.
public inlineOutputPoint(byte [] pointHash,UInt32 index) Create an output point from a hash and index pair.

Members

public inlineOutputPoint()

Create an empty output point.

public inlineOutputPoint(byte [] pointHash,UInt32 index)

Create an output point from a hash and index pair.

Parameters

  • pointHash
  • index

class Bitprim::PaymentAddress

class Bitprim::PaymentAddress
  : public IDisposable

Represents a Bitcoin wallet address.

Summary

Members Descriptions
public inlinePaymentAddress(string hexString) Create an address from its hex string representation.

Members

public inlinePaymentAddress(string hexString)

Create an address from its hex string representation.

Parameters

  • hexString

class Bitprim::Point

Represents one of the transaction inputs. It's a transaction hash and index pair.

Summary

Members Descriptions

Members

class Bitprim::Script

class Bitprim::Script
  : public IDisposable

Represents a transaction script.

Summary

Members Descriptions
public inline stringToString(UInt32 activeForks) Translate operations in the script to a string.
public inline UIntPtrGetEmbeddedSigOps(ScriptprevOutScript) Count the sigops in the embedded script using BIP16 rules.
public inline UIntPtrGetSigOps(bool embedded) Amount of signature operations in the script.

Members

public inline stringToString(UInt32 activeForks)

Translate operations in the script to a string.

Parameters

  • activeForks Tells which rule is active.

Returns

Human readable script.

public inline UIntPtrGetEmbeddedSigOps(ScriptprevOutScript)

Count the sigops in the embedded script using BIP16 rules.

Parameters

  • prevOutScript Reference to previous output script.

Returns

Embedded sigops count.

public inline UIntPtrGetSigOps(bool embedded)

Amount of signature operations in the script.

Parameters

  • embedded Iif true, consider this an embedded script.

Returns

Sigops count.

class Bitprim::StealthCompact

class Bitprim::StealthCompact
  : public IDisposable

Stealth payment related data.

Summary

Members Descriptions

Members

class Bitprim::Transaction

class Bitprim::Transaction
  : public IDisposable

Represents a Bitcoin transaction.

Summary

Members Descriptions
public inlineTransaction() Create an empty tramsaction.
public inlineTransaction(string hexString) Create a transaction from its binary hex representation.
public inlineTransaction(UInt32 version,UInt32 locktime,InputList inputs,OutputList outputs) Create a transaction from its version, locktime, inputs and outputs (all its data).
public inline byte []GetHashBySigHashType(UInt32 sigHashType) 32 bytes transaction hash + 4 bytes signature hash type
public inline boolIsDoubleSpend(bool includeUnconfirmed) Returns true if at least one of the previous outputs was already spent, false otherwise.
public inline boolIsFinal(UInt64 blockHeight,UInt32 blockTime) Returns true if and only if the transaction is final, false otherwise.
public inline boolIsImmature(UInt64 targetHeight) Returns true if and only if at least one of the inputs is not mature, false otherwise.
public inline UInt64GetSerializedSize(bool wire) Transaction size in bytes.
public inline UInt64GetSignatureOperationsBip16Active(bool bip16Active) Amount of signature operations in the transactions.

Members

public inlineTransaction()

Create an empty tramsaction.

public inlineTransaction(string hexString)

Create a transaction from its binary hex representation.

Parameters

  • hexString

public inlineTransaction(UInt32 version,UInt32 locktime,InputList inputs,OutputList outputs)

Create a transaction from its version, locktime, inputs and outputs (all its data).

Parameters

  • version Transaction protocol version.

  • locktime Transaction locktime.

  • inputs A list with all the transaction inputs.

  • outputs A list with all the transaction outputs.

public inline byte []GetHashBySigHashType(UInt32 sigHashType)

32 bytes transaction hash + 4 bytes signature hash type

Parameters

  • sigHashType Sighash type.

Returns

Hash and sighash type.

public inline boolIsDoubleSpend(bool includeUnconfirmed)

Returns true if at least one of the previous outputs was already spent, false otherwise.

Parameters

  • includeUnconfirmed Iif true, consider unconfirmed transactions.

Returns

True if and only if transaction is double spend.

public inline boolIsFinal(UInt64 blockHeight,UInt32 blockTime)

Returns true if and only if the transaction is final, false otherwise.

Parameters

  • blockHeight
  • blockTime

Returns

public inline boolIsImmature(UInt64 targetHeight)

Returns true if and only if at least one of the inputs is not mature, false otherwise.

Parameters

  • targetHeight

Returns

public inline UInt64GetSerializedSize(bool wire)

Transaction size in bytes.

Parameters

  • wire If and only if true, size will include size of 'uint32' for storing spender output height

Returns

Size in bytes.

public inline UInt64GetSignatureOperationsBip16Active(bool bip16Active)

Amount of signature operations in the transactions.

Parameters

  • bip16Active True if and only if BIP16 is active, false otherwise.

Returns

class Constants

Summary

Members Descriptions
public const stringBITPRIM_C_LIBRARY
public const stringCONFIG_FILE

Members

public const stringBITPRIM_C_LIBRARY

public const stringCONFIG_FILE

Generated by Moxygen

results matching ""

    No results matching ""