{
 "format": "zoobc-conformance-vectors/1",
 "edition": "0.6.1",
 "chapter": "21",
 "license": "CC BY 4.0, ZooBC Foundation",
 "cases": [
  {
   "id": "21-1-score-12513",
   "chapter": "21",
   "section": "1",
   "title": "Block 12,513's receipt delta (10 unlinked receipts, n = 11, P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "10",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "238715277"
   }
  },
  {
   "id": "21-1-lottery-weight",
   "chapter": "21",
   "section": "1",
   "title": "The lottery of block 12,513 weighs its blocksmith before the block's own score change",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "weighed_at_12513": "2208841765235",
    "score_after_12513": "2209080480512",
    "weighed_at_12514_and_12515": "2209080480512"
   },
   "note": "2,208,841,765,235 + 238,715,277 = 2,209,080,480,512: the score change of block h first weighs in the lottery of h + 1."
  },
  {
   "id": "21-1-decision-row",
   "chapter": "21",
   "section": "1",
   "title": "Step 13: the readiness decision row written in block h's transaction",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "row": "readiness_bundle_decision (bundle_id, effective_height = h + 1, height = h, latest), versioned by bundle_id",
    "rule": "readiness_decision_state",
    "a row that cannot be written": "refuses the block",
    "a refusal or a failed commit after step 13": "the gate forgets the decision; the next attempt decides again"
   },
   "note": "The tally that qualifies a bundle is 29's."
  },
  {
   "id": "21-2-emission",
   "chapter": "21",
   "section": "2",
   "title": "The emission curve with the testnet genesis file's timestamp and pool",
   "kind": "21-emission",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "timestamps": "1793509027\n1793509042\n1793509057\n1793509072\n1793509087\n1793713987\n1793714002\n2266549027\n2266549042"
   },
   "expected": {
    "emitted": "0\n197732213\n395464421\n593196609\n790928787\n2700224364208\n2700421863911\n2068282231333333\n2068282231333333"
   }
  },
  {
   "id": "21-2-block-1",
   "chapter": "21",
   "section": "2",
   "title": "The coinbase of a block 1 at 1,793,509,042 (previous block at 1,793,509,027)",
   "kind": "21-coinbase-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "1",
    "timestamp": "1793509042",
    "previous_timestamp": "1793509027",
    "carried": "0"
   },
   "expected": {
    "schedule": "0",
    "verdict": "valid"
   },
   "note": "Block 1 carries 0 whatever the curve gives."
  },
  {
   "id": "21-2-block-2",
   "chapter": "21",
   "section": "2",
   "title": "The coinbase of a block 2 at 1,793,509,057 (previous block at 1,793,509,042)",
   "kind": "21-coinbase-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "2",
    "timestamp": "1793509057",
    "previous_timestamp": "1793509042",
    "carried": "197732208"
   },
   "expected": {
    "schedule": "197732208",
    "verdict": "valid"
   }
  },
  {
   "id": "21-2-block-3",
   "chapter": "21",
   "section": "2",
   "title": "The coinbase of a block 3 at 1,793,509,072 (previous block at 1,793,509,057)",
   "kind": "21-coinbase-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "3",
    "timestamp": "1793509072",
    "previous_timestamp": "1793509057",
    "carried": "197732188"
   },
   "expected": {
    "schedule": "197732188",
    "verdict": "valid"
   }
  },
  {
   "id": "21-2-block-4",
   "chapter": "21",
   "section": "2",
   "title": "The coinbase of a block 4 at 1,793,509,087 (previous block at 1,793,509,072)",
   "kind": "21-coinbase-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "4",
    "timestamp": "1793509087",
    "previous_timestamp": "1793509072",
    "carried": "197732178"
   },
   "expected": {
    "schedule": "197732178",
    "verdict": "valid"
   }
  },
  {
   "id": "21-2-block-12400",
   "chapter": "21",
   "section": "2",
   "title": "The coinbase of a block 12400 at 1,793,714,002 (previous block at 1,793,713,987)",
   "kind": "21-coinbase-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "12400",
    "timestamp": "1793714002",
    "previous_timestamp": "1793713987",
    "carried": "197499703"
   },
   "expected": {
    "schedule": "197499703",
    "verdict": "valid"
   }
  },
  {
   "id": "21-2-over",
   "chapter": "21",
   "section": "2",
   "title": "That last block carrying 197,499,704",
   "kind": "21-coinbase-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "12400",
    "timestamp": "1793714002",
    "previous_timestamp": "1793713987",
    "carried": "197499704"
   },
   "expected": {
    "verdict": "total_coinbase exceeds emission schedule: got 197499704, max 197499703"
   }
  },
  {
   "id": "21-2-under",
   "chapter": "21",
   "section": "2",
   "title": "That last block carrying 197,499,702",
   "kind": "21-coinbase-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "12400",
    "timestamp": "1793714002",
    "previous_timestamp": "1793713987",
    "carried": "197499702"
   },
   "expected": {
    "verdict": "total_coinbase below emission schedule: got 197499702, schedule 197499703"
   }
  },
  {
   "id": "21-2-negative",
   "chapter": "21",
   "section": "2",
   "title": "A negative total_coinbase",
   "kind": "21-coinbase-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "12400",
    "timestamp": "1793714002",
    "previous_timestamp": "1793713987",
    "carried": "-1"
   },
   "expected": {
    "verdict": "Negative total_coinbase"
   }
  },
  {
   "id": "21-2-curve-end",
   "chapter": "21",
   "section": "2",
   "title": "After the curve ends a block carries 0",
   "kind": "21-coinbase-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis_timestamp": "1793509027",
    "pool": "2068282231333333",
    "height": "99",
    "timestamp": "2266549042",
    "previous_timestamp": "2266549027",
    "carried": "0"
   },
   "expected": {
    "schedule": "0",
    "verdict": "valid"
   }
  },
  {
   "id": "21-2-lottery-12515",
   "chapter": "21",
   "section": "2",
   "title": "The lottery of a block 12,515 over eleven holders",
   "kind": "21-lottery",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_seed": "5def70d845c3e055d003019a9ab7dcefa9ccf3d9f14293e260e0386716382f5222e4ecf47cf6d783e782e46dbafd89289adebfd4e25221b41de2a9f8292908af",
    "gap": "15",
    "rewards_per_second": "1",
    "max_rewards_per_block": "600",
    "holders": "bccb8082 2225858754283\ned52418c 2249423362312\n860b8c72 2223205604473\n80e91fec 2209973957702\n0515b3d6 2222646328706\nb6675786 2209080480512\nfb8e0c57 2243714656977\nca81cff8 2196844617491\n939101b4 2231717509202\n5020059b 2218683655093\nd2cd46bd 2215014260260",
    "reward": "197497578"
   },
   "expected": {
    "scaled": "202350795843\n204493032937\n202109600406\n200906723427\n202058757155\n200825498228\n203974059725\n199713147044\n202883409927\n201698514099\n201364932750",
    "total": "2222378471541",
    "n": "11",
    "draws": "8778447010925468843\n6010454828737276730\n6866204055350416126\n3148200190990825048\n4429788006861009633\n828186449630277317\n8166851389441144879\n8337968000549027991\n8901607159676471792\n6306752707003477552\n4552051560414898027",
    "w": "933633673400\n1139156040656\n1311517602592\n1071990559858\n1005163309809\n1555561222880\n1645138961095\n1781073601830\n1312248817211\n407704037653\n407105370088",
    "winners": "0515b3d6\nb6675786\nfb8e0c57\nb6675786\n0515b3d6\nca81cff8\n939101b4\n939101b4\nfb8e0c57\n860b8c72\n860b8c72",
    "shares": "17954325\n17954325\n17954325\n17954325\n17954325\n17954325\n17954325\n17954325\n17954325\n17954325\n17954328"
   },
   "note": "Holders are named by the first 8 hex digits of their owner account's key hash."
  },
  {
   "id": "21-2-pool",
   "chapter": "21",
   "section": "2",
   "title": "Fees, a refund and the longevity slice at block 12,515",
   "kind": "21-reward-pool",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "height": "12515",
    "total_fee": "5000000",
    "total_coinbase": "197497578",
    "refunds": "2500000",
    "inner_fees": "0",
    "pool_balance": "1000000000",
    "period": "172800",
    "carry": "0",
    "holders": "11"
   },
   "expected": {
    "slice": "6238",
    "reward": "200003816",
    "rows": "39 longevity -6238",
    "outcome": "drawn"
   }
  },
  {
   "id": "21-2-pool-shares",
   "chapter": "21",
   "section": "2",
   "title": "That amount drawn by the eleven holders",
   "kind": "21-lottery",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_seed": "5def70d845c3e055d003019a9ab7dcefa9ccf3d9f14293e260e0386716382f5222e4ecf47cf6d783e782e46dbafd89289adebfd4e25221b41de2a9f8292908af",
    "gap": "15",
    "rewards_per_second": "1",
    "max_rewards_per_block": "600",
    "holders": "bccb8082 2225858754283\ned52418c 2249423362312\n860b8c72 2223205604473\n80e91fec 2209973957702\n0515b3d6 2222646328706\nb6675786 2209080480512\nfb8e0c57 2243714656977\nca81cff8 2196844617491\n939101b4 2231717509202\n5020059b 2218683655093\nd2cd46bd 2215014260260",
    "reward": "200003816"
   },
   "expected": {
    "n": "11",
    "winners": "0515b3d6\nb6675786\nfb8e0c57\nb6675786\n0515b3d6\nca81cff8\n939101b4\n939101b4\nfb8e0c57\n860b8c72\n860b8c72",
    "shares": "18182165\n18182165\n18182165\n18182165\n18182165\n18182165\n18182165\n18182165\n18182165\n18182165\n18182166"
   }
  },
  {
   "id": "21-2-carry-block-1",
   "chapter": "21",
   "section": "2",
   "title": "Block 1's fees wait in the carry",
   "kind": "21-reward-pool",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "height": "1",
    "total_fee": "5000000",
    "total_coinbase": "0",
    "refunds": "0",
    "inner_fees": "0",
    "pool_balance": "0",
    "period": "172800",
    "carry": "0",
    "holders": "11"
   },
   "expected": {
    "reward": "0",
    "rows": "75 carry +5000000",
    "outcome": "carried"
   }
  },
  {
   "id": "21-2-carry-block-2",
   "chapter": "21",
   "section": "2",
   "title": "Block 2 takes the carry into its draw",
   "kind": "21-reward-pool",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "height": "2",
    "total_fee": "0",
    "total_coinbase": "197732208",
    "refunds": "0",
    "inner_fees": "0",
    "pool_balance": "0",
    "period": "172800",
    "carry": "5000000",
    "holders": "1"
   },
   "expected": {
    "reward": "202732208",
    "rows": "75 carry -5000000",
    "outcome": "drawn"
   }
  },
  {
   "id": "21-2-carry-no-holder",
   "chapter": "21",
   "section": "2",
   "title": "A block whose every registered node is missing carries R",
   "kind": "21-reward-pool",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "height": "50",
    "total_fee": "0",
    "total_coinbase": "197732178",
    "refunds": "0",
    "inner_fees": "0",
    "pool_balance": "0",
    "period": "172800",
    "carry": "0",
    "holders": "0"
   },
   "expected": {
    "reward": "0",
    "rows": "75 carry +197732178",
    "outcome": "carried"
   }
  },
  {
   "id": "21-2-even-split",
   "chapter": "21",
   "section": "2",
   "title": "No holder with a weighable score: R is split evenly in id order",
   "kind": "21-lottery",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "reward": "100",
    "previous_seed": "5def70d845c3e055d003019a9ab7dcefa9ccf3d9f14293e260e0386716382f5222e4ecf47cf6d783e782e46dbafd89289adebfd4e25221b41de2a9f8292908af",
    "gap": "15",
    "rewards_per_second": "1",
    "max_rewards_per_block": "600",
    "holders": "a 2\nb 1\nc 0"
   },
   "expected": {
    "total": "0",
    "winners": "a\nb\nc",
    "shares": "34\n33\n33"
   }
  },
  {
   "id": "21-3-receipts-12",
   "chapter": "21",
   "section": "3",
   "title": "12 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "12",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "238715277"
   }
  },
  {
   "id": "21-3-receipts-9",
   "chapter": "21",
   "section": "3",
   "title": "9 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "9",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "190972222"
   }
  },
  {
   "id": "21-3-receipts-7",
   "chapter": "21",
   "section": "3",
   "title": "7 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "7",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "95486111"
   }
  },
  {
   "id": "21-3-receipts-5",
   "chapter": "21",
   "section": "3",
   "title": "5 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "5",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "0"
   }
  },
  {
   "id": "21-3-receipts-4",
   "chapter": "21",
   "section": "3",
   "title": "4 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "4",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "-272817459"
   }
  },
  {
   "id": "21-3-receipts-1",
   "chapter": "21",
   "section": "3",
   "title": "1 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "1",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "-1091269836"
   }
  },
  {
   "id": "21-3-receipts-0",
   "chapter": "21",
   "section": "3",
   "title": "0 receipts on a registry of 11 (P = 12, unit 2,880)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "12",
    "receipts": "0",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "5",
    "full": "10",
    "delta": "-1364087296"
   }
  },
  {
   "id": "21-3-devnet-full",
   "chapter": "21",
   "section": "3",
   "title": "Devnet: a full receipt set (unit floor 120, n = 11, P = 8)",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "registry": "11",
    "max_assigned_peers": "8",
    "receipts": "8",
    "unit_floor": "120",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "4",
    "full": "8",
    "delta": "5729166666"
   }
  },
  {
   "id": "21-3-three-nodes-2",
   "chapter": "21",
   "section": "3",
   "title": "A chain of 3 registered nodes: 2 receipts",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "3",
    "registry": "3",
    "max_assigned_peers": "12",
    "receipts": "2",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "pivot": "1",
    "full": "2",
    "delta": "65104166"
   }
  },
  {
   "id": "21-3-three-nodes-0",
   "chapter": "21",
   "section": "3",
   "title": "A chain of 3 registered nodes: no receipt",
   "kind": "score-delta",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "3",
    "registry": "3",
    "max_assigned_peers": "12",
    "receipts": "0",
    "unit_floor": "2880",
    "climb_ratio": "8",
    "loss_bps": "500",
    "block_time_interval": "15",
    "decrease_score_divider": "2"
   },
   "expected": {
    "delta": "-372023808"
   }
  },
  {
   "id": "21-3-clock",
   "chapter": "21",
   "section": "3",
   "title": "The unit clock at unit 2,880 and the loss per block",
   "kind": "unit-clock",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "draw_set": "11",
    "unit_floor": "2880",
    "loss_bps": "500"
   },
   "expected": {
    "unit": "2880",
    "ticks_per_block": "347222222",
    "loss_per_block": "173611111"
   }
  },
  {
   "id": "21-3-loss-2880",
   "chapter": "21",
   "section": "3",
   "title": "The loss after 2,880 blocks missing",
   "kind": "21-missing-loss",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "ticks": "999999999360",
    "loss_bps": "500"
   },
   "expected": {
    "loss": "499999999680"
   }
  },
  {
   "id": "21-3-expulsion",
   "chapter": "21",
   "section": "3",
   "title": "Four registered nodes, two at score 0 last seen at 900 and 950",
   "kind": "21-expulsion",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "4",
    "candidates": "7 900 0\n3 950 0",
    "survival": "false"
   },
   "expected": {
    "expelled": "7",
    "held": "3"
   }
  },
  {
   "id": "21-3-expulsion-survival",
   "chapter": "21",
   "section": "3",
   "title": "The same in survival mode",
   "kind": "21-expulsion",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "4",
    "candidates": "7 900 0\n3 950 0",
    "survival": "true"
   },
   "expected": {
    "expelled": "",
    "held": ""
   }
  },
  {
   "id": "21-3-expulsion-ties",
   "chapter": "21",
   "section": "3",
   "title": "Same last seen: the lower score first, then the lower id",
   "kind": "21-expulsion",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "6",
    "candidates": "9 900 0\n4 900 0\n5 800 0\n2 900 0",
    "survival": "false"
   },
   "expected": {
    "expelled": "5\n2\n4",
    "held": "9"
   }
  },
  {
   "id": "21-4-refund",
   "chapter": "21",
   "section": "4",
   "title": "An expelled registered node's lock of 1,000 ZBC",
   "kind": "21-expulsion-refund",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "lock": "100000000000",
    "at_risk_bps": "1000"
   },
   "expected": {
    "at_risk": "10000000000",
    "refund": "90000000000"
   }
  },
  {
   "id": "21-5-events",
   "chapter": "21",
   "section": "5",
   "title": "The ledger events of block application",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "8": "lottery share",
    "39": "longevity slice",
    "75": "carry",
    "76": "at-risk share",
    "80": "fee from a lock",
    "4": "expulsion refund"
   }
  }
 ]
}
