BlockchainBlockData(for Bitcoin)

$BlockchainBase = "Bitcoin"

BlockchainBlockData["hash"]

gives information about the block with the specified hash on the Bitcoin blockchain.

BlockchainBlockData[n]

gives information about block n on the Bitcoin blockchain.

BlockchainBlockData[-n]

gives information about the block n elements from the end of the Bitcoin blockchain.

BlockchainBlockData[bspec,prop]

gives the specified property of the block.

Details

  • BlockchainBlockData[-1] gives information on the latest Bitcoin block.
  • Properties include:
  • "BlockHash"hash of this block
    "BlockNumber"number (height) of this block in the Bitcoin blockchain
    "TimeMined"time this block was mined
    "Amounts"amount information for this block
    "ByteCount"byte count for this block
    "Nonce"nonce used in the hash for this block
    "Version"version of the block
    "Confirmations"number of confirmations
    "PreviousBlockHash"hash of the previous block
    "MerkleRoot"Merkle root hash of the transactions
    "TransactionList"list of transaction IDs in this block
  • "Amounts" gives an association with the following properties as its keys:
  • "BlockReward"reward for mining this block
    "TotalFee"sum of all the fees in this block's transactions
    "TotalInput"sum of all the input amounts in this block's transactions
    "TotalOutput"sum of all the output amounts in this block's transactions
  • BlockchainBlockData can access the Bitcoin mainnet (default) and testnet. To specify these networks, use the BlockchainBase option.

Examples

open all close all

Basic Examples  (5)

Get information about a block from the Bitcoin blockchain using its height:

In[1]:=
Click for copyable input
Out[1]=

Get the latest block of the Bitcoin testnet blockchain:

In[1]:=
Click for copyable input
Out[1]=

Use a block hash to get information about a Bitcoin block:

In[1]:=
Click for copyable input
Out[1]=

Get multiple Bitcoin blocks by providing a list of heights or block hashes:

In[1]:=
Click for copyable input
Out[1]=

Get multiple properties from a Bitcoin block:

In[1]:=
Click for copyable input
Out[1]=

Scope  (11)

Options  (2)

Applications  (2)

Possible Issues  (2)

Neat Examples  (1)

Introduced in 2019
(12.0)