Skip to content

Instantly share code, notes, and snippets.

View niooss-ledger's full-sized avatar

Nicolas IOOSS niooss-ledger

View GitHub Profile
@niooss-ledger
niooss-ledger / writeup.md
Created October 27, 2021 10:14
Write-up for zkHack puzzle #1: zkhack-bls-pedersen
#!/usr/bin/env python3
"""Solve zkHack puzzle #2 (https://www.zkhack.dev/puzzle2.html)
On https://github.com/kobigurk/zkhack-trusted-setup there is a Rust program
which displays:
Alice has computed a trusted setup for a Groth16 proof scheme.
She decided to use a 128-bit long secret, and she swears that she does not
know the secret s needed to get this setup.
The trusted setup is constructed as follows using two additional scalars α

Write-up for zkHack puzzle #5: To be Adaptive is to be Strong

1. Subject

Shallan recently found a proof system (see below) that enables proving that two Pedersen commitments commit to the same message (but with potentially different randomness). She employes this in her private cryptocurrency to show that two committed coins have the same value. However, soon after deployment, she receives a message from a self-proclaimed hacker. The message contains two Pedersen commitments and their openings, and a proof of message equality for these commitments. The proof is valid, but there's a twist: the openings contain different messages! How can this be? Reproduce the attack and help Shallan diagnose the problem in her system.

Write-up for zkHack puzzle #6: Soundness of Music

Subject

It is a well-known fact that 1+1=2. Recent work by Alice von Trapp (et al) suggests that under special conditions in the Swiss Alps, 1+1+1+1=1. Alice has been unable to prove this statement over the BLS12-381 scalar field. The primary difficulty appears to be the fact that 1 is not equal to 4. Alice's proving system can write a proof for every statement (x,y) where x and y are BLS12-381 scalars, and x+x+x+x=y. The proving system easily outputs a proof for the statement (1,4) showing 1+1+1+1=4, but seems unable to produce a proof for the statement (1,1) showing 1+1+1+1=1. >

@niooss-ledger
niooss-ledger / zkhack2022_III_puzzle1_writeup.md
Created November 28, 2022 18:46
Write-up for ZK Hack III puzzle #1: Zero-Sum Game
@niooss-ledger
niooss-ledger / zkhack2022_III_puzzle2_writeup.md
Created December 5, 2022 11:43
Write-up for ZK Hack III puzzle #2: Power corrupts
@niooss-ledger
niooss-ledger / zkhack2022_III_puzzle3_writeup.md
Last active December 13, 2022 21:09
Write-up for ZK Hack III puzzle #3: Bigger is Better