Block Assembly: Trace the Policy

Sort once: rate descending, fee descending, ID ascending. Scan once. Skipped candidates are not retried.

1 / 6

Exact fee-rate comparison

7/3 exceeds 9/4 because 7×4=28 exceeds 9×3=27. Integer division hides the difference. Cross-products need sufficient width.

2 / 6

Dependencies and conflicts

500-byte budget, 100-byte coinbase. Initial outputs u and v.

  • Child C: skip because parent output does not exist yet.
  • Parent P: spend u, add P:0, size becomes 300, fees 400.
  • Conflict D: skip because u has been spent.
  • E: spend v, exact fit at 500, fees 600.

Subsidy 50 gives reward 650. C is not revisited.

3 / 6

Rejection changes no state

Check size and all inputs before consuming any input. Use a temporary UTXO view. Count only accepted sizes and fees. An oversized candidate does not prevent trying a smaller later candidate.

4 / 6

Greedy is not optimal

Payload budget 300: A=(200 bytes,400 fee), B=C=(150,285). Greedy selects A for 400; B+C would yield 570. This exercise implements a specified policy, not optimal packing.

5 / 6

Predict independently

Total budget 400, subsidy 50. X=(200,600,u), Y=(150,300,v), Z=(100,100,v). Which candidates fit in rate order? Which outputs remain available after a skip?

6 / 6
←/→ or click edges to navigate · ? help · N notes · F fullscreen