← Back

From an Anonymous Ballot Box to Zcash: 60 Minutes of Cryptography in Python

The design decisions behind a one-hour university workshop on the cryptographic ideas inside Zcash: why not to open with money, why the nullifier lands at minute 22 instead of the end, what was simulated on purpose, and what each choice cost. With the real code and what gets cut when time runs short.

November 2026...16 min read
Zcash • Privacy • Zero Knowledge • Cryptography • Teaching • Python • Merkle Trees • Schnorr • Workshop

Overview

On November 20, 2026 we gave an hour of class at a university to explain the ideas behind Zcash without running a node, without touching the network and without a wallet. This is not the syllabus: it is the record of the decisions that shaped it, and of what each one cost.

Almost everything that decides whether an hour of cryptography works gets decided before the first cell is written: which problem you open with, how many pieces you hand over, which part you simulate and how you say it. The code is the easy part, and it is all down below as evidence for each choice.

It is the counterpart to the other extreme, running a real node. There the decisions were operational: disk, versions, sync. Here they are pedagogical: how to get a room that has never heard the words "zk-SNARK" to understand why you would need one, in 60 minutes, without it turning into an algebra lecture.

There is no money, no network, no node and no wallet. None of this code is secure and none of it resembles the real Zcash code. It is not investment advice and prices never come up.

What we decided before writing code

DecisionWhat we choseWhy
Where does it run?Colab, notebook uploaded by handZero install; a classroom laptop does not fight a venv
Dependencies?Standard library onlyhashlib, secrets, json, dataclasses. No live pip install
Network?No cell makes a network callThe material survives the classroom wifi going down
How long to run?Under a second, end to endEven with the exercises unsolved
Two notebooks?Student and solutions, generated from one sourceHand-editing two .ipynb files always desynchronizes them
zk-SNARK?Simulated, and declared as such out loudHashes alone cannot do it, and lying there ruins the workshop

Important: the hard limit was not time, it was attention bandwidth. Each section delivers one piece, uses it immediately, and names where else that piece shows up outside Zcash. Nothing is introduced "for later".

1. Opening with a problem that is not about money

The decision that shaped the whole thing was not to start with cryptocurrency. The opening problem is this one:

How would you build a course evaluation that is genuinely anonymous, but where each student can only submit one opinion, without having to trust whoever administers the system?

I picked it because everyone in the room has filled out a course evaluation, and everyone in the room has lied on one. That saves the most expensive part of any privacy lecture, which is convincing the room that the problem is theirs.

And it has a property none of the openings I discarded had: the two obvious solutions fail on opposite sides, so the group proposes them unprompted.

  • Ask for the student ID: no double voting, but nobody tells the truth.
  • Ask for nothing: everybody tells the truth, but the form gets filled four times.

When someone proposes "have the admin delete the IDs afterwards", there is the sentence that carries the whole hour: that is trust, not security. If a system needs someone to behave in order to work, it does not work. Everything that follows is removing that "needs".

What it cost: money does not show up until minute 45. For three quarters of a workshop advertised as "the ideas behind Zcash" nobody talks about Zcash, and you have to sit with that discomfort instead of cutting it short. The payoff comes when "ticket to submit an opinion" is swapped for "note with value" and the same system, without touching a line, becomes a shielded pool.

2. One piece per section, used immediately

The second decision was about budget, but not minutes: attention. Each section hands over one piece and spends it on the spot. Nothing is introduced for later, and for every piece you name where else it shows up outside Zcash, because that is what makes it stick.

SectionPieceWhere else it shows up
1Commitments, SHA-256(value ‖ nonce)Sealed-bid auctions, raffles, commit-reveal
2Merkle trees and inclusion proofsGit, Certificate Transparency, rsync
3Nullifiers and anonymous votingSingle-use coupons, anonymous access
4Schnorr zero-knowledge proofTaproot signatures, passwordless login
5Transparent ledger vs. shielded ledgerVerifiable voting, anonymous credentials
6Memos and viewing keys (optional)Read-only API tokens

The real time split, with the running total we used to stay on track live:

#SectionMinRunning
—Opening: share the link, open Colab, run the first cell22
0The problem: the course evaluation57
1Commitments714
2Merkle trees822
3Nullifiers and anonymous voting1537
4Schnorr845
5From voting to money, plus the detective game1055
—Closing: summary table, explorer, take-home challenges560

The 15 minutes on section 3 are double any other one. That is not an accident: it is the decision in point 5.

3. Teaching the nonce by breaking it, not by explaining it

A commitment is a hash with a random nonce. It binds you to a value without revealing it.

import hashlib, secrets, json

def h(*partes: bytes) -> bytes:
    """SHA-256 of the concatenated parts."""
    d = hashlib.sha256()
    for p in partes:
        d.update(p)
    return d.digest()

LARGO_NONCE = 32

def comprometer(valor, nonce: bytes | None = None) -> tuple[bytes, bytes]:
    """Returns (commitment, nonce). The commitment is SHA-256(value || nonce)."""
    if nonce is None:
        nonce = secrets.token_bytes(LARGO_NONCE)
    return h(a_bytes(valor), nonce), nonce

def verificar(compromiso: bytes, valor, nonce: bytes) -> bool:
    esperado, _ = comprometer(valor, nonce)
    return secrets.compare_digest(compromiso, esperado)

The example is rock-paper-scissors over chat, where nobody wants to move first. You publish the commitment, then you reveal:

publico esto:         5326d2cdeb
y me guardo el nonce: 3b8058ce3c

abro el sobre con 'tijera':  True
intento cambiarlo a 'piedra': False

So far this is an ordinary demo, and an ordinary demo does not teach what the nonce is for. Which is why the cell that actually carries the section is the one that breaks it: what happens without a nonce.

def romper_sin_nonce(compromiso: bytes, opciones):
    """Without a nonce, trying the few possible options reveals the value."""
    for op in opciones:
        if h(a_bytes(op)) == compromiso:
            return op
    return None
te descubrí: jugaste 'tijera'
con nonce, lo que encontré probando las 3 opciones: []

The question for the room is "if the commitment were just SHA-256(move), how many tries do I need?", and they answer it themselves: three. An attack the room can count on its fingers beats any explanation of the preimage space.

Common mistake: believing the hash hides the data by itself. The hash is public and anyone can compute it; what hides the value is the nonce. This is exactly the same mistake as storing passwords without a salt, and it is worth saying in those words, because half the room has already made it in a project.

4. Entering Merkle through the size table

# Domain separation: leaves and internal nodes are hashed with different prefixes,
# so nobody can present an internal node as if it were a leaf.
PREFIJO_HOJA = b"\x00hoja:"
PREFIJO_NODO = b"\x01nodo:"

def hash_hoja(dato: bytes) -> bytes:
    return h(PREFIJO_HOJA, dato)

def hash_nodo(izq: bytes, der: bytes) -> bytes:
    return h(PREFIJO_NODO, izq, der)

def prueba_de_inclusion(arbol, indice: int):
    """Sibling path from the leaf up to the root.
    Each step is (side, sibling_hash)."""
    prueba = []
    i = indice
    for nivel in arbol[:-1]:
        hermano = i + 1 if i % 2 == 0 else i - 1
        lado = "der" if i % 2 == 0 else "izq"
        prueba.append((lado, nivel[hermano]))
        i //= 2
    return prueba

def verificar_inclusion(raiz: bytes, dato: bytes, prueba) -> bool:
    """Recompute the root by walking up the path."""
    actual = hash_hoja(dato)
    for lado, hermano in prueba:
        actual = hash_nodo(actual, hermano) if lado == "der" else hash_nodo(hermano, actual)
    return secrets.compare_digest(actual, raiz)

The structure can be drawn on a whiteboard in two minutes, and still nobody leaves with why it matters. What changes the room's face is the size table, so that goes first and the tree comes after:

     hojas   pasos de la prueba
         8                    3
        64                    6
      1024                   10
   1048576                   20

Un padrón de un millón de alumnos se demuestra con 20 hashes.

A one-million-student roster is proven with 20 hashes. And the cell that closes the section is already the mechanism for the course-evaluation roster, which is the minute-zero problem:

raíz del padrón (todos deben ver esta): 4659c5dd06f34b0b
alumno 12 con su prueba buena   : True
alumno 12 con prueba alterada   : False
alguien que no está en el padrón: False

Common mistake: getting the sibling's side wrong and always concatenating in the same order. verificar_inclusion returns False and it is not obvious why. If someone is stuck, have them print the path and follow it by hand with four leaves.

The fact that always lands: this is Git. A git commit is the root of a hash tree, and it is the reason you cannot rewrite history without changing everything above it.

5. The nullifier at the center, not at the end

This is the strongest structural decision in the material, and the one that gives 15 minutes to a section when the others get seven or eight. The nullifier is the only piece that closes the minute-zero problem, and it is the last one you can understand without algebra. Everything after it — Schnorr, the two ledgers — is refinement on a system the room already has running.

The question is posed like this: "the system needs to know that you already voted, but not who you are. What can you hand it that is always the same for you and never says your name?"

def nullifier(secreto: bytes) -> bytes:
    """A single-use fingerprint derived from the secret: SHA-256("nf" || secret).

    Always the same for the same secret (so double votes are detected)
    and it does not reveal the secret (so nobody learns who voted).
    """
    return h(b"nf", secreto)

With that, the whole anonymous ballot box is twenty lines:

@dataclass
class SistemaDeOpiniones:
    """Anonymous course-evaluation box with no repeat votes."""

    raiz_padron: bytes
    nullifiers_usados: set = field(default_factory=set)
    registro_publico: list = field(default_factory=list)

    def opinar(self, opinion, secreto, nonce, prueba):
        if not verificador_simulado(self.raiz_padron, secreto, nonce, prueba):
            return False, "no estás en el padrón"
        nf = nullifier(secreto)
        if nf in self.nullifiers_usados:
            return False, "ya opinaste (nullifier repetido)"
        self.nullifiers_usados.add(nf)
        self.registro_publico.append({"opinion": opinion, "nullifier": nf.hex()})
        return True, "opinión registrada"

The two test cells:

un colado intenta opinar: no estás en el padrón
alumno 3 intenta opinar otra vez: ya opinaste (nullifier repetido)

And the public record, which is the only thing published:

         nullifier  opinión
  76437bf1dc4e9777  nunca contesta correos
  fbe02ae1e2a0b728  va demasiado rápido
  b84eaa2f7c6b94d9  los laboratorios están buenísimos
  3b6fa632859ee7f5  explica muy bien
  85de9059f54946d2  explica muy bien
  d0695dea125f1b55  califica tardísimo

nullifiers usados: 10
votos duplicados en el registro: 0
si TE ROBARAS el secreto del alumno 3, verías que opinó: ['explica muy bien']
sin su secreto, el registro público son 10 hashes sin nombre.

Common mistake, and a serious one: proposing that the nullifier be the hash of the commitment, which is public, instead of the secret. Then anyone can compute it from the roster and learn who voted. The nullifier has to come from something only you know.

6. Letting the verifier cheat, and confessing it out loud

The system above works, but it cheats, and the cheat is deliberate. It is verificador_simulado:

def verificador_simulado(raiz, secreto, nonce, prueba) -> bool:
    """BLACK BOX. In Zcash this is replaced by a zero-knowledge proof.

    Here it receives the private data (secret, nonce, proof) and answers only
    True/False. That is cheating: a real verifier should NOT see any of this.
    It is not cryptography, it is a marker for where the zk-SNARK goes.
    """
    compromiso, _ = comprometer(secreto, nonce)
    return verificar_inclusion(raiz, compromiso, prueba)

The alternative was to teach the zero-knowledge proof first and build the ballot box on top of it, which is the logical order. I discarded it because in that order "zero-knowledge proof" is a name you memorize. In this one, it is a piece the room is missing.

The part you cannot delegate to a code comment is saying it. The question for the room is direct: "who is handing the secret to the verifier?" If nobody notices, you point at it, roughly like this.

Everything up to here is real cryptography. This function is not. It is cheating: we are handing the secret to the verifier. In Zcash this is exactly where a zk-SNARK goes, and in the next section I will show you a real zero-knowledge proof.

The best thing that happened to me giving this hour was right here: the room had the anonymous ballot box working and someone asked, with the face of having found a bug, "but then the verifier is seeing the secret, right?" After that question you no longer have to explain what a zero-knowledge proof is: they already know what it is for, because they are missing one.

That is the hinge of the material, and the reason the whole order exists.

7. Teaching real Schnorr, even though Zcash does not use it that way

Here I had to choose between two kinds of honesty. I could simulate this part too and stay in conceptual territory, or teach a real zero-knowledge proof that is not the one Zcash uses. I went with the second: the room seeing at least one complete proof that works end to end is worth more than brand consistency.

Schnorr over a 1,536-bit MODP group taken from RFC 3526, section 2. We do not generate our own parameters: generating safe parameters is hard, so you use published groups.

P = int("".join(_P_HEX.split()), 16)   # 1536-bit prime, RFC 3526 group 5
Q = (P - 1) // 2                       # order of the subgroup (prime)
G = 4                                  # 2^2: being a square, its order divides q

def generar_llaves() -> tuple[int, int]:
    """x is the private key; y = g^x mod p is the public one."""
    x = 1 + secrets.randbelow(Q - 1)
    return x, pow(G, x, P)

def schnorr_compromiso() -> tuple[int, int]:
    """Step 1: the prover picks a random r and publishes t = g^r mod p."""
    r = 1 + secrets.randbelow(Q - 1)
    return r, pow(G, r, P)

def schnorr_respuesta(x: int, r: int, c: int) -> int:
    """Step 3: the prover answers s = r + c*x mod q."""
    return (r + c * x) % Q

def schnorr_verificar(y: int, t: int, c: int, s: int) -> bool:
    """g^s must equal t * y^c (mod p)."""
    return pow(G, s, P) == (t * pow(y, c, P)) % P

First you run it interactively, with a classmate picking the challenge c:

te mando t = 228215565244528272865968111100 ...
te mando s = 730439422976630816443356435254 ...

verificación: True
y de x no te dije nada.

The detail decision worth copying is not explaining why the verifier picks the challenge, but building the cheat. The question is "why does the challenge have to be picked by the verifier and not the prover?", and the answer is that if the prover picks it, they craft t to fit and pass verification without knowing x. The notebook demonstrates it with a cell that builds exactly that cheat:

la trampa pasa la verificación: False
esperado: False

And then Fiat-Shamir closes the hole by putting t inside the hash, so the prover cannot choose t after learning the challenge:

def reto_fiat_shamir(y: int, t: int, mensaje: bytes = b"") -> int:
    """Instead of asking a classmate for the challenge, a hash produces it."""
    datos = h(b"schnorr-reto",
              y.to_bytes((P.bit_length() + 7) // 8, "big"),
              t.to_bytes((P.bit_length() + 7) // 8, "big"),
              mensaje)
    return int.from_bytes(datos, "big") % Q
prueba válida:               True
misma prueba, otro mensaje:  False

That second line is free and worth a lot: the proof is bound to the message, which is literally how a digital signature works.

Common mistake: computing s mod p instead of mod q. Exponents live mod q, group elements mod p. Mix them and verification fails with no visible error.

What it cost, and you pay it with a mandatory clarification: Schnorr proves one specific statement, "I know the discrete logarithm". Zcash's zk-SNARKs prove statements about entire circuits. Same idea, a different league. If you do not say it, someone walks out thinking a zk-SNARK is forty lines of Python, and that is worse than never having taught Schnorr.

8. Teaching the leak with a game, not with a warning

The conceptual shift at minute 45 is a single line: the ticket to submit an opinion now carries value.

@dataclass
class Nota:
    """A note is a ticket with value: who owns it and how much it is worth."""

    duena: str
    valor: int
    secreto: bytes

    def compromiso(self) -> bytes:
        c, _ = comprometer({"duena": self.duena, "valor": self.valor}, self.secreto)
        return c

And then you build the two ledgers, one against the other.

@dataclass
class LibroTransparente:
    """Every transaction states source, destination and amount. Like Bitcoin."""

    def transferir(self, origen, destino, monto, dia) -> bool:
        if self.saldos.get(origen, 0) < monto:
            return False
        self.saldos[origen] -= monto
        self.saldos[destino] = self.saldos.get(destino, 0) + monto
        self.transacciones.append({"dia": dia, "origen": origen,
                                   "destino": destino, "monto": monto})
        return True

@dataclass
class LibroBlindado:
    """Every transaction states only which nullifiers were spent and which new
    commitments appeared. No source, no destination, no amount."""

    def agregar(self, notas_gastadas, notas_nuevas, dia):
        nfs = [nullifier(n.secreto) for n in notas_gastadas]
        if any(nf in self.nullifiers_usados for nf in nfs):
            return False, "doble gasto (nullifier repetido)"
        # The balance check is the black box: in Zcash this is a zk-SNARK.
        if not balance_simulado(notas_gastadas, notas_nuevas):
            return False, "el balance no cuadra"
        for nf in nfs:
            self.nullifiers_usados.add(nf)
        nuevos = [n.compromiso() for n in notas_nuevas]
        self.compromisos.extend(nuevos)
        self.transacciones.append({"dia": dia,
                                   "nullifiers": [nf.hex()[:16] for nf in nfs],
                                   "compromisos": [c.hex()[:16] for c in nuevos]})
        return True, "transacción blindada registrada"

The three answers that matter, in one cell:

(True, 'transacción blindada registrada')
(False, 'doble gasto (nullifier repetido)')
(False, 'el balance no cuadra')

The detective game

Saying "a pseudonym is not privacy" takes five seconds and convinces nobody. This section exists because the only way I found to make it stick is for the room to do the surveillance with its own hands.

Before projecting anything, the question: "if every one of your transfers were public forever, but under a pseudonym instead of your name, would you feel anonymous?" Let them say yes.

Then you project 22 transactions over three months between six pseudonymous addresses, generated from a fixed seed so the whole room sees exactly the same data:

LIBRO TRANSPARENTE
día            origen         destino          monto
octubre 01     ztb88b52e377   zt955ec7320b      3000
octubre 03     zt955ec7320b   ztbda7705717      2500
octubre 03     zt330991800a   ztbda7705717      3200
octubre 08     zt955ec7320b   zt06d4b70fe9       120
octubre 15     zt71a6c322f8   zt330991800a      4700
octubre 19     zt330991800a   zt06d4b70fe9       280
octubre 22     zt955ec7320b   zt06d4b70fe9       230
noviembre 01   ztb88b52e377   zt955ec7320b      3000
...

And four questions, in teams, five minutes:

  1. Who pays rent to whom?
  2. How much does the student intern earn per month?
  3. Who is the freelancer's client?
  4. What is the corner store's final balance?

Not a single address has a name, and all four are answerable. The tool the teams discover on their own is grouping by sender:

  ztbda7705717  saldo final   22100
      <- zt330991800a  [3200, 3200, 3200]
      <- zt955ec7320b  [2500, 2500, 2500]

Three payments of the exact same amount, always on the 3rd, from exactly two senders: that is a rental contract with two tenants, in plain sight. Nobody had to break anything. Fixed amount plus fixed date plus three months running equals a contract, and from there the rest of the board falls apart: irregular amounts on a fixed date are invoices, small amounts from many senders are a corner store, and what comes in on the 1st and leaves on the 3rd is a salary going straight to rent.

Two small decisions hold the game up. The seed is fixed, so every team argues over the same data and the answers can be compared out loud. And the full answers with the cast directory live in the facilitator guide, not here, so the game still works on the next group.

The mistake the game exists to break: believing a pseudonym is privacy. Patterns give you away, not names. And it is worth naming who else can read that ledger: a future employer, a landlord, the competition of anyone who works for themselves. A client list is competitive information, and on a transparent ledger it is a free download.

The same four questions, on the shielded ledger

The same 22 operations, as published by the shielded ledger:

LIBRO BLINDADO (las mismas 22 operaciones)
octubre 01     gasta ['645b22729799584f', '19995d991536b169']
               crea  ['92387e35e2ad4f1c', '7af3b1b031586cc7']
octubre 03     gasta ['6b7baec06f40f4e5', 'd121540e03bf0f0d']
               crea  ['a6e74ec6715b5661', '12096d75f1b1b51c']
...
transacciones en el libro blindado: 22
campos que publica cada transacción: ['compromisos', 'dia', 'nullifiers']
nullifiers distintos: 44
nullifiers repetidos: 0

montos visibles: ninguno. direcciones visibles: ninguna.

All four questions are now impossible. No addresses, no amounts, no sender, no recipient, and nothing links one transaction to another.

Reusing the same 22 operations, rather than a fresh set, is what makes the comparison mean something: it is the same board they just pulled four answers out of.

What anyone can still verify, and it is the only thing needed, is that line reading nullifiers repetidos: 0: nobody spent twice. Which sets up the closing question: "what did the network lose by no longer seeing the amounts?" Nothing it needed. It can still reject double spends and confirm the money adds up. That is exactly what a zero-knowledge proof buys you.

9. Keeping the memos out of the base plan

Memos and selective disclosure were left out of the base plan on purpose: they are four extra minutes and only go in if you reach section 5 with time to spare. The cue to include them is not the clock, it is a question from the room, almost always "so how do I prove something to my accountant?". If nobody asks it, the section is not missed.

def llave_de_vista(secreto: bytes) -> bytes:
    """Lets you read an account's memos but not spend its notes:
    spending needs the secret, and you cannot go back to it from the viewing key."""
    return h(b"vista", secreto)

def llave_de_gasto(secreto: bytes) -> bytes:
    return h(b"gasto", secreto)
lo que ve la red:          73f3ac65a5a6495f4b21db719b83c01d406e72f0ad4f5d99a0606ee ...
con la llave de vista:     pago de las pizzas del hackathon, factura 1182
con otra llave cualquiera: '\r?5?? ?X??\x06?????\x02c?\x00?7??????9`??}?)@#^Q ...
auditoría con la llave de vista:
  - renta del auditorio
  - playeras del congreso
  - café para la guardia

Privacy is not opacity: you decide who sees what. It is a read-only API token under another name.

The encryption in this section is a toy and you have to say so: it is XOR against a SHA-256-derived stream. It authenticates nothing and breaks if you reuse the key across two messages. It is that way because the Python standard library ships no authenticated encryption, which was the price of deciding to install nothing. Zcash uses ChaCha20-Poly1305.

What is real and what is simulated

This is the decision you cannot leave implicit, and to me the most important part of the material. Someone is going to ask, and the answer has to be ready before they do.

Real, actual cryptography

  • SHA-256. The real hash function, from the standard library.
  • The commitments. SHA-256(value ‖ nonce) is a legitimate commitment scheme.
  • The Merkle trees. The construction, the inclusion proofs and the domain separation are exactly how it is done in production.
  • The nullifier idea. Deriving a deterministic fingerprint from a secret to detect reuse is the real mechanism.
  • The Schnorr protocol. It is a real zero-knowledge proof, over a 1,536-bit MODP group published in RFC 3526. I verified that the prime matches the RFC's formula, that it is a safe prime, and that the generator lives in the subgroup of order q.
  • Fiat-Shamir. The transformation is the real one.

Simulated, and why

  • verificador_simulado and balance_simulado. Black boxes: they receive the private data and answer True or False. They are not zero-knowledge proofs. They mark exactly where the zk-SNARK goes in Zcash. With hashes alone that part cannot be done.
  • The memo encryption. XOR against a SHA-256-derived stream, as explained above.
  • The fixed-seed secrets. The section 2 roster and the detective game use random.Random(seed) so the whole room sees the same data. In real life that would be catastrophic: you use secrets, as the rest of the notebook does.
  • The note model. Each payment spends two notes and creates two. Zcash handles note sets, tree anchors, incremental trees and several address types.
  • The 1,536-bit groups. Good for teaching; elliptic curves are what is actually used.

What it is not, full stop

It is not money: no network, no node, no wallet, nothing of any value. It is not investment advice and prices never came up. It does not resemble the Zcash code, which is years of work and audits; this is a cardboard mockup of the ideas. And it is not secure: none of it should leave the notebook.

Two engineering decisions that saved the hour

They are the local equivalent of what the operational problems were in the other post.

One source file for both notebooks

There are two .ipynb files: the student one, with unsolved exercises, and the solutions one, complete and with saved outputs. At first I edited both by hand. They desynchronized the same day.

Both notebooks are generated from a single script, using markers in the cells:

# >>>SOL
compromiso, nonce = comprometer("tijera")
# <<<SOL
# >>>TODO
# compromiso, nonce = ...   # fill this in
# <<<TODO
python3 herramientas/construir_cuadernos.py       # you edit here, not the .ipynb
python3 herramientas/verificar_entregables.py     # checks nothing broke

The criterion the script enforces is the one that matters: the student notebook has to run end to end with every exercise left unsolved. If an unfilled TODO raises in cell 12, the room stares at a red traceback at minute 20 and never gets the thread back.

The no-internet plan

No cell in the notebook makes a network call, so once it is open it works offline. On top of that, the fallback is layered, from most to least infrastructure:

If this failsUse this
Colab will not loadThe local solutions .ipynb, outputs already saved
No JupyterThe full notebook as HTML, double-click, no Python and no internet
No PythonThe same HTML off a USB stick
Nothing at allExercises 1 and 2 on the whiteboard, hashes truncated to 4 characters

The only thing that genuinely needs internet is the link to a real shielded transaction on a public explorer, in the closing. For that, bring a screenshot too.

Common mistakes, in one table

SymptomCauseFix
"The hash already hides the data"Confusing hashing with encryptionRun romper_sin_nonce over the 3 options
verificar_inclusion always FalseAlways concatenating in the same orderPrint the path and follow it by hand with 4 leaves
Anyone can tell who votedThe nullifier was derived from the public commitmentDerive it from the secret
Schnorr verification fails with no errors computed mod p instead of mod qExponents mod q, group mod p
"So that is what a zk-SNARK is"Schnorr proves a single statementClarify: statements about whole circuits
The room thinks a pseudonym is enoughThey never saw the patternDo not cut the detective game
Red traceback in the student notebookAn unfilled TODO breaks the cellThe student notebook must run unsolved

The order I cut in, decided in advance

Deciding this live means deciding it badly, so the triage is written before you walk in. In this order, and never another:

  1. Section 6. It is already out of the base plan.
  2. The interactive version of Schnorr (−3 min). Go straight to Fiat-Shamir and say in one sentence that the challenge used to come from a classmate and now comes from a hash.
  3. The detective game, from 4 questions to 2 (−3 min). Keep the first, which teaches the behavioral pattern, and the last, which teaches balance tracking.
  4. The public-record exercise (−3 min). Project it and do it out loud instead of having them type it.

Section 3 never gets cut. It is the center of the workshop, because of the decision in point 5.

What I take away

If you are going to teach privacy in an hour, these are the four decisions that pay off most. Do not start with money: start with a problem your room already has and has already lied on. Deliver one piece per section and use it immediately. Let the system almost work and let the room discover for itself what is missing, before you name the missing piece. And when a part of your code is a mockup, say so out loud in the moment, not in a comment nobody reads: the credibility of the entire hour rests on that sentence.

The rest is logistics, and logistics also gets decided in advance: both notebooks are generated from one source, the student one runs end to end with the exercises unsolved, and the whole thing works with the classroom wifi down. That last part is not paranoia: the classroom wifi goes down.

From an Anonymous Ballot Box to Zcash: 60 Minutes of Cryptography in Python · Irwing Duran