BlockchainBlockData(for Ethereum)

$BlockchainBase = "Ethereum"

BlockchainBlockData["hash"]

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

BlockchainBlockData[n]

gives information about block n on the Ethereum blockchain.

BlockchainBlockData[-n]

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

BlockchainBlockData[bspec,prop]

gives the specified property of the block.

Details

  • BlockchainBlockData[-1] gives information on the latest Ethereum block.
  • Properties include:
  • "BlockHash"hash of this block
    "BlockNumber"number (height) of this block in the Ethereum blockchain
    "Timestamp"time when this block was mined
    "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
    "TotalTransactions"total number of transactions in this block
    "TransactionList"list of transaction IDs in this block
  • Possible options include:
  • BlockchainBaseAutomaticsets the blockchain and its network
    MaxItemsAllthe maximum number of items to return
  • BlockchainBlockData can access the Ethereum mainnet (default) and testnet. To specify these networks, use the BlockchainBase option.
  • The setting for MaxItems specifies the maximum number of transactions to include in the result.

Examples

open allclose all

Basic Examples  (6)

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

Get the latest block of the Ethereum testnet blockchain:

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

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

Get a property from an Ethereum block:

Get multiple properties from an Ethereum block:

Scope  (11)

BlockHash  (1)

Get the block hash of an Ethereum block:

BlockNumber  (1)

Get the height hash of an Ethereum block:

ByteCount  (1)

Get the number of bytes of an Ethereum block:

Confirmations  (1)

Get the number of confirmations of an Ethereum block:

MerkleRoot  (1)

Get the Merkle root of an Ethereum block:

Nonce  (1)

Get the nonce used in the hash of an Ethereum block:

PreviousBlockHash  (1)

Get the block hash of the preceding Ethereum block:

Timestamp  (1)

Get the time when an Ethereum block was mined:

TotalTransactions  (1)

Get the total number of transactions included in an Ethereum block:

TransactionList  (1)

Get the list of transactions included in an Ethereum block:

Version  (1)

Get the version of an Ethereum block:

Options  (3)

BlockchainBase  (2)

Mainnet  (1)

Get information from a random Ethereum mainnet block:

Testnet  (1)

Get information from a random Ethereum testnet block:

MaxItems  (1)

Get the first 5 transactions from the latest Ethereum block:

Applications  (2)

Get the size of the latest Ethereum block in megabytes:

Get a random transaction included in an Ethereum block:

Possible Issues  (2)

Nonexistent Hashes  (1)

Using a block hash from one blockchain in another blockchain will return a Missing output:

Incorrect Hashes  (1)

Providing a block hash that is not a hex number will return a $Failed output:

Neat Examples  (1)

Generate sounds from an Ethereum block:

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

Text

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

BibTeX

@misc{reference.wolfram_2021_blockchainblockdata, author="Wolfram Research", title="{BlockchainBlockData}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainBlockData-Ethereum.html}", note=[Accessed: 21-September-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_blockchainblockdata, organization={Wolfram Research}, title={BlockchainBlockData}, year={2019}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainBlockData-Ethereum.html}, note=[Accessed: 21-September-2021 ]}

CMS

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

APA

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