SiaHub

The SiaHub Developer Hub

    
Suggest Edits

/block/{height}

Get raw block from consensus

 
gethttps://explorer.siahub.info/api/block/height
curl --request GET \
  --url https://explorer.siahub.info/api/block/height
var request = require("request");

var options = { method: 'GET',
  url: 'https://explorer.siahub.info/api/block/height' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://explorer.siahub.info/api/block/height")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://explorer.siahub.info/api/block/height");

xhr.send(data);
import requests

url = "https://explorer.siahub.info/api/block/height"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "blockheight": 1,
  "blockheader": {
    "parentid": "25f6e3b9295a61f69fcb956aca9f0076234ecf2e02d399db5448b6e22f26e81c",
    "nonce": [
      253,
      253,
      0,
      0,
      0,
      0,
      0,
      100
    ],
    "timestamp": 1433626546,
    "merkleroot": "a90b6c0811a6b6485ab8e53174ce820087179cb4e26a5768b79ff787e05b11b0"
  },
  "minerpayouts": {
    "aec28ed1c7fa8b960f7a3cbf337fd7ba7d320bb0b997929824124aef20c53e47": {
      "value": "299999000000000000000000000000",
      "unlockhash": "68a0607b15f21ce643bb47075e539b9e938d7a8e0870951a3c872a2d89ae05194ee3a0f18680"
    }
  },
  "transactions": {
    "bf27913ca6939b1aeafecacd925114b86bcd716768be27394ac6b114b8923f7c": {
      "siacoininputs": [],
      "siacoinoutputs": [],
      "filecontracts": [],
      "filecontractrevisions": [],
      "storageproofs": [],
      "siafundinputs": [],
      "siafundoutputs": [],
      "minerfees": null,
      "arbitrarydata": [
        "Tm9uU2lhQ9ikb2Lc6jDRfLhhjPflTQ=="
      ],
      "transactionsignatures": null
    }
  }
}
{error: "Ooops, our wallet unavailable. Please try later."}

Path Params

height
int32
required

Block height to get raw block from consensus database

 

Block structure

Block Header

Field
Description

parentid

Parent block hash

nonce

Nonce

timestamp

Creation unixtimestamp

merkleroot

Merkle Root

Transaction structure

Field
Description

siacoininputs

Siacoin inputs array (see below)

siacoinoutputs

Siacoin outputs array (see below)

filecontracts

File contracts array (see below)

filecontractrevisions

File contracts revisions array (see below)

storageproofs

Storage proofs array (in fact siacoin outputs)

siafundinputs

Siafund inputs array (see below)

siafundoutputs

Siacoin outputs array (see below)

arbitrarydata

Arbitrary data base64 encoded binary strings array

transactionsignatures

Miner Payout / Siacoin Output / Siafund output

Field
Description
Normalization/Info

value

Hastings amount for SC
Raw for SF

value / 1e24 = SC amount

unlockhash

Receiver wallet address

claimstart

???

only Siafund

Siacoin Input / Siafund input

Field
Description

parentid

Parent siacoin output id

unlockconditions

Unlock conditions (public keys)

claimunlockhash

???

only Siafund

File contract / File contract revision

WIP

Suggest Edits

/blocks

Get multiple raw blocks

 
posthttps://explorer.siahub.info/api/blocks
curl --request POST \
  --url https://explorer.siahub.info/api/blocks
var request = require("request");

var options = { method: 'POST',
  url: 'https://explorer.siahub.info/api/blocks' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://explorer.siahub.info/api/blocks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://explorer.siahub.info/api/blocks");

xhr.send(data);
import requests

url = "https://explorer.siahub.info/api/blocks"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "1": {
    "height": "1",
    "headers": {
      "parentid": "25f6e3b9295a61f69fcb956aca9f0076234ecf2e02d399db5448b6e22f26e81c",
      "nonce": [
        253,
        253,
        0,
        0,
        0,
        0,
        0,
        100
      ],
      "timestamp": 1433626546,
      "merkleroot": "a90b6c0811a6b6485ab8e53174ce820087179cb4e26a5768b79ff787e05b11b0"
    }
  },
  "2": {
    "blockheight": 1,
    "blockheader": {
      "parentid": "25f6e3b9295a61f69fcb956aca9f0076234ecf2e02d399db5448b6e22f26e81c",
      "nonce": [
        253,
        253,
        0,
        0,
        0,
        0,
        0,
        100
      ],
      "timestamp": 1433626546,
      "merkleroot": "a90b6c0811a6b6485ab8e53174ce820087179cb4e26a5768b79ff787e05b11b0"
    },
    "minerpayouts": {
      "aec28ed1c7fa8b960f7a3cbf337fd7ba7d320bb0b997929824124aef20c53e47": {
        "value": "299999000000000000000000000000",
        "unlockhash": "68a0607b15f21ce643bb47075e539b9e938d7a8e0870951a3c872a2d89ae05194ee3a0f18680"
      }
    },
    "transactions": {
      "bf27913ca6939b1aeafecacd925114b86bcd716768be27394ac6b114b8923f7c": {
        "siacoininputs": [],
        "siacoinoutputs": [],
        "filecontracts": [],
        "filecontractrevisions": [],
        "storageproofs": [],
        "siafundinputs": [],
        "siafundoutputs": [],
        "minerfees": null,
        "arbitrarydata": [
          "Tm9uU2lhQ9ikb2Lc6jDRfLhhjPflTQ=="
        ],
        "transactionsignatures": null
      }
    },
    "height": "2",
    "headers": {
      "parentid": "0000000018492dfe2a1b2da6ca3534a757796573f84f0eb0eb5f88d75cd10f9f",
      "nonce": [
        22,
        89,
        0,
        0,
        0,
        0,
        7,
        75
      ],
      "timestamp": 1433627288,
      "merkleroot": "4271649ec937a076d8b771a30dafd2816585cf0ab80be97164916182be4a4569"
    }
  },
  "3": {
    "blockheight": 2,
    "blockheader": {
      "parentid": "0000000018492dfe2a1b2da6ca3534a757796573f84f0eb0eb5f88d75cd10f9f",
      "nonce": [
        22,
        89,
        0,
        0,
        0,
        0,
        7,
        75
      ],
      "timestamp": 1433627288,
      "merkleroot": "4271649ec937a076d8b771a30dafd2816585cf0ab80be97164916182be4a4569"
    },
    "minerpayouts": {
      "29ec104bb31a74979f57b467ae94e3aa28f2eafaa2b9d178fc2beb96d8f090fa": {
        "value": "299998000000000000000000000000",
        "unlockhash": "89181fca4864a38f79c1951b1866494fa51c8913cc062de396907b603767fda7373ef8b49c85"
      }
    },
    "transactions": {
      "4d61d765c36dcbbc251160fd0da0ae0d7f2c3cb6929d6ecb1ef5cc7879aa8e34": {
        "siacoininputs": [],
        "siacoinoutputs": [],
        "filecontracts": [],
        "filecontractrevisions": [],
        "storageproofs": [],
        "siafundinputs": [],
        "siafundoutputs": [],
        "minerfees": null,
        "arbitrarydata": [
          "Tm9uU2lhikT8JNipottxnU1tLtbF4w=="
        ],
        "transactionsignatures": null
      }
    }
  }
}

Form Data

blocks
array of integers
required

Array of heights

 

Response

This route returns multiple blocks array.

See above for block structure

Suggest Edits

/hash/{hash}

Get hash info

 
gethttps://explorer.siahub.info/api/hash/hash
curl --request GET \
  --url https://explorer.siahub.info/api/hash/hash
var request = require("request");

var options = { method: 'GET',
  url: 'https://explorer.siahub.info/api/hash/hash' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://explorer.siahub.info/api/hash/hash")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://explorer.siahub.info/api/hash/hash");

xhr.send(data);
import requests

url = "https://explorer.siahub.info/api/hash/hash"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": 69901942,
  "hash": "96e17a785edbceb32554c1270390af7e741f6ac5cfaeee2b049220ca19352ea1",
  "type": "siafundoutputid",
  "blocks": [
    {
      "hash_id": 69901942,
      "height": 112820
    }
  ]
}

Path Params

hash
string
required

Hash transaction id, output/input id etc…

 

Response structure

id

Internal hash ID in explorer DB

hash

Requested Hash

type

Hash type

Possible values:

  • blockid - Block ID
  • siacoinoutputid - SC Output ID
  • unlockhash - Wallet Address
  • transactionid - Transaction ID
  • filecontractid - File Contract ID
  • siafundoutputid - SF Output ID

blocks

Array of blocks that reference a hash

  • Internal hash ID
  • Block height