Brian Gu | Six ZK Application Ideas

Taipei Ethereum Meetup Talks · 23 Sept 2021 · 38:56

Brian Gu, creator of the Dark Forest game, argues that application-layer progress on Ethereum needs new technology rather than recombined existing pieces, and that zero-knowledge proofs provide it. The talk walks through six ZK moonshots, including a fully onchain strategy game with a cryptographic fog of war, a private data marketplace with escrow smart contracts, and procedurally generated virtual worlds using Perlin noise inside a zk-SNARK. A closing Q&A explores how fully onchain games differ from games that only record asset ownership onchain.

Speakers

Topics

From Taipei Ethereum Meetup Talks; community: Taipei Ethereum Meetup.

Transcript

thank you so much jason for um for having me um i think this is the first uh zk day that i've been able to attend so um super excited to be here uh even though it is a little early in my time zone it's forced me to adjust my sleep schedule to wake up a little bit early um but yeah like austin mentioned my name is brian i am the creator of the dark forest game uh and i also help out with uh ecosystem development and applied zk r d with a number of different organizations in the ethereum ecosystem and today i'm going to be talking about six zk moonshots or why we need zk for the application layer

of systems like ethereum cool so um i want to uh give a quick overview of one framing of what is go what where most of the development activity on the application level of decentralized platforms is right now um so my claim is that over the last couple of years most of the recent work in you know things like anything from decentralized finance to decentralized governance etc um has focused on uh iterating on or permuting existing mechanics

so what does this mean um well you know for those who were at ecc or who saw this talk online um metallic gave a talk earlier this summer about how you know at the moment uh ethereum's main production application is finance um and a lot of the activity that's been going on and decentralized finance has become very derivative so you know as he sort of said tongue-in-cheek um a lot of recent applications reduced down to something that's like giving people tokens and letting people earn yield on their tokens and tokenizing the yield and earning yield on the yield tokens so you know building up these

layers on top of layers on top of layers that after uh some point you start to sort of wonder like what is the point um so you know this is one example i think one particularly uh you know relatively less inspiring example um of people taking you know primitives that already exist like we have a lot of these financial primitives and and money legos d5 legos at the application level right now and just kind of recombining them to see what we get um i think another example of a project that has captured a lot of attention recently is loot um which for those of you who haven't heard of

this it's a very cool nft project that is very very community driven essentially the creator of loot um sort of just released uh i think it was like 8 000 of these quote-unquote loot bags out into the world as nfts and basically he you know gave up control of the project from there left it up to the people who minted these loot bags these bags of nfts to determine what to actually do with the project and this spawned you know there are a bunch of people who came together to build either like derivative projects or artwork on top of this project um or you know different applications that

are integrated to now be able to use loot so really really community driven um and a pretty novel like distribution slash ownership mechanism which i think is uh very cool as far as like enabling a different kind of community to emerge from compared with what a lot of the other like either nft or art projects which um have some like you know central authority like maintaining the project um look like um you know here's one quote from twitter loot is nft improv it is an invitation to respond with yes and um yeah so this is really cool um but i think that fundamentally at the technical level it's not doing uh too much

novel stuff um there's you know it's not like the tech is doing some super heavy lifting it's more that um people have found a way to use existing blockchain primitives um to experiment with like distribution ownership and uh and community um you know and lastly like there's been a lot of work done the last couple of years on wallet and dap ux so for example we've got smart contract wallets like argent or wallets like rainbow we've got you know new patterns like the xdi burner wallet that austin griffith has showcased the last few years and that we integrated into dark forest um you know and folks have uh we can sort

of see over time that the ux of actually interacting with crypto as an end user um has steadily improved and you know folks are really into these wallets like rainbow and argent and all these new sorts of experiments so i think that uh all of these are examples of things that really um like they help a lot with things like mainstream adoption and accessibility um by experimenting with new use cases and stuff like that um but none of these sorts of uh development directions

really move the needle on what is fundamentally possible on decentralized platforms um so we're using like existing technology you know smart contract technology writing contracts with solidity or whatever to experiment with new product ownership models or improvements on ux or experiments into like incentivization mechanisms but you know if you winded back the clock two or three years ago you wouldn't necessarily be surprised that this stuff is at least like technically possible and um the question that we're very interested in is how can we how can we actually move the needle on what is possible to do with decentralized platforms

um and i claim that in order to do this we actually need new technology we can't just recombine our existing tools in different ways by permuting these different lego blocks that we have available to us or by iterating on and making something that already exists better we actually you know we need new technology to do stuff that wasn't possible before for example zk snarks our new technology which is the subject of this talk so basically i'm going to go over six kind of like moonshot zk application ideas where we basically will talk about like here are six things that would not be pot would not necessarily be possible

without zk on a blockchain um but these are sort of like exciting high-level visions that we think could be constructed with the help of zk snarks and which in most cases we actually have some sort of proof of concept either implementations for explorations into so to ease us in the first high level vision slash moonshot is this idea of eve online on the blockchain so those who aren't familiar eve online is a massively multiplayer online strategy game where players basically like they collect resources join player organizations engage in warfare and diplomacy um

and uh it's you know got a lot of the elements of a very rich and persistent universe and the vision here is if you could put something with that level of complexity on a blockchain then you'd have an infinitely hackable and fully decentralized mmo strategy game where players would be able to you know automate and script actions and meta actions write mods write third party clients build marketplaces and you know corporations or dows and all of this would be happening in a game universe where the assets have real world value the zk mechanic here is that uh lots of mmo games in fact i think pretty much all mmo games have some component uh especially

strategy games have some component of you know like incomplete information so starcraft has a fog of war which means that you might not know where your enemy's base is until you send a unit over and scout the map or things like you know your inventory might be private or you know the spells that you have might be private or something like that um in particular i think that the really key thing that we first started experimenting with with dark forest was using zk snarks to hide your location on a map so now you have like a cryptographic fog of war and without incomplete information mechanics these strategy games um sort of uh feel very simple or not as

not as rich which is why zk is very important for these sorts of games um but yeah like we uh you know this moonshot is something that has gradually been realized over the last two years in the form of dark forest there's a new game that we're incubating called zk dungeon but all in all like this is something which would not have been possible without zk snarks and i i think has leveled up what is possible in gaming thanks to zero knowledge cryptography um and if you haven't heard of dark force you can check us out on twitter at dark force underscore eth or you can head over to zkga.me um which is the website you can play the

game on you'll need an invite key so ask a yacin or myself um okay so the second moonshot is the idea of a private data marketplace so what this is is it's an on-chain or you know fully decentralized data marketplace where users um can transact like secret or encrypted data uh for example a private key or a set or a location in the dark force universe or a data set with certain aggregate statistics or a high res image that down down samples to a known low res image any sorts of secret data can be exchanged between a buyer and a seller on chain without

revealing to the rest of the world um you know so uh what is needed in order to build such a thing is uh you need zk snarks to allow you to prove to build these like private data escrow smart contracts um if i am selling you data then and you know i'm selling i'm basically sending you something like encrypted or some secret uh hash commitment or something on chain to you that you're later gonna take in like decrypt or whatever else you need to have confidence and the smart contract needs to be able to verify that that data is indeed uh you know like the decryption of that

data is indeed the thing that you care about um it has certain mathematical properties it reflects um you know a key that can be used to unlock something or it's a data set with some statistics um so that's where the zk proofs come in zk proofs allow you to say i'm not going to reveal the decryption of this data but i can prove that the data has these properties so you know some examples of things that this could be useful for are um one you could sell private content that has public previews right now there's kind of an issue in like how do you how do you implement something like a pay wall like a true pay wall between a buyer and a seller online and

this is you know the tricky thing that happens if you aren't able to do this is that you can only you have like sort of a free rider problem around funding uh content where so long as like if person a is willing to pay for content but b is not um and the content gets released then like you know b gets all the benefits uh even though they didn't shoulder any of the costs um but with this construction you could sell private content uh that you send out previews of into the world like a sample of an article or like a low-res preview of some artwork etc um you could transact secret data sets uh so for example like let's say you have a data set of um

i don't know let's say some like medical data or something like that and you want to prove that this data set has certain properties and transact that or you declare that has some certain properties and you transact that and you could also allow and incentivize whistleblowers to sell secrets um so for example i could put a bounty on like a dark force planet location and if someone has the coordinates to that planet then they could sell it to me via this private data escrow smart contract the third zk moonshot is decentralized minecraft more specifically we'd like to be able to build fully crypto native and procedurally generated virtual worlds so if folks have seen minecraft before

it looks like this sort of top image over here where you have these like very rich landscapes and biomes so you'll have forests and then there's beaches and oceans and mountains and all these sorts of things these worlds are generated with mathematical algorithms called procedural generation algorithms and these algorithms are too expensive to run in the evm itself however zk proof verification is always constant time and purlin noise which is one of the most fundamental procedural generation algorithms can be implemented inside of a zk snark so perlin noise you know a very basic like two-dimensional perlin noise

function much less complicated than the one used in minecraft and produce images like you know this thing in the lower left corner uh lower right corner and what we can do is we can take purlin noise we can you know implement it uh implement the more complex iterations of it put it inside a zk snark and have the verifier on chain and what that essentially does is it allows you to build this whole um you know decentralized and very rich universe um so yeah this is something that is actually built into dark forest a very simple version of it at least and uh in the new game zk dungeon purlin noise is also used to determine the spawn locations of different resources

um but yeah this kind of slew of techniques would allow us to build all sorts of different games that aren't currently possible um rather than something like uh you know imagine like decentraland or crypto voxels or any game where you like sort of initialize onto a blank canvas and that's not very interesting um like you know you have like a hundred by hundred like blank white grid and like players can come in and fill in the grid rather you can start off these universes with uh real features and real sorts of you know um yeah like actual stuff to do so games like stardew valley or animal crossing or minecraft or other sort of games that involve rich worlds become possible on chain um the fourth moonshot is zk machine

learning so uh this one's very buzzwordy but you know the high level question is can we put a neural network on a blockchain um can we have on-chain execution of regression or neural networks or uh other algorithms optionally with strong privacy guarantees and the answer is we think is like possibly yes and the way that you can do that is by putting these algorithms inside snarks and putting the snark verifier on chain so for example um you could put linear regression inside of a zk snark and then put that on chain and then that's essentially like anybody can do the off chain computation for like

running some uh data through the linear running some inputs through the linear regression um and they can upload the proof to the chain and essentially you like now have an oracle for some sort of like you know decision problem that uh an ml algorithm has been trained to solve um so yeah we there's a proof of concept and implementation of this by one of the uh eth university students payroll liao who has put linear regression into a circuit um and uh this is exciting for a number of reasons one is that you know again we have this oracle thing so you could classify data or count activity um on chain like that's a primitive that you could call into and it's trustless as well you don't

need to rely on like some third party or some bridge or something you just need someone to run the computation and then like upload the zk proof um in the future and like this is something that even has to do with like beyond blockchains um but uh you could have systems where like a lot of times i think in the world we trade off personalization for um custody of our data so i like personalized ads but i don't like the fact that google and facebook owned my data you could imagine like ad auction mechanisms that rely on zk snarks where you're zk proving that like the output of some machine learning algorithm on my secret data is like x or y or z

um relevant score and like that's used to auction for like my time on an ad network on like a distributed global ad network um and this is also closely related to like this synergizes with the private data marketplace idea which is which uh basically in conjunction would allow you to sell secret data sets or models while proving that these like this is a model that achieves a certain performance on a publicly known data set or this is a data set that is indeed like this is some data that is um you know like this machine learning model that is publicly known uh demonstrates that this this data is interesting or relevant or you know has a certain proportion of

something or other um moonshot number five is uh private asset slash inventory commitments um this is a little vague so i'll just mention the specific mechanic uh this is a specific um thing that we are interested in building is a fully decentralized trading card game so card games like hearthstone um have inspired a lot of projects uh a lot of like um crypto gaming projects like uh for example sky weaver or gods unchained but these are not truly crypto games they are more just like the

assets and ownership of cards is recorded on chain and then all the gameplay happens off-chain and one of the reasons for this is because card games are really hard to implement in a decentralized um environment so if folks have heard of mental poker before um it's really hard to play like poker in a decentralized way um and specifically like one thing that's really hard is being able to draw cards privately but randomly for it from a deck randomly is hard because there's all the problems of generating randomness uh in a decentralized environment that is uh you know unbiasable and privately doubly hard because if you're drawing stuff privately then

how do you actually check that this stuff is um you know you've you've done all your drawing and stuff according to the rules and you haven't cheated and swapped out one of your cards or something like that um there's like schemes like commit reveal that sort of um that will help with this but those are ultimately like unwieldy and pretty uh limited for several reasons um which we won't go into here but um you know one thing that's very interesting is that zk snarks um can be used to very cleanly implement a number of the relevant primitives here like privately drawing a card adding it to a hand playing a card or even like crafting cards within a hand um so

we have three sort of experiments into this sort of thing so we definitely know that it's possible um we like so the dark forest team built a sort of proof of concept demo game last november called boat fight um which had this like card drawing element uh and then two teams from eath university built card games that were based around dk snarks as well just to kind of show off the card primitives and yeah like i mentioned um this would enable us to build like a fully on-chain trading card game but also beyond that i think this is actually quite a general construction um oh so there's a question mental poker is audible after game ends yeah so i can um

speak to a little bit of the limitations of of systems like commit reveal um so one is that you have to do this audit at the very end of the game and like the length of the audit scales with the length of the game so if dark forest was implemented so you know why can't commit reveal be used for dark forest um well dark forest has like uh players are making like hundreds of thousands if not like millions of moves in total and this is not something that is feasible um the other thing is that like commit reveal is predicated on games being eventually complete information on you know it being

possible for like for the game having an end and for everyone being okay with things being revealed at the very end of the game but this is not always true so for example in a persistent game like dark forest um there's no end point where you can reveal everything and furthermore like you know even in games that do have a definite end it's not always the case that people would want to reveal their secret moves midway through because that might reveal their strategy it is the case for poker that everything can be revealed at the showdown or if you choose you can choose to fold instead of reveal um but this is um you know still still limiting for like the total class of card games that could exist

um but yeah i think we think this is a pretty general construction actually and you know it can be used for any game where there's a con or any environment where there's the concept of a private inventory um so in an mmorpg this might be your inventory or your bank account there's kind of a basic expectation of privacy in these virtual worlds that you can't just like look at anyone else's bank account um and along with the private data marketplace stuff you could have people exchange um private uh you could have people like trade or exchange items privately sort of inside of a single smart contract uh while maintaining the privacy of their inventories

and the last construction that we have is the idea of a zk message board where you have a fully decentralized message board that gives mainstream users privacy and power over their data while allowing user users to signal uh credibility like that they have a certain reputation score that they're a member of a certain group um and uh there's an there's a number of different um projects that have sort of proven out some early concepts here one is the semaphore team that's supported by ethereum foundations uh applied um zk teams and also there's another eth university team

that was working on a simple sort of polling slash voting slash posting app but yeah this one's exciting because you can have anonymous whistleblowers who signal credibility of claims without putting their identity at risk but they can sign using zk proofs saying like i am a member i'm like a u.s senator or something like that um you'd have these message boards where people prove that they have been on the message board for some period of time or that they've accumulated some amount of karma without revealing their posting history and you can have things like voters signaling support for a proposal in an environment where they might not feel comfortable doing so publicly but if enough people feel to feel a certain

way in private and signal this to each other then um people can can get together and this maybe can help out with some of the negative externalities and politics that cause stuff like polarization where if your votes are public then you feel like you have to vote the party line um even if like half of your party would vote against the party line if they could only coordinate and get together and realize this um so yeah in summary um i think that the next step function and ethereum apps won't come from doing existing stuff better it'll come from being able to do things that weren't possible before these six ideas are are things that would seem like moonshots or impossible

today with the existing technology that people have used to build like loot or defy apps or better wallets but um they are possible with zk crypto and we think that zk crypto will play a vital role at the level of applications and not just protocols uh if you're interested in helping out with any of these projects or getting involved with the ecosystem that we are building um then feel free to reach out we'd love to chat my email you can find me at brian xeroxpark.org 0x park is a new research organization slash foundation

that we are setting up to help support the development of applications like these including dark forest and zika dungeon and eath university it is basically going to help support things with uh you know grants community initiatives um supporting like public infrastructure stuff like that funded by donations and grants itself um so also if you are a part of or a representative of an organization that's looking to support research work uh then we'd love to get in touch as we're currently raising a round of grants um but yeah that's pretty much it for my talk thanks so much for having me thanks so much for sharing

uh it's a new is is it is a new organization recently funded the xerox park yeah so uh this is very recent like as of the last i mean we're still actually going through the incorporation process right now and we got our first funding commitments um in the last few weeks um but this actually isn't publicly announced yet it will probably be publicly announced in the next few weeks so i guess you get a preview here that is pretty cool any questions for brian sorry if the question is a little bit

stink but for uh i bet everyone everyone here has has already heard about uh the sc fantasy and it's a completely different thing from dark forest i know but for the i mean the moonshot applications to be successful we must have one very interesting not not to us geeks but to general people that people will start to embrace them in maybe mid to large scale and regarding dark forest i mean it's very much although i haven't played it myself yet but it really seems like a a newer more exciting version of our old old browser-based games and what are

your plans i mean your team to integrate something more exciting i mean it's more for the personally i think it's exciting but for the normal people that they'll start joining it and maybe maybe to make it a trend but i don't know if that in line with your vision because you know it's kind of this idea kind of things if you want to keep it pure what's your thought about it yeah this is a great question um i think that uh you know like you said dark force is pretty interesting i think for geeks as well as zk dungeon to some extent as well

this is one of the reasons i'm really excited about this third moon shot which is the procedural generation algorithms inside zk snarks because games like you know stardew valley or animal crossing or minecraft are much more inclusive and i think you can have much more mainstream appeal but right now the sort of mechanics that are possible to implement or that we have implemented with and i think are easiest to implement with zk snarks are very pure ones so they're like strategy mechanics like the fog of war or hiding like um your cards in a card game uh but i think that it you know the end goal should be to build for actual users um

and i would like to see a game built off of the purlin noise construction that is something that's friendlier and more accessible to like a mainstream audience and that's something that will have to happen in conjunction with improvements to ux and new application design patterns i mean those those five ideas they are very much i mean people people in the people who knows about vk they would they would think they would stick that like yeah those are we can native and not something not something to just fancy words for the investor to put more money in but in in i mean

in a sense probably i mean those your average gamers they they don't want something that is necessarily percent vk wars they may just want to have something that they can they can be bragging about like an ft so it's not like i agree with this kind of mindset but it's a participant in the ecosystem myself uh sometimes i would say this kind of mindset i mean more deviate to the evil side not non-politically correct side will actually be beneficial to the to to the to the promotion of of the vk applications but maybe it's only it's only me but

yeah sorry i don't have a concrete answer for that i mean for how to promote again oh i see what you mean um or i think again correct me if i'm wrong um i guess yeah so there's one question that's important to answer which is why build games in a pure and decentralized way i think this is a little bit of a longer conversation but um the big thing to me is that you get interoperability so what can happen if your entire game is on chain um and uh i have another project for or another presentation from edcon where we where we talk about this um

but the basic idea is that if you have interoperability then players can start building on top of the game they can build in new features so someone can write a smart contract that's like you know a player corporation or a marketplace or they add a new resource to the game um or they build a game inside the game and you're able to leverage the players creativity uh thanks to this um thanks to the fact that the game is fully on chain whereas like in games where the gameplay is not completely unchained um players cannot like the community is not able to provide as much or to build as much on top the other thing is that decentralized games can interact with each other

so yeah exactly like some sort of gaming legos um but yeah so you could have like one decentralized game can permissionlessly just grandfather in the accounts or reputations of another one or the leveling system or anything like that um i like maybe the simplest example is that items can be easily accepted by like a new game that someone builds can easily accept items from a previous game where they're like you know maybe zk dungeon says um if you you know deposit your dark forced pyramid artifact into your zk dungeon heart then all your units power up and that makes the you know dark force artifact much more real it becomes something that you can like pick up and carry around with you around the

metaverse um or things like imagine if you could take your sword from world of warcraft and bring it with you into runescape then that sword becomes like very more like real object so the end goal definitely is to actually build out new experiences um it's not purely experimentation and i think this is what's made dark force relatively successful in the community is that there's a rich um like a huge part of the gameplay experience is using other players mods or interacting with other players smart contracts via marketplaces or other things so so that's precisely what you meant in this site that we need some infrastructure some legos that we can

build upon and in the future like there's an example that i can raise there's a app called robologs and and kids inside they build against they sell games but in a sense they're being exploited by the i mean it's a billion market market market for the um on inform but there are some in a sense they are exploited abused by the company which is hard which is very centralized and yeah by doing this and the metaphors thing and example i mean the equipment transfer you've just mentioned that sounds really like a killer future that we are we're going to to build to build on police so yeah thanks for

sharing that's very insightful awesome yeah thanks for the question um actually i have a follow-up question for that um you kind of hinted to that actually um with uh mentioning other popular games and um i wonder if it would be possible to have some sort of uh interconnection of like uh conventional games and like build some blockchain based uh interface on top of that so for example if online allows you to call a lot of stuff from the game you threw a api and then like you you could like basically uh take that and like write some stuff to the to a blockchain that could uh

extend the game do you know of any of those or like of some project like that or what you mentioned with minecraft world of warcraft i don't know yeah i think like one of the things that comes to mind and correct me if this isn't what uh an example of what you were thinking of was um you know just games that allow assets to be or asset ownership to be recorded on chain so this is sort of like the you know those trading card games gods unchained or uh sky weaver i think that personally for us we are less interested in these applications because they don't allow

as much extensibility as compared to like crypto native games which is what we think is most exciting um i think that the more of the game is on chain the more the community is able to build on top of it and if all of the game is on chain then that unlocks something special where the community feels like they are completely empowered to own the game um and and build on top of it rather than being you know they're being like any particular entity that dictates uh a part of the gameplay experience yeah the usually the publisher wants to retain some sort of centralized control uh

for many reasons and yeah i think this approach would just help for like better mass adoption because like uh you can take popular games and like see if if this crypto add-on would uh catch on right um yeah um yeah let's see i think uh yeah we'll we'll see definitely more experiments in all directions uh um yeah i i mean we definitely welcome experiments into you know starting from something that looks more traditional or centralized and then moving towards or adding on top decentralized mechanisms i think that like games don't need to be

completely unchained to be successful commercially or artistically um in the crypto world uh but in terms of the experimentation direction that we think is most underserved uh like i think that there's actually a fair number of teams that are working on taking like normal games and adding crypto on top but there's very few teams that are working on building from the blockchain from you know day one uh for their games and that's something that i think we're the most excited about as a result yeah i i do definitely love blockchain games um but so far it always um like felt uh a little more experiments for geeks and uh not very ready for like being a

blockbuster game yeah yeah i spent my worry but i definitely follow that development same yeah thank you uh yeah thanks everyone for participating today special thanks guys to uh kevin jama who curated the entire program

Related talks