---
title: "BlockchainBlockData"
language: "en"
type: "Symbol"
summary: "BlockchainBlockData[hash] gives information about the block with the specified hash on the bloxberg blockchain. BlockchainBlockData[n] gives information about block n on the bloxberg blockchain. BlockchainBlockData[-n] gives information about the block n elements from the end of the bloxberg blockchain. BlockchainBlockData[bspec, prop] gives the specified property of the block."
keywords: 
- blockchain
- block
- ethereum
- eth
- cryptocurrency
- cryptocurrencies
- bloxberg
- berg
canonical_url: "https://reference.wolfram.com/language/ref/blockchain/BlockchainBlockData-bloxberg.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Working with bloxberg Blockchain"
    link: "https://reference.wolfram.com/language/guide/Blockchain-bloxberg.en.md"
---
[EXPERIMENTAL]

# BlockchainBlockData (for bloxberg)

BlockchainBlockData["hash"] gives information about the block with the specified hash on the bloxberg blockchain.

BlockchainBlockData[n] gives information about block n on the bloxberg blockchain.

BlockchainBlockData[-n] gives information about the block n elements from the end of the bloxberg blockchain.

BlockchainBlockData[bspec, prop] gives the specified property of the block.

## Details

* ``BlockchainBlockData[-1]`` gives information on the latest bloxberg block.

* Properties include:

|                     |                                                          |
| ------------------- | -------------------------------------------------------- |
| "BlockHash"         | hash of this block                                       |
| "BlockNumber"       | number (height) of this block in the bloxberg blockchain |
| "Timestamp"         | time when this block was validated                       |
| "ValidatorAddress"  | validator address                                        |
| "ValidatorName"     | validator name                                           |
| "ByteCount"         | byte count for this block                                |
| "Confirmations"     | number of confirmations                                  |
| "GasUsed"           | total used gas by all transactions in this block         |
| "GasLimit"          | maximum gas allowed in this block                        |
| "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:

|                 |           |                                       |
| --------------- | --------- | ------------------------------------- |
| BlockchainBase  | Automatic | sets the blockchain and its network   |
| MaxItems        | All       | the maximum number of items to return |

* ``BlockchainBlockData`` can access the bloxberg blockchain. To specify this network, use the ``BlockchainBase`` option.

* The setting for ``MaxItems`` specifies the maximum number of transactions to include in the result.

---

## Examples (25)

### Basic Examples (5)

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

```wl
In[1]:= BlockchainBlockData[4565556, BlockchainBase -> "Bloxberg"]//Dataset

Out[1]=
Dataset[Association["BlockHash" -> 
   "c4b7af7ad047748cb0f510e39b1ab8dc69050e830a1dd38b52242851dbf3df90", "BlockNumber" -> 4565556, 
  "Timestamp" -> DateObject[{2020, 1, 2, 4, 37, 45.}, "Instant", "Gregorian", -5.], 
  "ValidatorAddress" -> "F0f6 ... c4ebe8687ad34ff07a18a2a6", 
    "7d3cdd92c54ebd53a8478f3d47c4e569bf6b9fde72233613d9f8ec214762b3db", 
    "b9d725294da1dc03701b366379e5e47f6b496f65876bf6dccf9d475b22f577dd", 
    "d22b741f045de400f16e9fa3fcf70ea8b45084a55e253e8c7d8e6351b323d4d4"}]]
```

---

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

```wl
In[1]:= BlockchainBlockData["9cf1066e73dad4377b4f75171927f0cc7c095834d85b56348fcddddeb50808d9", BlockchainBase -> "Bloxberg"]//Dataset

Out[1]=
Dataset[Association["BlockHash" -> 
   "9cf1066e73dad4377b4f75171927f0cc7c095834d85b56348fcddddeb50808d9", "BlockNumber" -> 6301259, 
  "Timestamp" -> DateObject[{2020, 5, 5, 14, 50, 10.}, "Instant", "Gregorian", -5.], 
  "ValidatorAddress" -> "60B ... > 10000000, 
  "PreviousBlockHash" -> "e7178ea403734a0a85bde9d1a910954e88f9e25f7820970ac05c91762fd7b57a", 
  "MerkleRoot" -> "b609ee0bc4b7f5c18ce9150b7ac26627f958f0ac85a902c5fc3b0fa48b28b90b", 
  "TotalTransactions" -> 0, "TransactionList" -> {}]]
```

---

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

```wl
In[1]:= BlockchainBlockData[{1, 123456, "07828285d1c6bb0d6355fe8b786d8a161777ee5982ad74deb4f29b01b65a9b34"}, BlockchainBase -> "Bloxberg"]//Dataset

Out[1]=
Dataset[
 {Association["BlockHash" -> "49c1f76cb8bdd8d0d36d8d8d10b066af3f6cb94071cc83153fd0a9277949d208", 
   "BlockNumber" -> 1, "Timestamp" -> DateObject[{2019, 1, 10, 2, 55, 20.}, "Instant", "Gregorian", 
     -5.], "ValidatorAddress" -> "aA8437 ... 310f8e34ab1b4da17783", 
     "46c3ff35046ce081ed2680a024b55dc51cf2867433443fc2fbb22e34bd517f36", 
     "8835dce6f726cefdd403ed1a38b3af13f87878960d30ddfab5963201b579a63f", 
     "47579d4cfa5beb948628f1e85fafa5708394e310475974a86737ee5ae51d13e6"}]}]
```

---

Get a property from an bloxberg block:

```wl
In[1]:= BlockchainBlockData[500000, "BlockHash", BlockchainBase -> "Bloxberg"]

Out[1]= "f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1"
```

---

Get multiple properties from a bloxberg block:

```wl
In[1]:= BlockchainBlockData[6000000, {"Timestamp", "ValidatorAddress", "PreviousBlockHash"}, BlockchainBase -> "Bloxberg"]

Out[1]= {DateObject[{2020, 4, 14, 21, 2, 50.}, "Instant", "Gregorian", -5.], "c463396d13C115A443c1989b883823FA538371e5", "161f79ebbbd140133ff3d95506495d47fd0e3db3fc69d9d559098f08209129ab"}
```

### Scope (13)

#### BlockHash (1)

Get the block hash of a bloxberg block:

```wl
In[1]:= BlockchainBlockData[500000, "BlockHash", BlockchainBase -> "Bloxberg"]

Out[1]= "f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1"
```

#### BlockNumber (1)

Get the height hash of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "BlockNumber", BlockchainBase -> "Bloxberg"]

Out[1]= 500000
```

#### ByteCount (1)

Get the number of bytes of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "ByteCount", BlockchainBase -> "Bloxberg"]

Out[1]= 588
```

#### Confirmations (1)

Get the number of confirmations of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "Confirmations", BlockchainBase -> "Bloxberg"]

Out[1]= 7779048
```

#### GasLimit (1)

Get the gas limit of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "GasLimit", BlockchainBase -> "Bloxberg"]

Out[1]= 8000000
```

#### GasUsed (1)

Get the gas used of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "GasUsed", BlockchainBase -> "Bloxberg"]

Out[1]= 0
```

#### MerkleRoot (1)

Get the Merkle root of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "MerkleRoot", BlockchainBase -> "Bloxberg"]

Out[1]= "67e129938a0ec859c8d2bbdeda03aa5eefb5223709072c656cf7564b56e7814d"
```

#### PreviousBlockHash (1)

Get the block hash of the preceding bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "PreviousBlockHash", BlockchainBase -> "Bloxberg"]

Out[1]= "e5da6a7d5977cedaceaa499bdec8ea7e2053c2f7738e1b999ae1553ded17bbdd"
```

#### Timestamp (1)

Get the time a bloxberg block was mined:

```wl
In[1]:= BlockchainBlockData[1, "Timestamp", BlockchainBase -> "Bloxberg"]

Out[1]= DateObject[{2019, 1, 10, 2, 55, 20.}, "Instant", "Gregorian", -5.]
```

#### TotalTransactions (1)

Get the total number of transactions included in a bloxberg block:

```wl
In[1]:= BlockchainBlockData[5000000, "TotalTransactions", BlockchainBase -> "Bloxberg"]

Out[1]= 5
```

#### TransactionList (1)

Get the list of transactions included in a bloxberg block:

```wl
In[1]:= BlockchainBlockData[5000000, "TransactionList", BlockchainBase -> "Bloxberg"]//Shallow

Out[1]//Shallow= {"2388212cd6965380a1ece5b448b459a075e4b2406a7e866c9318e33dcc699b39", "1cf42d8c4ee37653cf71c6dab075ed4d1e30e85bcedf310f8e34ab1b4da17783", "46c3ff35046ce081ed2680a024b55dc51cf2867433443fc2fbb22e34bd517f36", "8835dce6f726cefdd403ed1a38b3af13f87878960d30ddfab5963201b579a63f", "47579d4cfa5beb948628f1e85fafa5708394e310475974a86737ee5ae51d13e6"}
```

#### ValidatorAddress (1)

Get the version of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "ValidatorAddress", BlockchainBase -> "Bloxberg"]

Out[1]= "aA84378fA41da83a9B6523bA46E45A664FbEBFC8"
```

#### ValidatorName (1)

Get the version of a bloxberg block:

```wl
In[1]:= BlockchainBlockData["f3eba7059d84e92beaa9662d636efec5068f2bdb2f91532041d256d9c6eef4a1", "ValidatorName", BlockchainBase -> "Bloxberg"]

Out[1]= "Max Planck Society"
```

### Options (2)

#### BlockchainBase (1)

##### Bloxberg (1)

---

Get information from a random bloxberg block:

```wl
In[1]:= BlockchainBlockData[RandomInteger[3000000], BlockchainBase -> "Bloxberg"]//Dataset

Out[1]=
Dataset[Association["BlockHash" -> 
   "a37d9c714d09b70dd9973d36f389098e4d7200d59e31f0e2fb9e720e70cbb104", "BlockNumber" -> 2841799, 
  "Timestamp" -> DateObject[{2019, 8, 3, 17, 43, 50.}, "Instant", "Gregorian", -5.], 
  "ValidatorAddress" -> "2fa ... -> 8000000, 
  "PreviousBlockHash" -> "52a81d1f52a893ae09f78c83688bffb9e9e57ff6a9cd079cdab10fb023763393", 
  "MerkleRoot" -> "a32830ace2005108c7a237d10ebd824fc6d37fc4439e3469fd6865284c4c7a5d", 
  "TotalTransactions" -> 0, "TransactionList" -> {}]]
```

#### MaxItems (1)

Get the first 5 transactions from the latest bloxberg block:

```wl
In[1]:= BlockchainBlockData[5000000, "TransactionList", BlockchainBase -> "Bloxberg", MaxItems -> 2]

Out[1]= {"2388212cd6965380a1ece5b448b459a075e4b2406a7e866c9318e33dcc699b39", "1cf42d8c4ee37653cf71c6dab075ed4d1e30e85bcedf310f8e34ab1b4da17783"}
```

### Applications (2)

Get the size of the latest bloxberg block in megabytes:

```wl
In[1]:= UnitConvert[Quantity[BlockchainBlockData[-1, "ByteCount", BlockchainBase -> "Bloxberg"], "Bytes"], "Megabytes"]//N

Out[1]= Quantity[0.000588, "Megabytes"]
```

---

Get a random transaction included in a bloxberg block:

```wl
In[1]:= RandomChoice[BlockchainBlockData[5000000, "TransactionList", BlockchainBase -> "Bloxberg"]]

Out[1]= "8835dce6f726cefdd403ed1a38b3af13f87878960d30ddfab5963201b579a63f"
```

### Possible Issues (2)

#### Nonexistent Hashes (1)

Using a block hash that does not exist in the blockchain will return a ``Missing`` output:

```wl
In[1]:= blxBlockHash = BlockchainBlockData[-1, "BlockHash", BlockchainBase -> "Bloxberg"]

Out[1]= "6e0988bf8a5efab87f7308eff1520ae3ee84d89add0d7ebf78c0bfdce8650c86"

In[2]:= BlockchainBlockData[StringJoin[RandomSample[Characters[blxBlockHash]]], BlockchainBase -> "Bloxberg"]
```

BlockchainBlockData::misserr: Block f85f09fc78690eebf8d00df8672ebb08b638fadea40d8ee8da1e5eac58c8f377 does not exist on the bloxberg blockchain.

```wl
Out[2]= Missing["NotAvailable"]
```

#### Incorrect Hashes (1)

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

```wl
In[1]:= BlockchainBlockData["6h6h6h6h", BlockchainBase -> "Bloxberg"]
```

BlockchainBlockData::invprm: 6h6h6h6h is not a valid block hash.

```wl
Out[1]= $Failed
```

### Neat Examples (1)

Generate sounds from a bloxberg block:

```wl
In[1]:= Sound[SoundNote[#, # * 0.04, "Taiko"]& /@ Take[Flatten[ToCharacterCode[BlockchainBlockData[5000000, "TransactionList", BlockchainBase -> "Bloxberg"]]] - 60, 100]]

Out[1]=
Sound[{SoundNote[-10, -0.4, "Taiko"], SoundNote[-9, -0.36, "Taiko"], SoundNote[-4, -0.16, "Taiko"], 
  SoundNote[-4, -0.16, "Taiko"], SoundNote[-10, -0.4, "Taiko"], SoundNote[-11, -0.44, "Taiko"], 
  SoundNote[-10, -0.4, "Taiko"], SoundNote[39, 1.5 ... "Taiko"], 
  SoundNote[40, 1.6, "Taiko"], SoundNote[-8, -0.32, "Taiko"], SoundNote[40, 1.6, "Taiko"], 
  SoundNote[-11, -0.44, "Taiko"], SoundNote[41, 1.6400000000000001, "Taiko"], 
  SoundNote[-9, -0.36, "Taiko"], SoundNote[-12, -0.48, "Taiko"]}]
```

## See Also

* [`BlockchainBase`](https://reference.wolfram.com/language/ref/BlockchainBase.en.md)
* [`\$BlockchainBase`](https://reference.wolfram.com/language/ref/$BlockchainBase.en.md)
* [`BlockchainPut`](https://reference.wolfram.com/language/ref/BlockchainPut.en.md)
* [`BlockchainGet`](https://reference.wolfram.com/language/ref/BlockchainGet.en.md)
* [`Hash`](https://reference.wolfram.com/language/ref/Hash.en.md)
* [`BlockchainData`](https://reference.wolfram.com/language/ref/blockchain/BlockchainData-bloxberg.en.md)
* [`BlockchainTransactionData`](https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionData-bloxberg.en.md)
* [`BlockchainAddressData`](https://reference.wolfram.com/language/ref/blockchain/BlockchainAddressData-bloxberg.en.md)

## Related Guides

* [Working with bloxberg Blockchain](https://reference.wolfram.com/language/guide/Blockchain-bloxberg.en.md)

## History

* [Introduced in 2020 (12.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn121.en.md)