Blocks

A Dragonchain business chain (L1) creates a new block every five seconds if there are new transactions on the chain. Transactions are collected for the entire block time, then hashed, signed, and put into a block. The block is then hashed, signed, and sent for network verification. By design each block contains a reference to the previous block’s hash.

Getting Blocks

Because Dragonchain designed its architecture with privacy and protection of business data in mind, transaction payloads are not included in the block sent for network verification. Authorized users can request information on transactions directly using a transaction ID or other search criteria, but all transaction payload information is stripped prior to verification on the Dragonchain verification network to protect the sensitive business data, including privacy (e.g. GDPR, CCPA, and HIPAA) data.

With the dctl command line shell tool, one can easily extract blocks from a business chain by block ID:

$ 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
}

Blocks can also be looked up using the prev_id field. Business chain (L1) block IDs are based on the current UTC timestamp, so block ID numbers may skip if a chain is under light or no transactional load. For this reason, instead move backward through the chain one block at a time using the prev_id command found in each block’s header.

Note
The `prev_id` command will work for validation nodes, but is unnecessary because validation nodes create their block numbers sequentially.
$ 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.