Blocks

The Dragonchain L1 creates a new block every five seconds. Transactions are collected for the entire block time, then hashed, signed, and put into a block. The block is then hashed, signed, and fixated. By design each block contains a reference to the previous block’s hash.

Getting Blocks

Because Dragonchain designed its architecture with privacy in mind, transactions payloads are not included in the block. Authorized users can request information on the transactions directly using their transaction ID, but all information visible outside of the L1 (including Dragon Net validating nodes) is stripped to protect the user’s privacy.

$ dctl block get "28167573"
{
  "status": 200,
  "response": {
    "version": "1",
    "dcrn": "Block::L1::AtRest",
    "header": {
      "dc_id": "28GiivQE5m8a9oyvFD33JgwnBpgyZp2RxtTVFGjcRPVDJ",
      "block_id": "28167573",
      "level": 1,
      "timestamp": "1573076085",
      "prev_id": "28167557",
      "prev_proof": "MEUCIQC2/17+JRNENHoNnqobdYN88i/GMyvFbYY8aDLU0qct2gIgGObKjoi/cDxyLHkByKbZ2aiwTZtJ7XB2iqkvqNmQ4lY="
    },
    "transactions": [
      "{\"version\":\"2\",\"dcrn\":\"Transaction::L1::Stripped\",\"header\":{\"txn_type\":\"with-index\",\"dc_id\":\"28GiivQE5m8a9oyvFD33JgwnBpgyZp2RxtTVFGjcRPVDJ\",\"txn_id\":\"665541ef-7a68-472d-b4f1-c75484a7f8f7\",\"block_id\":\"28167573\",\"timestamp\":\"1573076083\",\"tag\":\"\",\"invoker\":\"\"},\"proof\":{\"full\":\"BGHz+yb+lrasHKNbl46awH1bqPYBb+HfZiqecBV31Bs=\",\"stripped\":\"MEUCIQDWgiKuN4JJMU8WSGe0HnNipPgH/O8S+uVuk6YuB/K2swIgEw6OhNrDWN1rcAr6UBYBDzVvranlBsbJnuP1uXagLa0=\"}}"
    ],
    "proof": {
      "scheme": "trust",
      "proof": "MEUCIQCICgA2/Py+VqgqYWGAVpVvNBMspVOMLYlYJ0ZqGk4YVAIgfJPv8By3YeAA7qKgyhwqcCgkPNyMUHu8A/Wzgyxclx8="
    }
  },
  "ok": true
}
Note
The following commands will still work for validation nodes, but validation nodes create block numbers sequentially. This makes `prev_id` unnecessary.

Blocks can also be looked up using the prev_id field. L1 block numbers are based on the current UTC timestamp, so there may be skipped numbers if a chain is under light or no transactional load. Instead, move backward through the chain one block at a time using the prev_id found in each block’s header.

$ dctl block query "@prev_id:[28167557 28167573]"
{
  "status": 200,
  "response": {
    "total": 2,
    "results": [
      {
        "version": "1",
        "dcrn": "Block::L1::AtRest",
        "header": {
          "dc_id": "28GiivQE5m8a9oyvFD33JgwnBpgyZp2RxtTVFGjcRPVDJ",
          "block_id": "28167938",
          "level": 1,
          "timestamp": "1573077910",
          "prev_id": "28167573",
          "prev_proof": "MEUCIQCICgA2/Py+VqgqYWGAVpVvNBMspVOMLYlYJ0ZqGk4YVAIgfJPv8By3YeAA7qKgyhwqcCgkPNyMUHu8A/Wzgyxclx8="
        },
        "transactions": [
          "{\"version\":\"2\",\"dcrn\":\"Transaction::L1::Stripped\",\"header\":{\"txn_type\":\"quickstart\",\"dc_id\":\"28GiivQE5m8a9oyvFD33JgwnBpgyZp2RxtTVFGjcRPVDJ\",\"txn_id\":\"0296540b-eb8e-429e-addb-f36d6ac08244\",\"block_id\":\"28167938\",\"timestamp\":\"1573077905\",\"tag\":\"\",\"invoker\":\"\"},\"proof\":{\"full\":\"D37rFIGtRHy5rE41qCESuTUUMvMaRAhZl3aT4wiSsWQ=\",\"stripped\":\"MEQCIGQ9NWeg3fGS4Px5HMI/ka1nxuR/x4/9AAEdU8OousddAiAykDac94vkRcOypLb97uGlRjLEy2MOu8t0Jq/UfRyrMQ==\"}}"
        ],
        "proof": {
          "scheme": "trust",
          "proof": "MEQCIGvALBc2xcOuCeeg2a3kdVTLbLW1SBfHniC1L9hLKIByAiA9Uhnva7194wzSr+MqV888s0/ztNJuTJQe1uUYpFW9Ug=="
        }
      },
      {
        "version": "1",
        "dcrn": "Block::L1::AtRest",
        "header": {
          "dc_id": "28GiivQE5m8a9oyvFD33JgwnBpgyZp2RxtTVFGjcRPVDJ",
          "block_id": "28167573",
          "level": 1,
          "timestamp": "1573076085",
          "prev_id": "28167557",
          "prev_proof": "MEUCIQC2/17+JRNENHoNnqobdYN88i/GMyvFbYY8aDLU0qct2gIgGObKjoi/cDxyLHkByKbZ2aiwTZtJ7XB2iqkvqNmQ4lY="
        },
        "transactions": [
          "{\"version\":\"2\",\"dcrn\":\"Transaction::L1::Stripped\",\"header\":{\"txn_type\":\"with-index\",\"dc_id\":\"28GiivQE5m8a9oyvFD33JgwnBpgyZp2RxtTVFGjcRPVDJ\",\"txn_id\":\"665541ef-7a68-472d-b4f1-c75484a7f8f7\",\"block_id\":\"28167573\",\"timestamp\":\"1573076083\",\"tag\":\"\",\"invoker\":\"\"},\"proof\":{\"full\":\"BGHz+yb+lrasHKNbl46awH1bqPYBb+HfZiqecBV31Bs=\",\"stripped\":\"MEUCIQDWgiKuN4JJMU8WSGe0HnNipPgH/O8S+uVuk6YuB/K2swIgEw6OhNrDWN1rcAr6UBYBDzVvranlBsbJnuP1uXagLa0=\"}}"
        ],
        "proof": {
          "scheme": "trust",
          "proof": "MEUCIQCICgA2/Py+VqgqYWGAVpVvNBMspVOMLYlYJ0ZqGk4YVAIgfJPv8By3YeAA7qKgyhwqcCgkPNyMUHu8A/Wzgyxclx8="
        }
      }
    ]
  },
  "ok": true
}
Note
If a block has no `prev_id`, then it is the genesis block for a chain.