ZK Hack Istanbul: Welcome presentation and Intro to zkDSL with the ZK Hack team
24 Nov 2023 · 24:32
A recording from ZK Hack Istanbul, a November 2023 in-person hackathon, in which the ZK Hack team opens the event and introduces zkDSL, a domain-specific language for building zero-knowledge circuits. The session sets up the following days of workshops and a bug-hunting puzzle competition, meant to help hackers and builders get up to speed on core zk tooling before working with teams from Polygon, Aleo, O1Labs, and RISC Zero.
Topics
Transcript
[Music] okay I think now is a great time to kick off Z hack Istanbul I'm very excited to see all of you here uh how how has Istanbul been so far for you are you guys excited to be here yeah do you want to clap do you want to let me yeah so what we're doing today is our kind of Welcome session later today at 6:30 we're actually doing a more comprehensive kickoff with all the information about like the prizes and submissions but just to start I want to
introduce the ZK hack part of the ZK hack team uh my name is Anna I'm also the co-host of a show called zero knowledge I'm the co-founder of a company called ZK validator and the zero knowledge podcast and this and ZK validator actually created ZK hack back in 2021 but it's spun out since then into its own organization so Thor do you want to say a little bit about yourself yeah hi everyone uh some of you may recognize me from around the Discord or at the last CK hack I am an independent cryptography and zero knowledge consultant and I've worked on several study groups in the Zak Discord server and have done some education stuff outside of it too so
hello everyone Hi and hi everyone so yeah I'm Gaylord engineer by trade actually got to know zik haak uh from zik haak Lisbon which I was participating in with my young friend here and uh yeah being working with the zik team for a while now and yeah very excited to be on this side of the stage this time so yeah so I want to share a little bit about ZK hack we think of it as an emerging hub for education for ZK education it started as an online kind of puzzle hacking competition I am so and since then we've done three of these online events I am curious who has been to an
online ZK hack event please actually let's clap I want to hear it okay oh okay there's some good okay amazing so after doing these online events which by the way we're going to do another one early next year we decided we wanted to do hackathons and our first hackathon was in lis in the spring was anyone at ZK hack Lisbon here clap if you were here okay a couple people good so you know kind of what to expect with this event um but yeah with ZK hack we've also created educational content like the ZK whiteboard sessions and we do these ongoing study groups like what Thor was just mentioning where we usually pick a piece of content and then
we create I mean we just get together a small group of people to learn it together and we have the theor book study Club that's been running now for 2 years we have the moon maath manual and some more soon so if you are interested in maybe joining one of these study groups it's all in the Discord so the entire Z hack kind of like all the channels can be found on zack. deev other things to note here if you want to see the old puzzles that we originally hacked on and their explanations and solutions you can find them here you can also find the ZK mesh newsletter which is a monthly newsletter which we've been also doing for many years it now is under the zek hack umbrella and you can find our the link
to our Discord or you can scan this I feel like most people here are now in the Discord I know we bothered you a lot being like join the Discord but we actually have a secret channel for ZK hack Istanbul so if you are in the Discord and you're not in that Channel please find someone from the ZK hack team which with with the ZK crew sticker and they can add you to that role which will allow you to see that group so a little bit about this event we have three days of time together today we're going to be doing the partners workshop and at 6:30 we're doing kind of the official kickoff ceremony but we're like so just one
thing actually I'll I'll just continue here but like this this venue closes in the evenings and so we decided to really start it a little bit on the early side and end it a little bit late um yeah Saturday our plan is to do lots of hacking we have these Q&A sessions we have this Turkish lamp Workshop if you've been in the Discord you saw us put a little call up for this we only have 30 spots for this but if you're I don't know if you want a little break from your hack and you want to do something very different please sign up for that we'll share it again we also provide lunch and dinner and then on Sunday we have our submissions at 12:00 noon lunch judging and prizes this is the Wi-Fi if you don't are already have it I believe there are
signs around the venue but maybe you want to take a quick shot and for today we're going to be so what we're doing right now is sort of the hello and intro to the ZK tools Workshop after this we have our partner workshops um we have our partners polygon Alo Ola risk zero and 0js presenting we're then going to break and actually it's at the 5:30 break that if anyone doesn't have a team at that point we're going to create sort of like a Loc where you can meet other potential teammates and what did we say actually I think we said it was going to be in the second building but we'll tell you more about that during the day and then at 6:30 as mentioned we have kind of the kickoff presentations where we talk more
about bounties and then we have dinner at the waterfront building so a few rules I'm going to go more into detail about this at 6:30 but don't break stuff don't smoke don't bring the cats inside although they might come inside anyways uh but yeah there's two buildings currently you're in sort of the modern building as we call it but there is also the Waterfront building that we also have access to as mentioned it's only open from 8:00 a.m. to 11: p.m. and it is closed at night bit of a shame we really had hoped we could stay overnight but we can't here um if there's ever an emergency or anything that goes on please find the Z
hack crew we do have an ambulance on site if we need it uh yeah submission time is Sunday November 12th at noon don't be late okay so now Thor is gonna well actually both Thor and Gaylord are going to share a little bit about the ZK tooling landscape each one of our uh Workshop hosts are going to be doing a deep dive into a specific language but we thought it would be a good idea to kind of give you a bit of the lay of the land so please take it away thank you Anna and as Anna mentioned there's a couple of tools dsls virtual machines that we're going to be running through really quickly today so if you maybe don't have the best idea of what you're building yet or what you're going to
build with hopefully this might help you learn sort of like what stuff you might check out to build with and um I just want to emphasize also here that um if you're building with one tool often times you can sort of discover things about how you want to sort of build in general by looking at a couple different tools so even if you have something you're already pretty confident you're going to work out I would invite you to check out some of these uh tools and so I'd like to start with like maybe drawing a little bit of a Divergence between what a DSL and a virtual machine is so if you think about how a program works it's usually compiled to a set of in assembly instructions um that then your computer
executes so a virtual machine is literally they've built a zero knowledge circuit for each uh instruction and then they tile of those CC C together and then produce a program um that proves each instruction set byat um and then probably turns it all into one big proof or does some proving over all of those instructions whereas a DSL is well basically the circuit uh the what you write gets turned into a circuit and often like from the develop perspective uh a virtual machine is going to look more familiar to languages you may already be familiar with like rust for instance is a common uh language that virtual machines tend to Target so if you're already a rust developer these
virtual machines are going to look really accessible and familiar and have uh to a large extent an overlap with the tooling that you're already familiar with on the other hand the dsls often give you a higher level of customizability over exactly how the circuit is going to be laid out and you can usually eek out a bit more performance that way as well the approaches to building these also tend to diverge a little bit in terms of improving stack but that's a bit lower than the weed than we're going to go into so we're going to run through each of these tools now starting with one of the earlier uh ZK uh circuit writing tools the DSL circom so circom was developed by Jordy balina who is with polygon and is a fairly lowlevel uh
extensively supported uh circuit writing library and if you're familiar with like any existing zero knowledge applications there's a pretty decent chance they were written with circom it has a fairly wide Library support and has been a popular candidate for writing zero knowledge circuits for a long time on the other hand it is very low level and so you're going to have very low level access to the way that your circuit gets laid out and that can create that's very powerful in case where you want that performance but it can be a bit overwhelming if you haven't worked with zero knowledge circuits before moving on um next up I would like to introduce lurk so lur is a lisp and if you're familiar with lisps lisps sort of
stradle line between low-level and highle languages and that uh they're basically built as an instruction set that can append new instructions to itself which is a fairly powerful concept and the lurk DSL um is built on top of this list approach to language construction taking advantage of or the the Nova proving system is a folding scheme that specifically takes advantage of the construction of a lisp-like language so if you're familiar with lisp and want I build with lisp I would encourage you to check lurk out next on our list is Cairo by starkware so Cairo is a rust-like DSL and we're starting to get into like the solidly like middle range of like how high level to low level these languages are um so
Cairo is maybe a language that will be familiar to a lot of you it's also a relatively early entrant into like the zero knowledge circuit tooling space and uh if you've looked at Cairo in the past Cairo has changed quite a bit over time it's from its initial release as Cairo zero or Cairo 1 to its current iteration and has a lot more tools for developers to build relatively ergonomic circuits um and if you're familiar with the Stark knet ecosystem there's a lot of great examples uh online so i' encourage you to check that out if you're interested next up I'd like to introduce Aztec Noir language so Noir is a relatively recent entrant into the DSL tooling space um and developers have picked it up as a
language that supports a lot of higher level abstraction over circuit writing it's developed by Aztec and is intended for developers to be able to write private applications that are verifiable either on Aztec uh blockchain or with evm next up i' to introduce you to Leo so you may know uh Leo's developing company Alo also from the Z prize competition which has been pushing forward the limits of how fast we can use cryptographic Hardware to accelerate our proving and verification times um so Leo is a r another rust like DSL it looks relatively similar to rust in a lot of ways and has a lot of features for developers to sort of shape how
they're thinking about how the circuit will be laid out but also it does so in a relatively High Lev way so you have a lot of control over the performance and layout of your circuit in Alo that could be very interesting if you're looking for something that kind of stred the lines between highle tools that give the developer a lot of power but also tools to give the circuit get a lot of performance for writing private applications then rounding out the DSL approaches I'd like to introduce you to 01 JS so OJs is um a I think its unique feature is that it is a DSL that is embedded into an existing programming language that you might already be familiar with if you write uh web if you do any sort of web stuff work with J JavaScript or typescript so Ojos is a
typescript SDK that you can use for computing proofs in the CL client's browser or to do server side prooving so if there's anything that you can think of in terms of an application if you're considering any applications that might be able to take advantage of a client Computing on their local browser that then uh retains the privacy of the client sort of whatever the browser computation is doing types 0js is typescript SDK might be a great candidate for that so if you're interested in working with a user's browser I would encourage you to check out OJs and we're going to finish off with two virtual machines um that both should have some workshops later today um that
um as I said at the top of the talk um virtual machines tend to be relatively higher abstraction in that you're going to be working with uh languages like rust um or well in this case you will specifically be working with rust so Ola is a virtual machine that starts that has the developer WR rust using the Ola virtual machine specific types that look relatively similar to solidity so if you're familiar with solidity or all if you're familiar with solidity already the Ola virtual machine should look relatively familiar for you and Ola is specifically aiming to make both public and private applications possible with private application users able to disclose their data to uh comply with
regulatory responsibility so if you're interested in building say uh for a relatively high level approachable rust based um approach to building a circuit uh I would encourage you to check Ola out last up we shall um visit risk Zero's zero knowledge virtual machine um and risk zero was a fairly popular candidate for the last ZK hack because again it's a rust environment that you are developing your circuits for and what's really special about this is that a lot of the ecosystem crates that you might be familiar Amar with as a rust developer are inherently uh interoperable with the risk zero virtual machine and they're trying to make it as
interoperable with existing rust tooling uh as quickly so you can get developing as quickly as possible and rely on things that already exist so uh recently risk zero announced the Bonsai verifier which is the risk zero um the risk zero evm verifier so if you're a smart contract developer an interesting in interested in developing zero knowledge applications that get verified on chain in an evm environment that might be interesting so just to review we talked about eight different approaches that you might use to build uh a zero no circuit to do some verifiable computation and you might think well I
already kind of know what I'm going to build with I would encourage you to check out some of the things that might sound like they might also be up your alley if you're familiar with with building with one virtual machine check out the differences between them and maybe give that uh bring bring that sort of experience back to the developers I'm sure they would love to hear sort of like your comments on how it feels to build with their tools and in particular if um you would like to start building quickly you might consider building with a virtual machine but you might discover you might want more customizability and you might want to move lower down the stack to take advantage of like a higher uh higher grain tool that lays out your circuit precisely how you as the
developer say it does or you may actually start at that lower level with that lower level language and then realize that for the hackathon to be able to build something quickly you might have to move kind of further up to a higher level environment yeah thanks though so yeah thanks for giving this um yeah overview of the landscape of the different ZK all the ZK to L that's Evol aable so now we have that in mind uh yeah we thought it would be interesting and fun to maybe give a bit of an approach from the Hackus perspective so now you have yeah this idea of the tech that's available okay what do we do now I guess is the question so what makes DK hack kind of
unique compared to the other web three hackathon that most of you probably participated in already is well you have the application building aspect which is I guess similar even though we'll try to focus on ZK Habs here you also have the applied cryptography angle so where you're going to you you can actually Solly focus on crypto Primitives such as you know signature verifying or uh implementation Etc so now it's a second version of the IRL hackathon that we've been organizing so we actually have a bit of History so with that in mind let's try to look at a few examples of past projects and see how they can of place in this uh scope of uh of possibilities that you have at ZK so the
first example we're going to look at is zik safe um so which received the third prices at zikik Lisbon so with this one we're more on the application bu building side so that's a one person team um that's a project built by emilano sadly he's not here and uh his uh the idea he had was to allow um a user to use uh diagnosis safe wallet um not by using private keys but by using the web two accounts so he was able to leverage that and ZK through uh a set of products that were able to abstract the cryptography aspect from here so yeah basically he was able to build this end to- end application without getting his hands uh dirty so to speak uh playing
with the cryptography side so that's kind of one side of the project of course the interesting part is like he figured out there are like maybe a few bags in the products was able to get some feedback from the team they were affing it like on the Fly then he was keep building etc etc did that quite a few times but that's part of the game so so actually be prepared for that so the other side of the spectrum that's another example of something built at Zak Lisbon by You Up 4 the CeX codex team so Dimitri Bas shaba and Jesse uh I don't know if they're here actually no doesn't seem so and uh yeah so that was more from the cryptography angle so they they were like they had a hascal as part of their skill set in the team so they decided to actually build a custom micro
assembler compiler for them to re to implement some implementation for proed to Hash function in circum and miden so you can see how this is yeah the apply cryptography side of my event diagram the interesting part is actually the intersection of it which I should have done bigger actually in the diagram and one example of that is ZK P2P so built by the team of four sain Richard I think they're here yeah I can see you mate hey guys and uh with Brian and Alex so they built an end to-end product but but also they did play with applied cryptography but because they had to work on circum I think it's actually you right sa and Richard you played ZK circuit engineer
if I'm not mistaken Alex was playing I mean was more like connecting the API kind of doing the web at the front end so to speak with Brian uh working on the smart contract is if I'm not mistaken so you can see how the skill set from different people uh can actually allow for building a project within one weekend and yeah interestingly this is actually still live you guys have some anouncment coming on so you see how a project ID at a haaan can actually become well a real project live in prod there are so many more examples like that I try to make it short so I didn't put more than that but yeah I want to mention zero gravity of course because they were the grand price spinner it was a zml focus project there
are a couple others in there uh a couple others that more like application building again with the cryptography being abstracted such as stcl and yeah of course for the friend with my little fru friend here and so yeah you see how as a newbie if you don't know about cryptography that's fine you you will play with the tech maybe find out some bugs but you will be able to build like a proof of concept at least within that weekend that's what you should aim for and if you want to go for the apply cryptography angle well even better because that's what we actually here for yeah and maybe just a last note about the um sort of state of this ecosystem so like there are other hackathons in the web 3 space that are
dealing with tools that are very developed the documentation is developed the tooling is developed it's been there for a while it's you know a lot of hackers have used it in our case I mean this is the second ZK focused hackathon that we're putting together it is VE it is still very very new for a lot of these tools to even be usable I remember at ZK hack Lisbon we were like will anyone be able to build stuff and they did we had 33 projects submitted last time it was amazing but and and we now have six seven months later obviously the tools are that much better but I think teams here you know the sponsors and just generally the ZK teams they love to hear feedback from you too if you or if you want to potentially
contribute to what they're building I think now is still a time that you can do that and so how do you approach this hackathon well you can learn you can just come to these workshops you can meet with the teams you can build which we hope you will do it is a hackathon after all you can contribute so here we think of like you could contribute to a library you could contribute to the the toolkit you can collaborate hopefully you get to find uh maybe your future co-founders or you just get to try out working with a friend and see how it how it is hopefully you can be creative and hopefully you can challenge yourself as well so we wanted to just highlight in the room we don't I don't know if all
the teams are here but our top sponsors who are going to be giving workshops we just want to see is polygon here can you just put your hand up so there's a couple polygon folks here good okay the risk zero folks are they in the room anyone from risk zero oh there might be out in the hall okay Alo anyone from Alo in the room ah okay 0js ow Labs yes okay wow okay we got a couple one Ola yeah okay the Ola people here so all of these teams have booths out there and actually after their workshops we've kind of encouraged them to go back to their booths so you should you can also find them there if you want to use their tools and you have any questions that's where you can find them also the ZK hack
team as I mentioned we're around we're at the info point and you can look for us with the ZK crew sticker we're always going to help there are other sponsors and we're going to go through the full sponsor list at 6:30 um they are also often on site so if you are using a tool that is not in this tool set you can also maybe ask in our Discord to see if someone's on site for those other tools and I think that leads us to the end of our not quite intro intro we have another we have our kickoff later today but yeah this this sort of wraps up our overview of the ZK landscape we're so excited to see you I hope you're excited for this weekend I hope you're excited to build yeah thank you I
guess