Protocol. Alice sends each photon with a random bit in a random basis: rectilinear (0 / 90 deg) or diagonal (45 / 135 deg). Bob measures in a random basis. If his basis equals Alice's he gets her bit; otherwise his result is random (50 %). They publicly compare bases only, keep the matching half (the sifted key) and discard the rest.
Reading the 2D view. Each ledger column is one photon (an independent slow sample drawn with the same probabilities as the counted stream): Alice's bit and basis, Eve's basis if she intercepted (red outline when she guessed wrong), a channel flip marker, Bob's basis and result, and the verdict (kept and correct, kept and wrong, discarded). The 2x2 matrix counts every photon by Alice's and Bob's basis: the diagonal is the sifted key, and its error rate is the QBER; the off-diagonal cells are pure coin flips (about 50 % wrong) and are thrown away.
Why eavesdropping shows. An intercept-resend spy Eve must guess a basis; the no-cloning theorem prevents copying. When she guesses wrong (50 %) she resends in the wrong basis and Bob, if he uses Alice's basis, errs half of the time. So Eve adds f/4 to the error rate (25 % if she listens to everything). With channel error p the exact result is
Key rate. With ideal single photons and an asymptotically long key, the Shor-Preskill bound gives the secret fraction r = 1 - 2 h(Q), h(Q) = -Q log2 Q - (1-Q) log2 (1-Q). It reaches zero at Q ~ 11 %, so above this the parties must abort.
Simplifications: perfect single-photon sources and detectors (real systems use weak laser pulses plus decoy states), only the intercept-resend attack, no photon loss or dark counts, all sifted bits used for the error estimate (real systems sample a subset), and the asymptotic rather than a finite-key bound. The 2D ledger shows a slowed-down sample of the stream; the counters use every photon.