{
  "id": "blockchain-hash-ledger",
  "chapter": "blockchain",
  "title": "Synthetic SHA-256 ledger with a tamper check",
  "synthetic": true,
  "referenceSoftware": {
    "name": "Anders Brownworth Blockchain Demo",
    "source": "https://github.com/anders94/blockchain-demo",
    "liveDemo": "http://anders.com/blockchain/",
    "license": "MIT",
    "revision": "5982d75a8d25a5d1ec2fa7a0b9013afd4dc8e192 (master observed 2026-10-26)"
  },
  "implementation": "This local fixture uses a small independently written SHA-256 chain; it is not a screenshot or an output dump from the upstream app.",
  "algorithm": {
    "hash": "SHA-256",
    "canonicalEncoding": "UTF-8 JSON with sorted keys and compact separators",
    "proofOfWorkLeadingZeroHexDigits": 2,
    "hashFields": [
      "index",
      "timestamp",
      "data",
      "previousHash",
      "nonce"
    ],
    "syntheticUnit": "DEMO"
  },
  "chain": [
    {
      "index": 0,
      "timestamp": "2026-10-26T09:30:00+08:00",
      "data": {
        "kind": "genesis",
        "note": "synthetic educational ledger; no monetary value"
      },
      "previousHash": "0000000000000000000000000000000000000000000000000000000000000000",
      "nonce": 25,
      "hash": "0007263d677597161679d0c0e937ac6f7a9d6c6c8bc7f82da0dbcf80e9772942",
      "difficultyPrefix": "00"
    },
    {
      "index": 1,
      "timestamp": "2026-10-26T09:30:01+08:00",
      "data": {
        "kind": "transfer",
        "from": "lab-A",
        "to": "lab-B",
        "amount": "12.50",
        "unit": "DEMO"
      },
      "previousHash": "0007263d677597161679d0c0e937ac6f7a9d6c6c8bc7f82da0dbcf80e9772942",
      "nonce": 36,
      "hash": "0043ec7473760b53df825087c35e7e036e2661193a16c6c4ce6e81a3e59470e5",
      "difficultyPrefix": "00"
    },
    {
      "index": 2,
      "timestamp": "2026-10-26T09:30:02+08:00",
      "data": {
        "kind": "transfer",
        "from": "lab-B",
        "to": "lab-C",
        "amount": "3.25",
        "unit": "DEMO"
      },
      "previousHash": "0043ec7473760b53df825087c35e7e036e2661193a16c6c4ce6e81a3e59470e5",
      "nonce": 181,
      "hash": "00f91734faf20ba82c321120b58ea4d74174b8669796d916a00cd01e8f4e5cbb",
      "difficultyPrefix": "00"
    },
    {
      "index": 3,
      "timestamp": "2026-10-26T09:30:03+08:00",
      "data": {
        "kind": "validation",
        "system": "sim-01",
        "result": "PASS"
      },
      "previousHash": "00f91734faf20ba82c321120b58ea4d74174b8669796d916a00cd01e8f4e5cbb",
      "nonce": 171,
      "hash": "00a3bc3370c5b4bc90263a6245d8ec420ee8600f150771c156df6d8ea848c69f",
      "difficultyPrefix": "00"
    }
  ],
  "checks": {
    "original": {
      "valid": true,
      "blockCount": 4,
      "issues": []
    },
    "tamperedBlockIndex": 2,
    "tamperedAmount": "99.00",
    "afterTampering": {
      "valid": false,
      "blockCount": 4,
      "issues": [
        {
          "index": 2,
          "check": "stored-hash-matches-content",
          "result": "FAIL"
        },
        {
          "index": 2,
          "check": "proof-of-work-prefix",
          "result": "FAIL"
        }
      ]
    }
  },
  "headHash": "00a3bc3370c5b4bc90263a6245d8ec420ee8600f150771c156df6d8ea848c69f"
}
