Blocks

Get a block by hash in either .json or .bin format.

GET /block/<hash>.<format>

Response

Returns the block including all its transactions.

Field Description Example
hash Hash of the block header "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee"
ver Block Version 1
prev_block Hash of the previous block this one builds upon "000000002a22cfee1f2c846adbd12b3e183d4f97683f85dad08a79780a84bd55"
next_block Hash of the next (main-chain) block that builds upon this one "00000000c9ec538cab7f38ef9c67a95742f56ab07b0a37c5be6b02808dbfb4e0"
mrkl_root Merkle Root used to connect transactions to the block header "7dac2c5666815c17a3b36427de37bb9d2e2c5ccec3f8633eb91a4205cb4c10ff"
time Unix Timestamp when the block was created. Note: This may vary up to a few hours! 1231731025
bits Encoded difficulty target this block satisfies 486604799
nonce Number-to-be-used-once; This value is incremented when mining 1889418792
n_tx Number of transactions included in this block 2
size Size of the block in bytes 490
tx List of transactions see Tx API

Error

When there is no block with the specified hash, the response will include an "error" message.

Example

curl http://namecoin.webbtc.com/block/00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee.json
{
  "hash":"00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee",
  "ver":1,
  "prev_block":"000000002a22cfee1f2c846adbd12b3e183d4f97683f85dad08a79780a84bd55",
  "mrkl_root":"7dac2c5666815c17a3b36427de37bb9d2e2c5ccec3f8633eb91a4205cb4c10ff",
  "time":1231731025,
  "bits":486604799,
  "nonce":1889418792,
  "n_tx":2,
  "size":490,
  "tx":[
    {
      "hash":"b1fea52486ce0c62bb442b530a3f0132b826c74e473d1f2c220bfa78111c5082",
      "ver":1,
      "vin_sz":1,
      "vout_sz":1,
      "lock_time":0,
      "size":134,
      "in":[
        {
          "prev_out":{
            "hash":"0000000000000000000000000000000000000000000000000000000000000000",
            "n":4294967295
          },
          "coinbase":"04ffff001d0102"
        }
      ],
      "out":[
        {
          "value":"50.00000000",
          "scriptPubKey":"04d46c4968bde02899d2aa0963367c7a6ce34eec332b32e42e5f3407e052d64ac625da6f0718e7b302140434bd725706957c092db53805b821a85b23a7ac61725b OP_CHECKSIG",
          "address":"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc"
        }
      ]
    },
    {
      "hash":"f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
      "ver":1,
      "vin_sz":1,
      "vout_sz":2,
      "lock_time":0,
      "size":275,
      "in":[
        {
          "prev_out":{
            "hash":"0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9",
            "n":0
          },
          "scriptSig":"304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901"
        }
      ],
      "out":[
        {
          "value":"10.00000000",
          "scriptPubKey":"04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_CHECKSIG",
          "address":"1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3",
          "next_in":{
            "hash":"ea44e97271691990157559d0bdd9959e02790c34db6c006d779e82fa5aee708e",
            "n":0
          }
        },
        {
          "value":"40.00000000",
          "scriptPubKey":"0411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3 OP_CHECKSIG",
          "address":"12cbQLTFMXRnSzktFkuoG3eHoMeFtpTu3S"
        }
      ]
    }
  ],
  "mrkl_tree":[
    "b1fea52486ce0c62bb442b530a3f0132b826c74e473d1f2c220bfa78111c5082",
    "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
    "7dac2c5666815c17a3b36427de37bb9d2e2c5ccec3f8633eb91a4205cb4c10ff"
  ],
  "next_block": "000000002a22cfee1f2c846adbd12b3e183d4f97683f85dad08a79780a84bd55"
}