Skip to content

Instantly share code, notes, and snippets.

@signorecello
Last active June 26, 2025 15:53
Show Gist options
  • Save signorecello/9df67ce543ccccbdab8205aa373605b2 to your computer and use it in GitHub Desktop.
Save signorecello/9df67ce543ccccbdab8205aa373605b2 to your computer and use it in GitHub Desktop.

"Noir in an Afternoon" cheat sheet

Codespace:

https://github.com/codespaces/new/aztecprotocol/tiny-noir-codespace

Or manually

curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/bbup/install | bash
noirup
bbup

References

Docs - https://noir-lang.org
Noir Discord - https://discord.gg/9WTvsHPH
Twitter - https://x.com/NoirLang
Remix IDE - https://remix.ethereum.org/

Commands

nargo init --name workshop
cd workshop
nargo check
nargo test
nargo execute

# Hi Bob!
bb prove -b ./target/workshop.json -w ./target/workshop.gz -o ./target --output_format bytes_and_fields --oracle_hash keccak

# Hi Alice!
nargo compile
bb write_vk -b target/workshop.json -o target --oracle_hash keccak
bb verify --oracle_hash keccak
bb write_solidity_verifier -o contract.sol

# split the proof with
cat ./target/proof | od -An -v -t x1 | tr -d $' \n'
@Savio-Sou
Copy link

Savio-Sou commented Jun 12, 2025

For proofs to successfully verify, Alice's commands should also take --oracle_hash keccak:

bb write_vk -b target/workshop.json -o target --oracle_hash keccak
bb verify --oracle_hash keccak

@signorecello
Copy link
Author

Thanks, saved me on a IRL workshop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment