[step:Build a deterministic verifier by replaying the encoded branch]
Define a deterministic Turing machine $V$ as follows. On input $(x,c) \in \Sigma^* \times \{0,1\}^*$, the machine $V$ simulates $N$ on input $x$. At the $t$-th simulated nondeterministic step, where $t \in \{1,\dots,p(|x|)\}$, the machine reads the $t$-th block of length $\ell$ from $c$, interprets that block as a choice number in $\{1,\dots,b\}$, checks whether that numbered transition is legal in the current simulated configuration, and follows it if it is legal. If the block is missing, malformed, or names an illegal transition, then $V$ rejects. If the simulated branch reaches an accepting state, then $V$ accepts; if the simulated branch halts without accepting, then $V$ rejects.
The simulation performs at most $p(|x|)$ simulated steps. Each simulated step can be carried out in time polynomial in $|x|+|c|$ because $N$ is fixed and its configurations have length at most polynomial in the simulated time. Hence there is a polynomial $r:\mathbb{N}\to\mathbb{N}$ such that $V$ halts on every input $(x,c)$ within $r(|x|+|c|)$ steps.
Let
\begin{align*}
q(n) := \ell p(n).
\end{align*}
If $x \in L$, then by definition of acceptance by $N$ there is an accepting branch of $N$ on $x$. Encoding the choices along that branch gives a certificate $c \in \{0,1\}^*$ with $|c|\leq q(|x|)$, and the verifier accepts $(x,c)$ because its simulation exactly follows that accepting branch. Conversely, if there is a certificate $c \in \{0,1\}^*$ with $|c|\leq q(|x|)$ such that $V$ accepts $(x,c)$, then the accepting simulation performed by $V$ is a legal accepting branch of $N$ on input $x$. Therefore $x\in L$.
[/step]