A signature scheme is the bank's anti-forgery tool. The bank keeps a secret key and publishes a verification key : anyone can check, nobody can forge.
The ingredient that makes a good signature scheme possible is the bilinear map.
A bilinear map is a function that lets us move scalars across a pairing:
This one property, pulling exponents out of a pairing, is the lever behind both BLS signatures and Groth-Sahai proofs.
Boneh–Lynn–Shacham [BLS04] turn that lever into a signature scheme: the secret key hides as an exponent, and the pairing lets anyone check it without ever seeing it. A hash-to-curve maps messages onto the curve.
Verification works because bilinearity makes both sides collapse to the same value:
So the bank adopts BLS: it writes a cheque and signs it with its secret key. Anyone can verify it; only the bank could have produced it.
The bank signs the cheque using BLS:
Anyone with the verification key can verify it:
Your worst friend
Just by seeing , your worst friend can cash the cheque: the bank pays whoever shows a valid signature.
The cheque is signed and verifiable. Now you hold a valid cheque and want to prove to a friend that the bank really signed it, without handing over , or they could cash it themselves.
You want to prove "a valid exists", i.e. that the verification equation has a solution, while keeping hidden.
That's exactly a zero-knowledge proof about a bilinear-map equation. Enter Groth-Sahai.
Groth-Sahai proofs [GS08] are efficient non-interactive zero-knowledge proofs for statements written as equations over a bilinear group. The richest kind is the pairing-product equation (PPE):
The prover knows a witness that satisfies the equation; the verifier becomes convinced without ever learning it.
The same quadratic shape, over a different bilinear map, gives four equation types:
where each is one of the four Groth-Sahai equation types over the variables:
Group variables
Scalar variables
One proof shows that all the equations hold for one shared witness. GSkit's DSL, coming next, is a surface syntax for exactly this language: declare the witness and the equations, and the framework builds the proof.
Writing one of these proofs by hand is intricate and error-prone: you commit every variable, build the , vectors and the matrix, and keep the prover's and verifier's views perfectly in sync.
The pain
Low-level commitments, easy to get wrong, hard to read; prover and verifier can drift apart.
The idea
Describe what the equation is, declaratively, and let a compiler generate the rest.
So we designed a small DSL: you declare the equation once, and the framework compiles both proving and verification.
Zero-knowledge DSLs
Circom · ZoKrates · Noir · Cairo · Leo
They compile programs to circuits (R1CS, ACIR, AIR) for SNARK and STARK back-ends. None supports bilinear-group equations natively.
Groth-Sahai libraries
groth-sahai-rs · groth-sahai-python · a Java prototype
Programmatic APIs: the developer still classifies witnesses, picks equation types, builds commitments and names variables across sub-proofs.
GSkit fills the gap: Groth-Sahai statements written as declarative equations, not as circuits or API calls.
@gsfy.A specification has just three blocks: which names are hidden (variables), which are public (constants), and the equations:
variables:
<hidden names> : G1 | G2 | ZP
constants:
<public names> : G1 | G2 | ZP | GT
equations:
<term> + <term> + ... = <name>
G1, G2, ZP)GT allowed here)* is the bilinear operation, + combines termsEach term is a product of names. Which groups the names live in decides the equation type, and the compiler infers it for you:
A * YX * Bgamma * X * YBack to the cheque. You (the prover) know ; your friend (the verifier) must be convinced without seeing it.
Prover · you
knows the signature
Verifier · your worst friend
never sees
checks
Key insight: your friend learns that a valid signature exists, but never sees itself.
The whole statement "I know a such that " becomes a few lines. The secret is a variable; everything else is a constant:
variablesconstantssignature * g2 = rhsThe compiler reads the types and recognises a pairing-product equation, with no manual setup.
variables:
signature: G1
constants:
g2: G2
rhs: GT
equations:
signature * g2 = rhs
The same typed spec compiles into two programs, so the prover's and the verifier's view of the equations can never drift apart:
Inside Python, the @gsfy decorator reads the same spec from a GS_STRING in the function and wires its variables automatically.
BLS was a warm-up. This thesis started from a concrete goal: an anonymous forum, where members prove they belong without revealing who they are. But anonymity alone has a catch:
One clown, four accounts
Sybil attack
one person behind many fake identities:
a consensus out of thin air.
Not just a forum problem: sockpuppet accounts and bot farms manufacture consensus in today's public debate and elections, a real threat to democracy.
Attribute-based signatures with user-controlled linkability [EKCGD14, EG17]. Every post carries one signature proving:
Same author, same thread, same : the four "supporters" count as one voice. Across threads the tokens look unrelated, so authors stay anonymous. Privacy and accountability, in one signature.
A single ABS-UCL signature is a conjunction of zero-knowledge statements, each from an independent sub-protocol: many Groth-Sahai equations proved as one.
Each sub-protocol declares its Groth-Sahai logic once with @gsfy; the scheme composes these specs over a shared context, and both prover and verifier come from that single source.
The decisive evidence is not fewer total lines, but the elimination of duplicated, hand-maintained equation code:
| Equation-construction effort | Manual | GSkit (modular) |
|---|---|---|
Lines in sign() | 85 | 8 declarative equations |
Lines in verify() | 84 | 0, generated |
| Hand-built equation / pairing-map objects | 60 | 0 |
| Times each equation is written | 2 | 1 |
Total developer-written code is not smaller (420 → 540 lines): each sub-protocol now carries its own spec.
The contribution: moving the equations into a single declarative source is what lowers the error surface, and makes a scheme as complex as ABS-UCL practical to build and maintain.
Proving and verifying a pairing-product statement takes time linear in the number of variables and in the number of equations.
VerifyProve
GSkit on Charm/PBC, BN254 curve. Data from the thesis evaluation.
What we showed
Future work
Hypothesis confirmed: a domain-specific language lowers the barrier to building Groth-Sahai proofs, reducing effort and error surface without giving up their security guarantees.
Questions?
GSkit: a domain-specific language and framework for Groth-Sahai proofs
More at benjamin.hurta.do/gskit
Three separate questions:
GSkit proves exactly the equation you write. Whether that equation is the right one for the protocol is still up to whoever writes it.
In Groth-Sahai [GS08] every equation admits WI proofs, but only MSMEs, QEs and PPEs with are ZK.
To make it ZK: also commit to and prove two equations, a PPE with and a linear MSME in , both ZK:
In the DSL that is one more witness and one MSME equation; the thesis typing rules cover both.
The linking token is a weak Boneh–Boyen signature on the thread, made with the author's key:
Assumption: each person holds a single key . The authority that issues the attributes must certify one key per person, e.g. one per national ID. Anyone who gets several keys gets several : ABS-UCL does not prevent that, because it is a registration problem, not a cryptographic one.
[GS08]J. Groth, A. Sahai. Efficient Non-interactive Proof Systems for Bilinear Groups. EUROCRYPT 2008, LNCS 4965, pp. 415–432.
[BLS04]D. Boneh, B. Lynn, H. Shacham. Short Signatures from the Weil Pairing. Journal of Cryptology 17(4), pp. 297–319, 2004.
[BB04]D. Boneh, X. Boyen. Short Signatures Without Random Oracles. EUROCRYPT 2004, pp. 56–73.
[EKCGD14]A. El Kaafarani, L. Chen, E. Ghadafi, J. Davenport. Attribute-Based Signatures with User-Controlled Linkability. CANS 2014, pp. 256–269.
[EG17]A. El Kaafarani, E. Ghadafi. Attribute-Based Signatures with User-Controlled Linkability Without Random Oracles. IMACC 2017, pp. 161–184.
FiguresAli Baba's cave illustrations by Dake, Wikimedia Commons, CC BY 2.5.
Presentarse y agradecer a la comisión. La tesis presenta GSkit, un lenguaje de dominio específico y un framework para construir pruebas de Groth-Sahai. El hilo de la charla va de pruebas de conocimiento cero, a firmas BLS, a Groth-Sahai, y termina con GSkit aplicado a ABS-UCL.
Las tres primeras secciones son el contexto necesario para entender el problema. La contribución está en las secciones 4 a 6.
Partir con la intuición, sin fórmulas. Ejemplos cotidianos: mostrar el carnet para probar la edad entrega mucha más información que la edad.
La cueva tiene dos caminos, A y B, unidos por una puerta que solo se abre con la palabra secreta. Una ronda tiene tres pasos: Peggy se compromete con un camino, Victor la desafía y Peggy responde. Si Peggy no conoce la palabra, solo puede responder bien si adivinó el lado.
Cada propiedad tiene una lectura directa en la cueva. Para zero-knowledge, la idea clave es el simulador: Victor podría fabricar un video idéntico sin la ayuda de Peggy, así que el video no le enseña nada.
La cueva es interactiva; las pruebas que nos interesan son no interactivas: un solo mensaje π. Notar que Verify nunca recibe el witness w. Desde aquí, el color ámbar marca siempre lo secreto.
La historia que recorre la charla. El banco emite cheques firmados; tú recibes uno; tu "peor amigo" lo está mirando y le encantaría cobrarlo o falsificarlo. La tarjeta resume las tres operaciones de un esquema de firma.
Unforgeability: sin sk nadie puede producir una firma válida para un mensaje nuevo. Con eso, pasamos a la herramienta matemática que hace funcionar BLS.
GSkit usa la curva BN254 a través de Charm/PBC. Si preguntan: el emparejamiento además es no degenerado y eficientemente computable.
Lo importante para lo que viene: la verificación de BLS es una sola ecuación de emparejamientos.
Aquí la firma σ es pública: va escrita en el cheque, y cualquiera con vk puede verificarla. Click: vuelve tu peor amigo. Para verificar el cheque tiene que ver σ, y con solo verla ya puede cobrarlo: el banco le paga a quien presente una firma válida. En la siguiente slide cambia el escenario y σ pasa a ser el secreto.
Desde aquí σ se marca en ámbar: es el witness. El enunciado es "existe una firma válida", no "esta es la firma".
El prover se compromete a cada variable y entrega elementos de prueba; el verificador revisa ecuaciones sobre los compromisos. Ojo con la terminología: en general GS da pruebas NIWI; son zero-knowledge para MSME y QE, y para PPE cuando t_T = 1.
Los cuatro tipos son la misma forma cuadrática instanciada con distintos mapas bilineales: e, multiplicación escalar en G1 o en G2, y producto en Zp. Lo único que cambia es dónde viven las variables, y eso es exactamente lo que el type checker de GSkit infiere.
Este es el lenguaje que GSkit sabe probar: conjunciones de ecuaciones de los cuatro tipos sobre un witness compartido.
Hipótesis de la tesis: un DSL específico para Groth-Sahai reduce la complejidad y los errores de implementar estas pruebas.
Los DSL de ZK conocidos apuntan a circuitos de propósito general; traducir ecuaciones de pairings a circuitos pierde claridad. Las bibliotecas de Groth-Sahai existentes obligan a hacer a mano lo que GSkit automatiza.
Las tres contribuciones; el resto de la charla las recorre en este orden.
La gramática está escrita en Lark. El type checker clasifica cada variable y arma los vectores a, b y la matriz γ de cada ecuación.
Los tres tipos de término de una PPE corresponden a tres formas sintácticas en el DSL. El desarrollador nunca escribe los vectores ni la matriz γ: salen de los tipos.
El prover eres tú, que tienes el cheque; el verificador es el amigo. t_T se calcula con datos públicos: el mensaje y la clave del banco. Posible pregunta: con t_T distinto de 1, GS08 da WI y no ZK. La forma estándar de obtener ZK es comprometer también H(m) con una ecuación lineal y dejar la PPE con lado derecho 1.
Comparar con lo que habría que escribir a mano: compromisos, vectores, matriz γ, y la verificación por separado.
El parser y el type checker son comunes a ambos lados; un error de tipos se detecta antes de construir cualquier prueba. Solo el prover recibe el witness. El verificador recibe π: compromisos y elementos de prueba.
Esta fue la motivación original de la tesis: un foro anónimo donde los miembros prueban que pertenecen (por ejemplo, ser estudiantes de la Universidad de Chile) sin revelar quiénes son. El problema es que con anonimato total nada impide que una misma persona cree muchas identidades. Click: las cuatro cuentas son la misma persona, un solo payaso detrás de todas. Eso es un ataque Sybil: una persona se hace pasar por muchas para fabricar un consenso. Click: no es solo un problema de foros. Las cuentas falsas y las granjas de bots fabrican consenso en el debate público y en elecciones, y eso daña la democracia.
ABS-UCL resuelve justamente eso. Cada post lleva una firma que prueba que los atributos del autor cumplen la política, sin revelar quién firma ni qué atributos usó. Además lleva un linking token τ, calculado con la clave secreta del autor y el hilo (en el paper el hilo es el "recipient"). Mismo autor y mismo hilo dan el mismo τ: las cuatro cuentas cuentan como una sola voz. En hilos distintos los τ no se pueden relacionar, así que el autor sigue siendo anónimo. Ejemplo de la tesis: en un foro médico, un doctor mantiene una identidad consistente dentro de un hilo sin ser vinculable entre discusiones distintas. Si preguntan: esto supone que las autoridades entregan atributos a una sola clave por persona; si alguien pudiera registrar muchas claves, el ataque Sybil volvería.
Cada subprotocolo aporta su propio conjunto de ecuaciones Groth-Sahai al enunciado completo. Esa estructura es justamente lo que motiva un tratamiento modular.
A la izquierda, la implementación manual previa: las mismas ecuaciones armadas en sign() y otra vez en verify(). A la derecha, cada subprotocolo trae su spec con @gsfy; sign() agrega cada spec al contexto con una sola llamada por atributo, y la verificación se genera.
Ser honesto con las líneas totales: el código modular es algo más largo porque cada subprotocolo trae su especificación. Lo que importa es que cada ecuación se escribe una sola vez y la verificación se deriva de ella.
Ambas curvas crecen linealmente, tanto con el número de variables como con el de ecuaciones. Verificar cuesta más que probar porque la verificación evalúa emparejamientos por cada ecuación, y probar usa principalmente operaciones de grupo.
Volver a la hipótesis: un DSL de alto nivel baja la barrera para construir pruebas de Groth-Sahai, y los casos de estudio lo respaldan.
Todo el material queda en benjamin.hurta.do/gskit: la tesis, el póster, el repositorio y estas slides.
Respuesta corta: la soundness criptográfica es la de Groth-Sahai, y GSkit no la modifica. Lo que aporta el lenguaje es que lo que escribes es lo que se prueba: el sistema de tipos asegura que cada ecuación es una ecuación de Groth-Sahai bien formada del tipo correcto, y el prover y el verifier se derivan de esa misma ecuación. Ser honesto: no hay una demostración formal de que la elaboración preserve el significado. Está descrita con reglas de inferencia en la tesis y validada con los casos de estudio. Mecanizarla, por ejemplo conectando con EasyCrypt como dice la tesis, es trabajo futuro. Si preguntan por ABS-UCL: la evaluación fue a nivel de especificación (líneas y ecuaciones). En la implementación actual falta el chequeo de tipos de las ecuaciones MSME, así que la prueba compuesta de ABS-UCL todavía no se ejecuta de punta a punta. BLS sí: verificado con ambos tipos de CRS.
Si preguntan: la PPE de BLS tiene lado derecho distinto de 1, y para esas ecuaciones GS08 solo da WI. Además la firma BLS es única para cada mensaje, así que WI por sí sola no oculta nada: hace falta ZK. La solución estándar de GS08: comprometer también H(m) como una variable Y, probar con una ecuación lineal que Y = H(m), y reescribir la PPE con lado derecho 1. Ambas ecuaciones son ZK. Ojo: en la implementación actual el chequeo de tipos de las ecuaciones MSME no está terminado, así que esta versión no corre hoy en GSkit. No prometer una demostración en vivo.
Si preguntan cómo evita ABS-UCL el ataque Sybil: el token τ es determinista para cada par (autor, hilo), así que las cuatro cuentas del payaso tendrían el mismo τ. Pero eso supone una clave por persona: la protección real contra Sybil está en el registro, cuando la autoridad entrega los atributos. ABS-UCL hace que esa garantía sobreviva al anonimato. En el código de GSkit, τ es la firma WBB del recipient (el hilo) con usk: lit.sign(usk, recip).