BlockchainTransactionData(for Bitcoin)

$BlockchainBase = "Bitcoin"

BlockchainTransactionData[txid]

gives information about the blockchain transaction with ID txid on the Bitcoin blockchain.

BlockchainTransactionData[txid,prop]

gives the specified property of the transaction.

Details

  • Properties include:
  • "TransactionID"transaction ID
    "BlockHash"hash of the block containing the transaction
    "BlockNumber"height of the block containing the transaction
    "Confirmations"blocks confirming the block containing the transaction
    "Timestamp"timestamp for the transaction
    "LockTime"earliest time or block when the transaction may be added
    "Version"transaction version number
    "TotalInput"total number of bitcoins associated with the inputs of this transaction
    "TotalOutput"total number of bitcoins associated with the outputs of this transaction
    "Fee"fee paid for this transaction
    "ByteCount"transaction size in bytes
    "Inputs"transaction input data
    "Outputs"transaction output data
  • The value of "Inputs" is a list of associations with typical elements including:
  • "TransactionID"hash of a previous transaction
    "Index"index within the previous transaction output
    "Amount"source amount
    "ScriptByteArray"script for the transaction as a byte array
    "ScriptString"script as a string
    "SequenceNumber"sequence number of this transaction
    "Addresses"public hashes for source addresses
    "SourceConfirmations"number of confirmations of the transaction generating this input
  • The value of "Outputs" is a list of associations with elements including:
  • "Amount"transferred amount
    "ScriptByteArray"script for the transaction as a byte array
    "ScriptString"script as a string
    "Addresses"public hashes for destination addresses
    "SpentQ"True if this output has been spent
    "DestinationTransaction"hash of the transaction that spent this output
  • BlockchainTransactionData can access the Bitcoin mainnet (default) and testnet. To specify these networks, use the BlockchainBase option.

Examples

open allclose all

Basic Examples  (4)

Get information about a transaction from the Bitcoin blockchain:

Get data from multiple Bitcoin transactions by providing a list of transaction IDs:

Get the amount included in a transaction's outputs:

Get multiple properties from a Bitcoin transaction:

Scope  (13)

BlockHash  (1)

Get the hash of the block containing a Bitcoin transaction:

BlockNumber  (1)

Get the height of the block containing a Bitcoin transaction:

ByteCount  (1)

Get the size in bytes of a Bitcoin transaction:

Confirmations  (1)

Get the confirmations of the block containing a Bitcoin transaction:

Fee  (1)

Get the fee included in a Bitcoin transaction:

Inputs  (1)

Get the inputs of a Bitcoin transaction:

LockTime  (1)

Get the locktime of a Bitcoin transaction:

Outputs  (1)

Get the outputs of a Bitcoin transaction:

Timestamp  (1)

Get the timestamp of a Bitcoin transaction:

TotalInput  (1)

Get the total amount of bitcoins that funded a Bitcoin transaction:

TotalOutput  (1)

Get the total amount of bitcoins exchanged in a Bitcoin transaction:

TransactionID  (1)

Get the transaction ID that matches the provided one:

Version  (1)

Get the version of a Bitcoin transaction:

Options  (2)

BlockchainBase  (2)

Mainnet  (1)

Get information from a Bitcoin mainnet transaction:

Testnet  (1)

Get information from a Bitcoin testnet transaction:

Applications  (1)

Get information on the most recent Bitcoin block:

Randomly select a transaction from this block:

Get detailed information for this transaction:

Convert the transaction output amount to fiat currency using the current price:

Possible Issues  (2)

Nonexistent Hashes  (1)

Using a transaction ID from one blockchain in another blockchain will return a Missing output:

Incorrect Hashes  (1)

Providing a transaction ID that is not a hex number will return a $Failed output:

Neat Examples  (1)

Use the Bitcoin blockchain:

Find the input script byte array for the coinbase transaction of block 416,236:

The raw bytes include some readable characters:

Wolfram Research (2019), BlockchainTransactionData, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-Bitcoin.html.

Text

Wolfram Research (2019), BlockchainTransactionData, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-Bitcoin.html.

CMS

Wolfram Language. 2019. "BlockchainTransactionData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-Bitcoin.html.

APA

Wolfram Language. (2019). BlockchainTransactionData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-Bitcoin.html

BibTeX

@misc{reference.wolfram_2021_blockchaintransactiondata, author="Wolfram Research", title="{BlockchainTransactionData}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-Bitcoin.html}", note=[Accessed: 24-May-2022 ]}

BibLaTeX

@online{reference.wolfram_2021_blockchaintransactiondata, organization={Wolfram Research}, title={BlockchainTransactionData}, year={2019}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-Bitcoin.html}, note=[Accessed: 24-May-2022 ]}