New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

End-to-end internet games

Devcon 7 SEAWed, Nov 13, 2024, 06:31 AM · 24:47

For the past 1.5 years, I've been building fully onchain games–games where the entire state is onchain for some reason (have launched 7!). There is lots of cryptographic data floating around the internet. New primitives are allowing all this data to be interoperable with each other... and even verifiable on-chain. I'll discuss some of this tech (tls notary, app attest, zkml, etc.) and discuss what new wild games we can build with them.

Transcript

Hi everyone. Thank you for the intro. Welcome to DevCon. And to end Internet games. That's what I'm going to talk about.

But before I talk about it, I am going to go on a quick digression. When people who have regular brains come and enter crypto and we talk to them, one of the ways we describe it kind of endearingly is magic internet money. And I want to focus on this term a little bit, specifically the internet part of this term. Because when we say magic internet money, we usually mean a couple of things. We mean like culturally and community-wise, a lot of the things that drive trends in crypto are very, very similar or born out of the internet.

We kind of also mean that like crypto isn't money backed by something physical, it's backed by something digital. And so it's internet native in that way. But the definition I am most concerned with is the one of internet native money. Which is a definition that actually was brought up in, you know, people have been talking about it since 1995 when they've been criticizing the fact that there's no form of payment native to the internet that flows across the internet the same way packets of data do. And in some senses, crypto maybe has met this goal, right?

Like, I can do programmatic payments. The payments happen 24-7. Like, right now, in some some cases they happen nearly instantly, but I think the point I want to put in your heads is kind of an obvious truth that we know which is that interacting with blockchains just like feels very very different than interacting with the internet like, in fact interacting with blockchains feels like you're in this weird parallel reality that's kind of next to the internet, with different physics and different rules and gravity works upside down. It's super weird. Even as somebody who's internet native and grew up on the internet, when you walk into the world of blockchains, you start feeling very different, and you need to relearn a bunch of stuff.

And I think in that way, crypto as it is now does not meet the definition of internet native money. And to take something Albert Nee said yesterday, which I really, really liked, is Ethereum, Ethereum is like an island. Like, everything works super nicely on this island, and things are great, and there's a few narrow bridges to the real world. And those bridges are getting, like, larger and better, but they're still, like, bridges, and they're still few and far between. And maybe it's more so like an archipelago, you know, whatever.

The other point I want to make is that when you do cross this gap, lots of value is created. Two of the most consensus valuable things this cycle, stablecoins and polymarket, both kind of come from applications where, you know, in some sort of very simple way, blockchains are connected to the real world. In stablecoins, you know, somebody custodies local currency and gives out a token. In polymarket, markets are resolved by an optimistic oracle. Somebody says this is a resolution to a market, and then there's a voting period where governance can decide whether that's okay or not.

In both of these cases, there's like kind of significant operational overhead, but there's a lot of value that's created kind of when these two separate worlds touch. One interesting thing I'll note is like, and this is just like kind of a vibes-based point. Honestly, this talk is kind of just a vibes-based talk. We'll get into some specific stuff soon, but it's going to be mostly vibes. One interesting thing that I'll note is if this is the real world, and this thing is the world of bits and the internet, stablecoins and Polymarket and things like that, like crypto applications which jump out of the blockchain, kind of miss the internet entirely.

I'm not saying that this is good or bad, I'm just saying that it's interesting. Like, as somebody, you know, thinking from first principles, I would have expected a bunch of internet data to end up on the chain, like, before we have, like, on-chain vapes and stuff. You know, just surprising that we ended up in the physical world before we ended up in the internet world. And that's what I want to talk about today, is want to talk about like how we can make Real of magic internet money and aetherium can write more programs that I own two and you own three and you transfer me one So like maybe more largely like how can we make magic internet apps and by this I mean apps which don't feel like like this But which feel like this like ingrained with the fabric of the internet I mean, I don't have a good answer, but I do have three different sparks. And these three different sparks are just three different sparks of tech, which I think enable people to build magic internet apps, which we're just starting to see now.

And some you may have heard of, and some you might not have heard of, but I'm going to spend some time talking about these three different Sparks and what their trade-offs are, and then we will open up for questions. Oh, also, I think, like, just shoot your hand up if you're confused. I'm down to do that as well. But anyways, here we are. So the first Spark is TLS Notary.

And TLS Notary? Raise your hand. Yeah, sweet. Most of you. I think this is the most common one out of the next three things that I'm going to talk about.

But TLS Notary has a lot to do with this little lock you see in a browser. When you visit any website on the internet, at the top of your browser, you usually see this little lock. If I go to Google.com, and I know that my messages with Google.com are encrypted.

Like, nobody in the middle can see them. Only me and Google can see them. This is because of transport layer security, and generally how this works, I'm going to be very reductive, but generally how this works is there are two steps. There's some sort of handshake between me and Google where I verify their SSL cert to know they're actually Google. And then we create a shared key.

And then it's just symmetric encryption the whole way from there. TLS notary is a way. And so with the context of what I'm talking about, what you should be thinking or what you might be thinking is, all right, there's some cryptography going on. When I visit any website on the internet, when I get any response from a website on the internet, like, what if I could hook into this cryptography to bring it on chain? And TLS Notary is a way to do that with a bunch of caveats.

So before we get to how this thing works, we're going to start with a simpler problem, which is, like, if me and David are doing something together. And I want to convince David that I got a valid web response from a website. What TLS Notary would do is instead of me engaging in TLS with a web server, me and David jointly engage in TLS with a web server. And we do a multi-party computation and we create that symmetric encryption key together and we do it in such a way where I don't need to reveal most of the data in my TLS connection. I can only selectively reveal what I want.

So, for example, I might only show David that I have $110 in my Wells Fargo account by logging on to Wells Fargo, and David can kind of know beyond a doubt that that is true. The problem is, once we have this, how do we bring it to the chain? And this is where the notary comes in. The notary is essentially a hack because I can't do this sort of multi-party computation with a chain itself. And so we just do it with another server, which we call a notary.

And then the server, like, sticks a signature on this and then the chain just does a signature check and like this is fine but like obviously weird for for you know the the obvious reason which is that you're trusting the notary and so we see interesting things that people do kind of from this jumping-off point which is like for example reclaim protocol on their white paper talks about how they can create a network of different notaries with economic incentives to make sure they're honest. There's people doing things like running TLS notary on like Eigenlayer AVSs. There's a bunch of different things you can do to make this better. Like maybe the dumbest one is just checking with multiple notaries to make sure you're okay. Anyway, so we have this tech and it's running.

And what this means is we can take any data that's on the internet and kind of efficiently, cleanly bring it on chain. We don't need to go through an oracle process. We can just be like, hello, blockchain. I have a valid response from this webpage. And now it's a fixed point people can collaborate around.

And it's somewhere we can move money around based off of TLS Notary that I'm going to talk about for like a minute and then move on just to give you a little taste of the stuff you can do. The product is called Tomorrow.News. What Tomorrow.News is, is it's a prediction market for tomorrow's New York Times headline.

And unlike the most prediction markets, where you have to choose either A or B, like Kamala or Trump or whatever, in this prediction market, you can type in any sentence, any natural language sentence, and the market will resolve based on how close your guess is to the truth. Specifically, in this case, based on how close your guess is to tomorrow's New York Times headline. Now, how do we pull this off? We pull it off with two different tricks. One trick is we use sentence embeddings.

Sentence embeddings are a trick from AI where you put in a sentence, you get a vector, and you put in another sentence, you get another vector. If the vectors are close to each other, the sentences are close in meaning. I like cats and cats are good of a short vector distance. I like cats and the moon is blue of a much further vector distance. We can use this to resolve the prediction market.

But how do we bring that result and the result of the New York Times on-chain? We use TLS notary. So specifically, when I make a prediction, I put an embedding on-chain. And when I want to resolve the prediction, anybody can resolve the market. To resolve the market, they provide two proofs.

One is a proof that this sentence is tomorrow's valid New York Times headline. That's a TLS notary proof. And the second proof is that this is a valid response from OpenAI's embeddings endpoint. And the nice little hack here is, like, you can use ZKML to get inference on-chain, but, like, TLS notary provides a nice little hack to get the output of an ML model on-chain with a different trust model, which is just like, check the OpenAI endpoint. And so we actually put this together and launched it.

And you can play right now at tomorrow.news if you want to see an example of that. But that's one sort of thing I'm very, very excited about and I think is totally underexplored, is you can take any data from the internet, obviously a ton of meaningful data and move money around based off of it and even compose on chain the same way you do in like defy based off of it this seems to me like a very ripe area for exploration okay breath spark number two has anybody heard of apat test cool all right couple of people. What Apatest is, it's a protocol from Apple that's used to prevent fraud in mobile apps. All it is, it's a way for a server when it gets a request from a client to know two things.

One that this request is from a valid Apple piece of hardware, like an iPhone or an Apple Watch or whatever. And two, that the request it got is from an app running an unmodified version, an untampered version of a certain app binary. And so the iPhone hasn't been jailbroken or anything. And so developers use this to give out premium content, things that are gated by payments. They use Apatest to limit fraud in those capacities.

Let's dive into how Apatest works. Again, I'm being kind of reductive to get the point across. But how Apatest works is your app generates a key pair. Your app then engages in this fun black box, Apple doesn't tell you how it works, back and forth protocol with Apple in order to convince Apple that it is indeed, one, a real iPhone or Apple device, and two, an unmodified version of your app's binary. Then your app can generate attestation objects which look something like this that your server can then verify to make sure that this, to say that this request came from a real app running this binary.

And, like, the important part of this attestation object is this X5C, just like a certificate chain. And some friends actually recently figured out a way to verify the certificate chain in SP1, which means we can now make ZK proofs on it, which means we can now verify those proofs on-chain. And so this is really, really interesting, because now we can verify on-chain that an iPhone, a real iPhone, running a specific app said something. And I feel like this is just a huge opening of gates, because there's, like, a lot of stuff on an iPhone. There's, like, location sensors.

There's, like, audio sensors. There's, like sensors, there's like audio sensors, there's like local ML models, there's like health data, there's your contact list, there's all this insane stuff on a phone that you can now like really cleanly verify on a chain. And some fun things you can do with this are like you can make an app that airdrops tokens like based on how far somebody's phone drops. And you can also do useful stuff. Like I feel like this like kind of opens the gates for, you know, there's still a lot of problems to solve here.

But I feel like this is like a meaningful step in opening the gates for decentralized versions of like Airbnb and Uber, which can verify location data, you know, some sort of way to generate maps in a peer-to-peer way, like social consumer apps that bootstrap off of contact lists that are on-chain, and like on-chain versions of games like Pokemon Go. Like I think this sort of stuff paired with like the fact that right now we're at an insane place in terms of like consumer onboarding to blockchains means we can build like really new and wild and creative experiences that are fully on-chain and leverage the chain in interesting ways. All right, deep breath. Spark number three. Spark number three needs another little digression, like the one we started off at the beginning.

Here is a black line that is the kind of, like, bottom layer of stuff on the Internet. Yeah, so, like, here are all, like, the bottom layer of stuff on the Internet. Yeah, so, like, here are all, like, the services we commonly use on the Internet that, like, hold a lot of interesting data, like Twitter, you know, whatever, you get it. Like, there's a couple of nodes on the Internet, on the graph of the Internet that are, like, very important, hold a lot of, like, very meaningful, interesting stuff. There's some businesses built on top of those nodes.

Honestly, not very many businesses. I had a pretty hard time thinking about them and finding them, and it makes sense why. For example, Tweetbot was built on top of Twitter. I don't know if it exists anymore because of the API to help you write tweets, better Twitter clients. Games were built on top of Facebook, etc.

But it makes sense why there aren't that many businesses like this, and that's because there's a sort of risk in building a business like that, right? You're just totally dependent on the provider. And on top of that, you're dependent on the provider having good APIs and open APIs, etc. that are actually useful. And you literally see no businesses, like even one layer above that.

Because not only is the risk multiplicative, but it's very hard to understand data you get one layer out from the bottom layer of the internet. In fact, to verify and build something real off of data that you get one layer out from the top layer of the internet, like if I get something from TweetBot's API response, I also need to connect to Twitter to make sure the original data is valid in a lot of cases. And so not only is the risk multiplicative, because you have risks at two levels of APIs, but the data gets more and more annoying to deal with as you go up the layers, because you need to deal with everybody below you. Some friends at Xerox PARC have been working on a solution to this called pods. I think there's many more better talks happening at DevCon about this, so definitely go to those.

But the one thing in here that I'm excited about and that is relevant to this talk is the fact that pods provide really easy ways to create pieces of data that not only have verifiable claims in them, but can then be computed on to create another verifiable claim that can be verified in itself without checking that everything, checking everything that came before it. It's, like, recursive in that sense. Like, I just said a bunch of words. Like, what does that mean? It means, like, I can get a pod that is, like, a verification, an attestation to, like, my age.

Let's say like my age is like over 20. And then like somebody else does some compute on that and is like, all right, my age is over 18 based on this compute that I did. I can look at that, give that my age is over 18 with the proof that it comes with it. I can give that data to somebody else and they can be convinced of its validity all the way back to the root after just verifying one succinct proof. And, like, that is really, really interesting.

Because what it does is it, like, enables you to build higher on top of this tower. And, like, turn this, like, kind of, like, very low, like, we have very small buildings on the internet. And lets us build, like, really tall towers of businesses on the internet. Again, this is, like is very vibes-based, and I don't even fully know what's crazy and interesting here, but it does feel like another dimension of building stuff is open. And this also is very related to the other things I talked about in the talk, because many of these proofs are easily verifiable on-chain.

And so you can kind of see all of these things coming together. Anyways, those are the three sparks. And to summarize, like, again, reductively of like my own talk, blockchains are a very complementary type of computer to the Internet. Like, they're annoying to deal with, but they're very composable because we're all building on the same computer. They create these fixed points that we trust, and downstream of that, we can move money around based off of them.

Compare this to the internet, which is this very ephemeral, fast-flowing, non-fixed-point thing that's very, very useful for quickly building stuff and iterating and it's super cheap. Very different types of computers. Currently, the apps we've been seeing built that are blockchain apps are kind of like this. They exist within the silos of their chains and there's very limited but very, very interesting points where which they touch the world. All the point, the one thing I want to leave you with is the next time you're dreaming up what to build, I think we've explored a lot of apps like this.

Like, I'm very interested in what apps that feel like this look like. And I actually do think we have the tech right now to start messing with stuff in that domain. Yeah, so that's the talk. I'm very excited about this and very excited about building stuff like this. The best way to contact me is to DM me on Twitter or, like, find me after.

Yeah, 30 seconds left. Perfect. So I will start taking questions. Thank you all. So if you have questions, scan the QR code.

You can ask them. We've got a few minutes to get them in. But we'll go ahead and start with the top one. In earlier slide, you mentioned the headline prediction market. It appears to be a blank page right now.

Oh, yeah. I'm stupid. I didn't put the link up. It's tmr.news.

You can go play right now. The headline prediction market I think was a great example of the stuff I was talking about, but I think it was specifically a bad product because it turns out that the New York Times headline is kind of a category. It's one of four things. It's the election, Israel, a hurricane. There's just a couple of things that it is.

It's really hard to ask users to write a complete sentence. And so I think the right path would be finding somewhere where an expressive prediction market actually creates a ton more value. But you can literally go to tmr.news right now and type in a prediction for tomorrow's New York Times headline and the market will resolve tomorrow and you will do well based on how close you are in meaning to tomorrow's headline. Yeah.

Cool. So what would it take to actually put an embedding model on chain? So the trust route will be native to the chain? Sounds like proof we can extract with optimized ZK. I don't know exactly what the trust root will be native to the chain means.

I think there are two ways right now. Like, I would practically put an embedding model on chain. Way one is the one I did, which is you TLS notary proof the OpenAI API. And they'll call it ZKTLS. What the ZK is is, like, after you get the TLS notary proof, it's just like a ton of, like, for OpenAI, it's a bunch of JSON from their response.

And then you use ZK to say here is the actual embedding that I extracted from it. Actually, we don't even use ZK for that one. We just parse the JSON on-chain. But usually you get a massive HTML from TLS notary and you need to do some nice ZK to run a regex over it and make it it useful on chain. So that's the first way I'd do it.

The second way I'd do it that's, like, maybe has a better trust model is, like, embeddings models are, like, actually pretty small, and so, like, Ezekiel or, like, some ZKML solution could just generate a ZK proof of valid execution of a forward pass on the model, and you could verify that proof on chain as well. Yeah, but both are valid and, I think, just have different, like, trust models. Awesome. Next question, based on all the advances you described in the talk, what do you want to build next? I'm actually building a talking rubber duck next that has little to do with this.

But one of the things I do want to build next, like, I'm very interested in, like, stupid, fun stuff that makes me happy. And so the one idea that I threw in there that didn't seem that cool, I then was like, we can do useful stuff with the phone drop thing. I actually love and want to build. There's a bunch of super interesting ZK Appetest things that you can do. You can build location-based on-chain games.

There was this missile game where people would shoot missiles at each other and then they would literally have to get out of the physical location to not get hit by the missile. That was an iPhone game from a long time ago. I think it would be fun to do an on-chain incentivized version of that. There's an infinity of notebook of ideas I have with this stuff that I'm happy to talk about, but I'll cut myself off there. Yeah.

Cool. Web or mobile? Both? I don't know. It depends what you're making.

Okay. Was it better to do polls rather than writing a sentence for TMR News? Yeah. I think this was the initial point I made. For this specific thing, it's maybe a better product to do categories.

I think that's not to say there isn't a place where it's literally better to have an expressive prediction market where you can type in anything. And that's really, really not to say that there isn't a blue ocean of stuff when you can bring meaningful internet data on chain and then have money move around based off of it. I think that's the real point I want to make in this talk. Okay, probably the last question. How do you feel about TEEs, Trusted Execution Environments, as a stepping stone to the ZKTLs, another tech for composing real world with a blockchain.

How do I feel about TEEs? I don't know. I don't feel much about TEEs. I have thoughts about them. I mean, I think like they, look, I think like SGX gets broken a lot.

I think they're like very useful and you can do interesting stuff with them. Like a lot of the stuff that Flashbots is doing with like writing is very, very interesting, right? Like you can like give up your account and write based off of your internet accounts because the TE owns it. I think that's really, really interesting. Yeah, they're like really good for adding private information to on-chain games in certain interesting ways.

Yeah, cool. A lot of stuff.

Automatic transcript — names and jargon may be misspelled.