Charles Hoskinson: Cardano | Lex Fridman Podcast #192

This content was created by LARRUZ. This content was uploaded by LARRUZ. This is a YouTube video titled "Charles Hoskinson: Cardano | Lex Fridman Podcast #192" featuring a conversation between Lex Fridman and Charles Hoskinson, recorded on June 16, 2021. The discussion covers a wide range of topics including the philosophy of programming languages, the use of Haskell in Cardano, the nature of cryptocurrencies, and philosophical insights from figures like Bertrand Russell and Saul Kripke.
Chapters
The following is a conversation with Charles Hoskinson, founder of Cardano, co founder of Ethereum, and a mathematician who's one of the most well read and knowledgeable people on the technical side of cryptocurrency that I've ever spoken to. Quick mention of our Sponsors Gala Games, Allform, Indeed, ExpressVPN, and Asleep. Check them out in the description to support this podcast. As a side note, let me say that Charles is not just a mathematician or cryptocurrency innovator, but also a Colorado based farmer of bison and mushrooms, a gamer, a fisherman, and a world traveler. When I asked him if he has a nice professional picture of himself, he sent me a picture of him in Mongolia with a hawk on his shoulder meeting the Mongolian President. That to me pretty much says it all. Speaking to the humor and the intelligence of a man who's bold, innovative, does not shy away from a bit of fun and a bit of controversy, which makes him a fascinating human being to explore ideas with. I do want to say, in terms of ideas that at least to me, cryptocurrency is much bigger than just a way for a few Americans to make a quick buck through meme driven speculation. It is technology that enables freedom from oppression, from suffering in the world because money is power. Mongolia, for example, was a reminder of that for me. Next day, after talking with Charles, I spoke with Wyoming park, who is a North Korean defector and who spent time in Mongolia as many defectors do in her and their escape from North Korea. Her story, the story of North Korea, the story of atrocities throughout the 20th century committed by Hitler, Stalin and others, is a reminder that the world is full of darkness. But it is also full of beauty and love. And it is a world worth fighting for in every way we know how. This is the Lex Friedman podcast, and here is my conversation with Charles Hoskinson.
Let's start with a fun question. If we're living in a simulation, what programming language do you think it's written in? And maybe from a software engineering perspective, what do you think are some of the design principles that it operates under?
There are a lot of really lovely papers. Like one came out of msr, the Autodidactic Universe. Did you have a chance to see that? Oh, you got to read it. It's like April of 2021. It's just brand new. But basically the idea is that the universe is like some sort of giant self learning system that can self evolve, almost like gnomic. And then you got Wolfram running around saying hey, we can come up with these very simple rules and we can reconstruct all of reality at some arbitrary point. So I have absolutely no idea what's right. I look at it kind of like a formal system and I say, well, if you're stuck within the system, it's hard to actually understand that you're inside the system. It's kind of like an object language to a meta language. There's this thing that is outside of it, but because you're constrained and limited by the simulation, you can't really understand the nature of the thing that's outside of it. It's almost like Minecraft. You can build these redstone computers within Minecraft and simulate and emulate things within it, but you really can't go outside of that environment.
The people outside of it can formally prove that it's correct or whatever, but the creatures inside of the system can't hope to perfectly understand it and prove something about it.
Well, also the question is, it's a computation question, Does P = NP? Because you'd have to be able to emul all of these.
How long will it take?
Yeah, exactly. And so I have no clue what type of language it would have to look like, but it would probably not be anything we're used to at the moment. It'd have to be something else. And we'd have to have some more fundamental resolution of the relationship of these formal systems and how they get extended. So that's like a 22nd century question instead of a 21st century.
Do you like, do you find the Stephen Wolfram idea compelling? It's a very different way of programming, which is you set some rules, you set some initial conditions and let it run and see what happens.
Yeah, and it's not a new concept. I mean like the Santa Fe Institute's been doing that for a long time. And you can use it for economic modeling and you can show that in certain cases there's this concept of simple rules. Evolving into a complex system is somewhat more predictive than trying to build a complex top down model for things. And I guess there's some analogies, these things in AI where you start with some simple things and then somehow it just figure stuff out in its environment over time and much better than if you actually tried to model it with Prologue or something like that. So that is exciting because you get to just do a few things, let the thing run and then see what happens. And that's a lot of fun. In fact, it got so exciting, Wolfram came to us and he said, hey, let's do an NFT marketplace. And I said, what do you want to do? And he said, I got all these universes to sell. I said, okay, well, that's going to be fun. So we're going to set up an auction system or something like that with him, and I think maybe end of this month or next month, we'll figure out how to do NFTs on Cardano with Wolfram Universes. So as soon as we can sell one, I'll give you one. And then we can all just claim that we're living in some sort of Wolfram simulation.
I don't know how much money I have, but I'm going to give everything I have to get Rule 30, which is one of his universes that he's created, one of the first ones where he discovered some interesting complexities.
I think Rule 30 is turning complete. Or is that 45? I can't remember which one.
You know your stuff. Actually, I'm not sure if they proved anything about Rule 30 in terms of whether it's Turing complete or not.
Okay.
But there's fun competitions on it, which is trying to predict something about Rule 30, about the way it evolves. And so far, nobody's been able to do it. Just like looking at the middle column, try to predict as the system evolves, say anything conclusive about the future of the system as it evolves. It's fascinating. It's both beautiful that simple rules can create that kind of complexity, and it's also sad that we can't make perfect sense of it, like, perfectly predict the future. Even though it's all simple and deterministic, we can't say something conclusive about when the thing will end. When will this little cellular automata evolve in a certain way? And then nuclear weapons will be invented and they blow each other up, and then it'll just be this empty one. D. Cellular automata.
Well, doesn't that make it fun, though?
Yeah, it's fun. Fun. But when you're trying to create and we'll talk about something that operates the economy and the way humans transact and cooperate and fall in love and work together, then you'd like to be a little bit more formal and try to say something conclusive. If this entire universe is just cellular automata, then being conclusive is kind of hopeless, generally speaking. And the hope is, I guess, that there will be pockets of which of within the cellular automata where you could be predictive, where you can be. Where you can formally show that something is true, and then you can rely on that you'll be resilient and all those kinds of things, even though the rest of the thing is a giant mess that's unpredictable.
They call that Laplace's demon.
Yes, I wonder what the demon is up to these days. Okay, thank you for entertaining me with that. But sticking on philosophy, you. You've also mentioned, among others, that Bertrand Russell and Saul Kripke are two of your favorite philosophers. Maybe you can comment on what ideas of theirs you find insightful and also what to you is the difference? Because you're both an engineer and a thinker. So what to you is the difference between philosophy and computer science?
Yeah, so, yeah, there's both a deeply human element to both Russell and Saul. And then there's this, of course, amazing work that they did in the late 19th and 20th century. And you can't really talk about Russell or Salt without also mentioning Wittgenstein and Tarski, because when you actually look at these guys and you put them together, what they were attempting to do was increase the level of precision we had in analyzing both formal languages and also language in general. And so Wittgenstein makes no sense at all to me. So there's amazing people out there that somehow can parse that, but he doesn't.
Make sense to himself either.
I think you're right about that. However, Kripke has Krippkenstein. He has his whole building on that and he built a whole hierarchy. And at least there I have modal logic and I have the little boxes and I have the diamonds and I can do a computation and I can kind of reason about things that people are saying. But really it was all just about precision and the nature of truth, precision and the nature of necessity and possibility. And the magic of these statements is that you can then start getting a better understanding of basically how far formal language can take you. And so that's the work of it. David Hilbert also did the same thing. And Russell, he got his career started working with Alfred North Whitehead. He was a logician. And there was this whole desire in late 19th century Mathematics to formalize mathematics in a completely new and better way. And they started with geometry. And Hilbert's geometry was like a complete system, although recently we've discovered there's a few holes in that.
But.
But for the most part, it's complete and the axioms are independent and they're consistent. And they said, oh, well, now we can do this for all of mathematics. And Russell and Whitehead wrote this huge set of books, like two big books, Principia Mathematica, 1000 pages, and the conclusion is one plus one equals two. So they linked set theory and arithmetic and logic all in these beautiful ways. Then, little by little, as we entered the 20th century, logicians started chipping away at this idea that you could actually construct a complete system of mathematics, first with Godel, and then later with the work of Turing and Church and others. They said, oh, you're not complete. You're not decidable. And so suddenly, Russell was left in this really bad position where his early life's work was basically forgotten. So he had to kind of reinvent himself. And so he went into ethics and he went into different fields of philosophy, and he became this titan in analytic philosophy. And he was also a great pacifist, and he was just a phenomenal writer. If you read why I'm Not a Christian or any of his other attacks on metaphysics, he said, look, I can only deal with the world I'm in in the senses that I have, and if I can deduce it, I believe it. If it's outside of that, I really can't make meaningful statements about it. And he said it in a lovely English prose that you would expect of a man of his stature. Now, Saul Krikri, it was like the complete opposite. This guy's really down to earth, dude. Not aristocratic at all. And he was one of those guys that just could have done anything because he's so brilliant. I guess he's.
I think he's 80 something.
Yeah, exactly. Yeah. He's getting up there, man. But I mean, literally, when he was in high school, he wrote these papers in logic, and Harvard contacted him and said, hey, could you teach graduate courses at Harvard? And he said, no, I really would like to finish high school first before I go and teach grad school at Harvard. And so this is just one of those guys that you can see through his work that he can think deeply about anything. He's like the Galois of philosophy. And he chose to try to clean up a lot of the messes that Tarski and others couldn't resolve. He said, let's really get serious about the nature of truth. Let's really try to resolve paradoxes. Let's really try to build things in such a way that the work that we leave behind can actually be built upon and it's not thrown away every 50 years or 100 years. It was the same for Tarski. He comes in, he says, we mathematicians love this concept of truth, but yet we've never really created a nice rigorous definition that doesn't have Paradoxes embedded inside of it. So he had to invent meta languages and object languages, all these notions and so forth. So I really like those four if you think about them and there's a of great lessons and where it's relevant today is you have human beings and you have computers and they're trying to understand each other and computers live in the formal world and human beings live in the natural language world. And those bridges between those two are still not completely clear. And so a lot of the work that these guys were doing, the 20th century, 19th century, had nothing at all to do with that, but gives you hope that perhaps a bridge can exist between those two worlds. And maybe there are some nice tools that for that bridge to be built upon and maybe that in some way will allow computers to better understand us. I mean they've even created languages, natural spoken languages that are completely ambiguity free like Lojban and things like that.
What?
Yeah, right. L O J B A N Logeban is based on a language called Loglan and it's a spoken language that's equivalent to first order predicate calculus.
Oh, interesting. So no ambiguities, it's logically consistent.
Yeah, Loja bond.
But can you still have fun in it? You can get, can you write poetry or what?
There's people who actually write poetry in Lojaban.
I'm going to switch to that. I start tweeting in it.
Yeah, there you go. So there's a lot there and they're just fun to study and think about. And unfortunately if you go down that rabbit hole, you'll spend way, way too much time and there's diminishing returns. Now the second question you asked was one on theoretical computer science to I guess engineering philosophy. No, no, no, no.
So first step, you said humans and computers, right? So theoretical computer science is theory of the computer and philosophy is the theory of the human. And then we can dissect different stuff about the computer, but in terms of these two worlds, of the theory of the human, which is philosophy, and the theory of the computer, which is computer science, what do you think is the difference? Like as we try to bridge that gap, as you mentioned, what is going to be the biggest challenge? Like can we formalize love? Can we formalize music, art, poetry, all that kind of stuff? Or is that human nonsense that we need to get rid of?
No, I don't think it's human nonsense at all. I mean there's even attempts to create algorithmically generated music. And the question is love just strictly a chemical phenomena is There something metaphysical about it or transcendent of some sort of formal system. I mean, computer science is just saying, hey, we have this notion of computing, we have this brain that we've constructed, this formal system that we've built, and given that we have it, what can we do with it? And so some people worry about the roots of the tree of knowledge, the great Yggdrasil of computer science. They worry about the roots and say, how far can we grow them? And let's keep adding these new models of computation. And other people worry about the trunk of the tree, and some people worry about the leaves of the tree. And the. The more advanced the field gets, the closer and closer it gets to the people who constructed it. Us, we have better image processing, we have better ways of handling speech to text, and we have better ways of computers kind of understanding the intent of what a human being is saying. And then the question is, well, how will a computer understand love or poetry or music? Well, it'll understand it the same way we understand it. You have to get a computer to grow up to a point where it can learn the way we learn or as close to it as possible. Then you just expose it to the things that we were exposed with, and then at some point the computer will start creating things. So the question is, well, how do you quantify creativity? And I have no clue about that.
You make it into an NFT and see how much it excels for. That's one way. Yeah, but basically, yeah, there's so much of it is subjective. And that's a fascinating whole area that I'm fascinated with, this human robot interaction is how do we create compelling experiences that are subjectively compelling, whether it's art or just two humans talking or two humans interacting kind of way to maximize the richness of the subjective experience. And I think that could be an optimization problem that could be solved. We're solving it all the time.
Right.
Human civilization is constantly trying to. We're constantly trying to impress each other when we're younger, trying to get laid, whatever, fall in love, impress your boss at work by all the awesome stuff you do. I mean, we're trying to optimize that problem. That's purely, for the most part, is subjective.
Right. Did you ever watch Blade Runner 2049?
Yes.
Yeah. Did you remember the whole relationship between Joy and K, you know, and like, did she really love him, the hologram, or not? Was it like fake love or real love?
Fake it till you make it is my view on love. No comment from Charles. So let's let's go to the difference between theoretical computer science and software engineering, or I don't know if you draw a distinction, but if we look into this computer world now, is there a difference between theory, things you can say formally, and the pragmatic implementation of that theory into actual systems that people use, which I guess we'll call software engineering?
So the engineer, they're obsessed with the domain of well, what do you want to accomplish and who are you accomplishing it for? So they live in the world of people, if they're good engineers and they say, okay, what's the experience? How are we going to use this, why are we going to do this? What's the commercial application, what's the non commercial application? And you collect all these business requirements and once you've done all of that, the better job you do, the more self evident it is of how do we apply the toys and tools of computer science and other such things to actually resolve that? And the point of theoretical computer science from the software engineering domain is it can tell you kind of where your guardrails are. It won't make perfect programs, and there's no such thing as that, but rather it can give you a good notion and sense that your program has some desirable properties. Like maybe you can prove that it can terminate if you're dealing with total programs, or maybe you can prove you'll never have a buffer overflow or you won't divide by zero somewhere or something like that, some event won't occur that'll cause a catastrophic failure in your system. But there's always this combinatorial explosion between what you can test and think about and what you can actually code. So the stuff on the left hand side lives in a different cardinality, a different universe. There's something significantly larger there. And the tools on the right hand side we have property based testing and these sat solvers, we have all this great stuff here in formal methods land and computer science theory lan but there's only a small subset of things that they actually give you good answers about. So the balance of the two things is basically saying, well, what do you care about and what are you okay, throwing away? That's the art of engineering and building these types of things. So you know, cryptocurrencies, we deal with these complex distributed systems that have but then other things, you know what can fail. Is it okay if the block doesn't get made every now and then? Is it okay if your latency goes up or your network suddenly becomes asynchronous and you disconnect from it, and you have to restart the computer or something like that, that's probably okay. It's an inconvenience and burden to the user. And. And if you actually try to chase that tail, you'll end up spending 10 years chasing phantoms and ghosts. Meanwhile, the whole world moves on. So it's really figuring out those balance of the two. And what's really beautiful is that the formal methods tools have gotten so much better over the last 20 years, in particular, mostly because of incredibly high investments from Microsoft and Google and big universities, because these guys are building these gargantuan systems. If you look at the Googleplex or what Amazon has or others, and they have so much value, so many users, so many things going on, and no person can keep that in their head. And so you're talking about Systems may have 10 million lines of code, 15 million lines of code, millions of nodes connecting, faulty processes happening all the time, hackers breaking in on a regular basis. So when you're trying to model all that, trying to ask yourself, what formal guarantees and properties can I get to simplify this system as much as possible? So instead of the applications of formal methods slowing you down, in many cases, it actually massively reduces your debugging time and your ability to find where errors occur. In some cases, you can't find where errors occur inside these massive concurrent systems. And you say, well, where are cryptocurrencies going? We're talking about just the same thing, but we're talking about a much more hostile operating environment where instead of it running in a pristine data center in California somewhere, it's running on your cell phone, it's running on your mom's phone, it's running your dad's phone, it's running on some computer in Mongolia that may have good Internet on Tuesday, but not any other day. So when you live in that kind of environment, you really do need to think carefully about a whole new class of protocols. And then you need to think carefully about a whole new class of tools and techniques to test the reliability of those systems. And you need to separate the world and say, what is high assurance and cannot fail? Because if it fails, people lose money, and what is low assurance, and it's okay if that falls apart. The other thing I'll mention is there are perverse financial incentives in our industry, because the reality is when something blows up, the people who built those things that blow up usually get paid up front. So what they're focusing on is time to market, speed to market, and getting tokens out and getting them liquid. And then people come in, they buy it. But if there's a nisient bug in some defi protocol, it'll probably be discovered six months later or something like that. It blows up. Who suffers?
The users they already got. The people that created that already got paid.
Exactly. That's why you pay the guy who makes the break software for your train last and you make sure he rides the train every day.
So you're basically describing the complexity of a distributed system that's fundamentally game theoretic. And if we think about turtles all the way down, humans all the way down at the very bottom, it's still human nature. Is there something you can say formally about human nature to try? You said can't. There's certain parts of the system that can't fail. You know, some people talk about nuclear war in that same kind of way that there's this game theoretic construction of mutually assured destruction that rhymes. See, I'm a poet. That system can't fail because you're going to blow everyone up. But you can't formally say for sure it's not going to fail.
Right.
So like you're basically trying to chase, like statistically reduce the probability that these particular critical aspects will fail. And then you test, I guess, by deploying in the real world at small scale to see where things go wrong.
Yeah, it's a great question. And the problem with game theory and mechanism design is that you can develop this concept of a rational actor. And I don't think in my life I've ever met a rational actor. There's a rational actor on Tuesday, but any other day of the week, who the hell knows? And I think there was a book, Freakonomics, and there's a few of these things where it just shows again and again where people behave in ways that are against their best interest. So then you have these protocol designers and they say, well, we need an honest majority for this thing to work. They say, okay, well we'll create this incentive model and rational actors will behave with that incentive model. And they say, well, the individual won't do that, but the firm, the government, the entity will. The problem with that is we have a lot of counterexamples where the system was actually behaving in weird ways. We almost completely eradicated the human population twice in the 20th century, once during the Cuban missile crisis and again in the 1980s. There was a Russian colonel and they installed a new satellite system and it said, hey, the Americans are launching missiles at us. You need to Turn the key and launch all the missiles in the silo. And he said, oh, that's not right. That doesn't seem right. He was reprimanded for not launching the missiles. So in both cases, a single person stood against the systems of superpowers between us and nuclear annihilation. So in general, we're really bad at building these types of things. So what you look for instead is say, can the system be self correcting? It's not about avoiding a problem. It's more about can the problem be resolved. And that's how nature engineers things. It gives you an immune system, it gives you the ability to heal. If a rainforest has a fire or some catastrophic event, the ecosystem will find a way to patch things up. So it's a better question of how do you align the incentives over the long term of a system where all the actors within this system, when an event occurs that disrupts it, have an incentive to push it back into a healthy, productive, useful state, which is going back kind of to that complexity theory stuff that we began with. And a little bit about how do you handle modern economics. For example, we knew this coming into the COVID crisis, that there would be catastrophic economic disruption throughout the entire world. In the developed world, it was print, lots of money and hope to God it works. In the developing world is try not to starve to death. Over 100 million people were pushed into acute starvation, so acute hunger. It's a terrible situation, but every economist knew we were going into that. So the question is, how do you restart the system? How do you realign the system and so forth and make sure that it doesn't collapse at some point? So it's an imperfect inexact science. And that's actually one of the things that makes our industry so much fun, is that these are kind of like micro experiments for the macro. In years past, you never got a chance to experiment with monetary policy. I mean, it's like every 20 years, 30 years, they'd have some conference, usually in a cool island like Jamaica, and be like, okay, let's go talk about monetary policy and amend the Bretton woods agreement. And these would be nation states, invitation only. And now you have over 8,000 cryptocurrencies floating around, all with their own monetary policy and their rules. And it's very Darwinian. A lot are dying, some are succeeding. Anomalies happen like dogecoin. And you say, God, is this temporary? Is this permanent? Why doesn't this horrible thing die? And then other things you think would be absolutely successful and just Take off and be in the top 10, don't really get as much traction. Like Algorand is a great example of that. I mean, Silvio, he's an incredibly bright guy. Every time I go to mit, we have dinner and his work is legendary and it's just beautiful and elegant and he literally has all the people he went and hired Tal Rabin and she got at IBM Research and Craig Genfrey, the guy did homomorphic encryption under damn Bonet is there. There's all these amazing people on that team and they have money and the VCs, so you'd say, okay, that's a contender. But if you look at market adoption, Ethereum Classic sometimes is above it and other things are above it.
And then there's this weird Darwinian evolution produced dogecoin organism that's just like stomping all around. Evolution doesn't make sense.
Exactly. But maybe we're the problem, not evolution, because the market's the market and you can scream and cry and pout and stamp your foot and say this makes no sense, but that's the way the world works. There's plenty of mountain climbers that didn't want gravity to apply to them. And it's the same situation here. There's plenty of people in these marketplaces that had the best of intentions, the best team, the best technology, and for whatever reason, they didn't get that adoption. So the question isn't the local, it should be the long term. And will the system over time converge to a state that actually is useful and meaningful to society and actually solve problems for it? And that's what we try to figure out, is how do we perturb these things in a way to kind of push them in that direction.
So before we go into this fascinating Darwinian evolution of cryptocurrencies, let me ask you sort of a basic programming question. There's a fascinating aspect to your work with Cardano that use Haskell to build the infrastructure. But even stepping back more looking at this landscape, another place where Darwinian evolution operates, looking at this landscape of programming languages, you as an engineer, you as a philosopher, both what programming languages do you think are interesting? And more practically, what programming languages if you were to advise students today, should they learn?
Yeah, so there's the pedagogy of learning how to program and to express the theory of computer science. Like you have to learn how to write algorithms, you have to learn what data structures are, you have to be able to do analysis of these things. And that probably, I think the debate is over Python is probably the best language or JavaScript to get started with because they're very useful. The libraries are amazing. There's just tons of online materials. Even MIT is now teaching their introduction to computer science and Python. And they used to do Lisp. I mean, these guys were hardcore.
I still love Lisp.
Oh, man, it's great. These are your father's parentheses. They're elegant weapons from a time long ago. But that's a great starting point. And it's not about falling in love with a language, it's just falling in love with computing. It's about falling in love with having a dialogue with a computer and thinking about, well, how would I solve that? How would I interact with that? What does this need to look like? Functional programming is what we've chosen to use for Cardano, mostly because we're living in the academic world. We've written 105 papers, and the problem is you have to translate that work into code. And the gap between an imperative language like a C or C and these academic, rigorous papers is extremely large. And so there's going to be a lot of semantical ambiguity between those two. And what I mean by that is that you might end up implementing a wrong thing. You might think that what you've built is the paper, but the computer's not going to tell you that because the paper is written in prose and maybe typed up in latex or something, but there's no proof chain, evidence chain that you can show that there's no ambiguity. When you look at a functional language, you're a little closer to math. And so as a consequence, the translation of the papers that we spent so damn long writing and writing proofs about and so forth to code is much smaller. Now, the downside is these functional languages tend to be a bit more academic and they tend to have not necessarily the best Windows support, and the libraries aren't so good. And also they tend to be a little slower when compared to as a whole, on average, to languages like C, for example. So it's really a question of, okay, what are you designing for for version 1? Are you designing for performance and are you designing for developer accessibility? Are you designing for correctness, and are you designing for a high fidelity representation of the protocol? Okay, so Haskell was chosen as kind of the version one because we knew that the kinds of people who think about that are also the kinds of people that would have an EAS reading a paper like Ouroboros and working their way through all of this, and they would do a pretty good job writing a formal specification and then translating that into running code. Then once you have that, you have a blueprint that you can actually reason about, maintain. And if you really wanted to, you could then turn that into a Rust code base or into a Java code base. Going the other way around would be kind of pointless and counterproductive. The other side of it is that Haskell code or functional code tends to be significantly more concise. And I actually have a real life example of that. So if you take a look at Mantis, we implemented a full Ethereum node in Scala. It's only about 14 or 15,000 lines of code. And you compare that with like C bitcoin, I think that's 120, 150,000 lines of code. So it's almost 10 times smaller. And so less code, less to read. And you tend to read code significantly more than you would write code. So it's always an advantage for maintenance, understandability, documentation and other sort of things when you have more concise code bases. And also it's a lot easier for you to apply stronger tools to a functional code base like static analysis or property based testing or these types of things than an imperative code base. But you know, the thing is, it's almost like a religion or language. It's like saying French versus Russian versus English. Everybody has their adherence. They say, oh, they have the best poetry here. Russian, yeah, there you go, Always Russian. Everybody has their favorite tools and their favorite languages. But it just comes down to what problems are you trying to solve and what problem domain do you live in? If you're inventing new protocols based on science, you're going to take the time to write a paper, go through the peer review process as you've done personally. You know how hard it can be to get into a conference and go through that and get your ass kicked. Then you also have to apply the exact same level of care to the engineering side in terms of implementation of that, or else you will make a mistake, and that mistake will probably be an exploit in the system that destroys the security properties of the system. So we really had no choice but to go to some notion of functional. The question was, what's the Goldilocks language? Do you use a hybrid language like Scala and F or Clojure, where you still have some connection to understandable things like NET or the jvm, or do you go to an overly academic language like Idris or AGDA or Isabel, and there you can really dial up the correctness and write all kinds of crazy proofs. But by the way, it's like the seven people who write your code, they go on vacation a lot. You'll never get anything done. So Haskell kind of felt like a nice middle ground between those two, where if we needed to pull in to the left, we could. If you wanted to pull into the right, you could as well. That said, it's really amazing to see what the hybrid languages have done. If I was a new student in computer science and I said, learn any language to grow your career from, Scala 3 is probably the language to go with.
Interesting.
Yeah, it's great because it's like you want it to be like Java. It's Java and it looks kind of like a Java program. You want it to be like Python and script it and you use a repl. You can do that. You want to go hardcore dot dependent object types and do like weird proofs and stuff in the functional. You do all that, you have access to all of these things. And Martin Adersky is a brilliant guy. He's done some phenomenal work, basically because he was one of the guys who created JVM and he's worked on compilers for over 20 years. He did a lot of really hardcore work in trying to build a concise, nice, modern language that does a little bit of everything. And it's got great applications in data science and in AI. It's also heavily used in modern companies like Netflix uses Scala for all of their microservice architecture. Yeah, so that's a great language and it's easy to pick up and it's easy to hire people into it. You just find these Eastern European guys who are java programmers for 10 years, 15 years, and they got tired of making $20 an hour, so they picked up Scala. So they can make $35 an hour and they're really good at it. And that's a great gateway drug because you have quick check and Haskell, you have Scala check and Scala. You know, you can also do model checking. You can also go and use a TLA spec and make it work with Scala and so forth. So it gets you a little bit of everything and you know you can then move around that entire design space in a beautiful way.
So the recommendation is maybe if you want to go vanilla, you Go Python and JavaScript.
When you're getting started, getting started, that'll get you everything. And then web scrapers and anything.
It's like all of us experiment with drugs in undergrad. That's where Scala 3 comes in. It's a gateway drug to then potentially More hardcore functional languages like Haskell. Do you think C and C? C still has a role?
No, I think Rust has completely placed a need for them. Go and Rust, those are the two twins of Doom. I mean, Google created Go just to get rid of C. They hated C that much. And then Rust is just a phenomenal language as well.
C can be a great motivator. Let me ask a question from Reddit on this topic. We'll go in depth first today.
Sure.
As a developer, why should I be incentivized to create Cardano based applications? What is on the Cardano developer? Any other language? I guess this is the key question I want to ask Any other language support other than Haskell. The example this person gives us Typescript, Go, Java, Python, et cetera. Also, have you considered a yearly conference focused around developers?
Yeah, we call it Plutus Fest and we did the first one in 2018, 2019, I can't remember. And we were going to do one last year, but then Covid hit, so we'll bring it back and we'll probably do it annually at the University of Wyoming for their hackathon there. In fact, it just so happens that with the gogun Summit, so we're doing that I think the third week of September. But yeah, it's great to do an annual conference. You can bring a lot of cool people together and you can do hackathons and awards and so forth. But to the question in particular, Plutus is like any other language, Plutus Core, you can compile things into it. So it's entirely possible to write a Scala to Plutus Core compiler or a Typescript compiler or something like that. But I'm a big believer of separation of concerns. And we don't live in a single chain model anymore. So you have a situation where you probably want to have different execution environments and different chains, so you have different virtual machines there. And that's why we work so closely with University of Illinois Urbana Champagne, Gregory Rochi's team at Runtime Verification. What they did is they said let's start with something very familiar, llvm, which has been around for a really long time and they happen to have created it there with Apple. And let's take that and translate that into the blockchain space. Okay. Then once you have it, then it's very easy to modify compilers of standard languages like the Cs and Cs and other such things that do compile to LLVM already and have them run there. So that's a different execution model than what we tried to build for Plutus, which focuses on correctness. Okay? So then all you have to really do is say, can both of these models coexist within the same ecosystem? Because then you kind of. And I did a video, it was called like the island, the Ocean, the Pond. And the basic idea was say you have an island where everything's perfect, Calypso lives there, life is great, people feed you grapes every day. But maybe you can't do everything on the island. The ocean's big, it has everything. But the ocean's got sea monsters and sharks and Boaty McBoatface and all kinds of crazy stuff, right? So that's what Yela is about. It's basically this bring LLVM into our world and at some point in the next three to five year time horizon we can bring modern programming languages in, but they're going to come in with all their flaws and their warts and their problems. And then the Pond was the idea of the Ethereum virtual machine. There's some network effect around it and there's some great tooling that's materialized and evolved. And it's not clear if that's the standard yet, or if like MySpace or BlackBerry or all these other things, it'll fade away. Well, if it becomes the standard, okay, don't fight nature, just support it. And the same thing that gives you the ability to bolt on the LLVM will also give you the ability to bolt on the evm. And they can run with their own models and they're encapsulated, bulkheaded, separated systems. But you can move ADA applications, information between those two systems. And so your main chain will always stay somewhat conservative and have the minimum viable amount of expressiveness required on it to do all kinds of interesting things and also for interoperability, be able to talk to all kinds of interesting things. But it's not trying to be everything to everyone. There's never going to be an ice cream store in the Island. You'll have the grapes and the beautiful women, but no ice cream.
Now you're just distracting me with the ice cream because we'll throw around a bunch of terms. For the record, what is Plutus?
So Plutus is a programming language. It's kind of a DSL that we built on top of Haskell. And basically we wrote it after spending about three years thinking about all smart contracts. We were trying to figure out, like, what is the ideal language to express a smart contract? And then we started saying, well, what is a smart contract? Is it the whole application or is it just like a sub module within an application and usually it's the latter more than the former. You can build a self contained program like a script, but usually what's happening is you'll have it like a video game, let's say World of Warcraft or something like that. You say, hey, maybe I want to actually create gold in World of Warcraft. That's actually a currency. Okay, so I'm going to issue a token. Well and then maybe I want to create some mechanics behind how people are going to trade that amongst each other. So that would be like a smart contract layer and issue an asset. So you have this centralized server running and proprietary software controlled by a single company. But then you've opened your application up to a broader world and we've done now is added a blockchain layer and the blockchain handles the accounting of that asset and the spending policy of that asset stuff. So that is a much smaller program than what Blizzard is doing with World of Warcraft. So the point of Plutus was let's create a language where you can write these small to mid sized programs and have a high degree of confidence that they behave with correctness and also they give you deterministic results on the consumption of resources. You can run things locally and you actually understand what it costs to run. And that doesn't change when you deploy it on the system. If you dial up the expressiveness of the system like Ethereum does and these big mutable account systems, the problem is you have to have global state, so whatever you test locally doesn't actually necessarily translate to what you've deployed. So we spent a long time asking where's the Goldilocks zone? Bitcoin script was too restrictive and every single time Satoshi tried to dial it up, it led to mega problems. There was a beautiful thing called the value overflow incident in 2010 which led to the creation of billions of Bitcoin. They had to quickly clean that up and sweep it under the rug and pretend like it didn't exist. But that was mostly because of an issue with how the scripting language was implemented. When you look at Ethereum, it's like this Pyrrhic game of stomping down these skirmishers where every update there's something they have to change or tune and then it's not clear how you shard such a model. So we said let's build something that's in the middle of this. And that's what Plutus basically is. And it's really designed to play very nicely with off CH infrastructure as much as on chain infrastructure. So you can look at all those different examples. Whether it's Wolfram wants to auction off their universes or Blizzard wants to issue an in game currency, or you're Uber and you want to start putting peer to peer dynamics inside your system, you're going to gracefully connect to that on chain code. And it's very clear how those two things connect together. Just so happens, Haskell's really good for this. They have template Haskell and it makes it very easy to embed domain specific languages and it makes it very easy to wire your Haskell code onto off chain infrastructure. So in the future you'll be able to have your off chain run a node or the Java virtual machine or a. NET application and there'll just be this beautiful interface and then it can talk to all your on chain code and that's written in that DSL and you have a high degree of assurance that it's right.
Is there like a hello world program in Plutus that reveals the beauty of the this balance that you're referring to? Sort of simple, but not too simple. The Einstein idea.
Yeah, so we did do our first hello world program actually today because we.
Yeah, I heard about this.
Yeah. But you know, there you'd want to have the whole round trip, so you'd like to have an interaction and I think a video game would probably show it the best. Like if we could re implement cryptokitties or something like that on it. And you have this off chain infrastructure and you have your GUI and your front end, it's running on your phone or a browser and most of that lives off chain. But your cryptokitties, they live on the blockchain the whole round trip end to end with relatively low fees and low latency and high availability of service. It never goes down. That would probably be the best thing to do and we'll have something like that by August. It's pretty easy to build this stuff.
So what kind of off chain interactions are supported with Plutus? What are the limits you want to put on the thing so it doesn't get chaos?
Well, that's the beautiful thing. When you have a less expressive model on chain, it means you can do anything you want off chain, anything.
So you started talking about smart contracts. But let's zoom back out and ask the big question. Here is what is a blockchain and what is a cryptocurrency?
So a blockchain is just a ledger and really it has three nice properties. You're Timestamped, your immutable and auditable, either in a global or local sense. And so there's all kinds of things mankind has invented where it's really important that when you put some information down, it doesn't change and other people can see it and that, you know, when it was put down, for example, a property ledger, so when you buy land or you have rights associated with land, like mineral rights or water rights or these things you'd like to transitively see, how does it go from Alice to Bob to Charlie to Jim and so forth? And what was the state of these things as they were transitioning? So how much did they pay, when did it occur, et cetera, et cetera, the metadata that follows that. Okay, well, normally these types of ledgers are so important that they're managed either by governments or regulated entities. And the issues are that while they can be efficient, they're generally brittle to political manipulation and they're brittle to geopolitical events. For example, when Syria fell apart, the very first thing ISIS did is they started saying, hey, the ownership of the land, it's going to fundamentally change. We've decided that this guy over here now owns all these things. And then when peace comes, how do you unwind all of that, put it all back together? So the power of a blockchain is that it gives you a transnational way of sorting all these details out, putting all together in a place that you know that even if it's inconvenient to a very powerful actor, that it will still stay preserved. This is an asymmetry we haven't had as a society. Usually kings and empires, they have the ability to decide what's true, and then suddenly you have this asymmetrical thing that is above them, kind of like a synthetic laws of physics. And once something goes in there, you know that that's there. Okay, so that's the first part of it. The second part of it is that it's auditable, meaning that instead of saying only the high cleric or the president or some very special club of people get to see what's going on, suddenly now all the people can actually see who owns what where. Like, imagine a tax system where the ProPublica just leaked the taxes of all these different billionaires and said, well, how much do they make and how much do they pay? Imagine a tax system where that's just done by default. Or other social systems where this type of information is put in by default. So it's tremendously useful, this type of structure and all kinds of things Medical records, supply chains. Just a good thought experiment. I travel a lot. I've been to 52 countries in the last five years. Imagine if I got sick in Zimbabwe, I got hit by a car or something and I'm unconscious. And a Zimbabwean doctor calls my doctor in Colorado and says, hey, I need all of Charles medical records. He's unconscious right now, but I need it to treat him because he's quite ill. They'd say, who is this person in Zimbabwe? I don't know you. I can't give you his records. I need his consent. Oh, no, he's unconscious in the hospital. Can't do it. Well, a broker system that would allow the movement of medical records would be an example of what a blockchain could potentially do in the foreseeable future. Cryptocurrency is just an application that runs on top of blockchain because it turns out that when you issue property, you also can issue tokens of value. And then you can have a monetary policy. It could be inflationary or deflationary. You can have demurrage where it decays over time or whatever have you. And the very same mechanics that would ensure your property records are secure, your medical record access is secure, could also be applied for the ownership of the cryptocurrency. Again, you can either be completely transparent and everybody can see what everybody owns, and that's what Bitcoin does, or you can be as opaque as you seek to be. That's what zcash basically attempts to do. It says, hey, let's keep these things as private as possible. But they have relatively the same mechanics in terms of those properties of auditability and timestamping and immutability. You know things won't be reversed. You know that people aren't going to manipulate the timestamps, and you can audit at least enough to know that the ownership is right.
But the way, if you think about physics and the universe, the universe has figured out a way to update the ledger of physics in a way where, like, a lot of people can be updating it and it stays consistent. Is there something you can say about the task of updating the ledger when a bunch of people are trying to do it or a bunch of entities are trying to do it?
Well, that's the whole point of a consensus algorithm. So whatever ledger you're running, there has to be some mechanism to decide who's in charge. And that's what proof of work does and proof of stake does, and all these other systems, and you break them down basically three steps. And so we'll use EVE for kind of step number one. Hi, Eve, how you doing? And we're going to use Wall E for step number two. And I need the monkey. Give me the monkey. What's the monkey's name?
Daisy.
Daisy the monkey. Okay, I like Daisy. Daisy is a very confused monkey.
It's pondering its own mortality.
Just right. And so anyway, the first step is all about basically deciding who's in charge for that moment. So blockchain is just a sequence of events. The heart has to beat, the metronome has to click. So somebody has to be in charge. And so generally, you have this notion of a resource. So there's some pool of resource out there, and it can be a token, and in that case, it's a plutocratic system. And that's what proof of stake does. Or it can be computation, but there can be other resources, but computation is what proof of work does. And so you make so many hashes, and then. And eventually somebody wins. And that person who wins is now the person who basically gets to decide the order of transactions and put them all together from their perspective in the system. Then once that person wins, they'll make the block. That's step two. And after it's made, transmit it, and it gets validated and accepted. So actually, it's quite fortuitous you have the magnifying glass, because at this stage, people are trying to decide, is what I'm looking at correct or not. Now, there are other ways to potentially conceive of this, but this particular model gives you kind of a way of thinking of all consensus algorithms in one setting. You can be Algorand, you can be a classic BFT protocol. You can be Paxos, you can be Raft, you can be proof of work, you can be proof of stake. It's always the same idea. You have to find someone or some group to be in charge. They'll reach a consensus on order. They have to then do some work, change the state of the system, update it, and then the network has to accept that that's valid. So even if this process works well, this side will say, oh, you created a bitcoin at a thin air. You're not allowed to do that. So that's rejected. Okay, so there's checks and balances and guards all the way through. There's a meta question of fairness in all of this. So the proof of work people, they're kind of a cult, and they say that this is the only truth and everything out here, any other resource is not legitimate or valid. And there's not a lot of evidence to that, but that's what they believe. The proof of stake people, the downside and weakness they have is it's a plutocratic model. The more ownership of the system you have, the more control you have over that system. And it suffers from the same thing the shareholder models suffer from. Whereas you may maximize short term gain over the long term viability of the system. So a really cool question is, can you build systems that are multi resource? So instead of just pulling from one resource to select who wins this 25% of the time, and maybe this 25%, you can do that. In fact, the cryptocurrency space did that a long time ago. There was a cryptocurrency called Peercoin in 2011 and it was a hybrid. Proof of work, proof of stake. So some of the blocks were made with the token ownership distribution and some of the blocks were made with proof of work. But you could keep adding. You could put in like, hey, I want hard disk in my thing, you can put permacoin in or something like that to create an incentive for hard drives. And then you could say, oh no, I want to do like a human system, like a proof of merit. Oh my God, now we're up to four. And you just keep adding and each of these pools will have different adherents and actors, and then you can actually balance out the whole thing.
So as opposed to having one cult, you have many cults.
Exactly. And they argue, and the cults argue with each other. And we call that a government.
By the way, not all cults are bad. Physics is a cult too.
And it's sometimes bad.
It's honest, at least. Nature is a cult. Yes, nature is metal. Check out the Instagram.
So that's really the crux of it. You have a ledger, and the ledger is just all about saying, hey, we need to put some stuff in here. And once it's put in here, you can't turn it back. And you know when it was put in and everybody can see it or some group can see it, and then you need to pick somebody to modify that so all this chaos will happen. All these transactions are all around the world and our perception of them are different. There's a beautiful paper from Lamport that kind of talks about this from the 70s. It's like one of the most classic papers ever in computer science. I think it's been cited like 50,000 times or something like that. It's a crazy paper, but basically you have to figure out, okay, well, somebody has to be in charge, some group has to be in charge. You can do it with a meritocratic hashocratic computation thing. You can say, well, if you have coins 25% of supply 25% of the time on average, you'll be selected to have the right to do this or give it to somebody else. Or you could search for other resources and they can even be human resources, like some notion of merit or social benefit. Maybe you get a token for that and you can weight it with these other systems. And that's where kind of where everything's going. We're getting to a point where we've really optimized all the properties here. We've proven all these nice things about it. And there's a lot of competition to basically build the perfect proof of stake system, whether you're Polkadot or Algorand or any of these other guys. But now the next step is say, well, why don't we just have one? We should have multiple resources. And the point is each of these has different trade off profiles and so they balance each other and you end up building a much more resilient system. So it's not winner take all with one particular demand.
Okay, so there's a million questions that spring up right there. But first linger on this topic and say, what is proof of work? What is proof of stake? Just zooming in on each of those and what are the differences?
Okay, so they all have the same three properties of pick someone in charge, do something and validate it. The difference is that the picking mechanism for proof of work is you have to solve a puzzle. So it's basically like buying lottery tickets. And you can buy a certain amount every second with your computing devices. And some of them are ASIC resistant, so you run them on like a laptop or a gpu. And some of them are specialized hardware that you have to either manufacture or buy from someone who sells it to you. And that's just how many tickets per second you can get. And eventually you hit those magic numbers. And when you do, it means you have the right to make the block. And generally you bundle the block making with the proof of work system. Now you can do this looking for a single, or you can do this to actually shard it and look for multiple blockmakers at the same time. So there are sharded proof of work protocols like Prism is an example of that. And actually Ethereum got started this way with Spectre and Ghost and Phantom, Avi Zohar's work and Yonatan Sun Lipinski. But the Basic idea is you pick some collection of people, they make some collection of things, and there's some way to sort it all out, serialize it, and prevent double spends. Great proof of stake is the same, but it's a synthetic resource. So instead of doing things, they say, well, if you had 25% of the hash power on average over a long period of time, you'd probably win 25%. Well, why don't we just introduce some randomness in from some Source and then 25% of the time on average, over a long period of time, you'll win. So it's a synthetic resource, but you still have to do the other two things. You still have to make the block and you still have to validate the block. The big difference is this step in the proof of work world is horrendously expensive. You use more energy than the nation of Switzerland. And the problem with that is that you have less resources for the other two. And the other problem with that is that if this is horrendously expensive, you have an economy of scale kick in. So what ends up happening is the system becomes less decentralized over time because you have these vertically integrated operations. I mean, not everybody can go build a mining facility on a volcano in El Salvador, not everybody can go to Mongolia and set up a 5 gigawatt power plant and a huge data thing. Not everybody has access to the patented ASICS that people produce. Because what if I don't sell it to you and I have the patent on it? Or what if I control the supply chain for these things? So you'll end up having centralization around maybe 10 or 5 major operations, as we've seen historically, with proof of work. And that means you end up having a ruling class of a mining oligarchy in the system. Proof of stake. If you design the parameters correctly, you actually get more decentralized over time because as the currency goes up in value, the distribution of the currency tends to get but more egalitarian. For example, Bill Gates, when he started Microsoft, he had 64% of the shares. Now he has less than 5% of the shares. So this founder drift over time, as the value goes up, divestment occurs. You have more and more and more people coming in. That means there's more people who can participate in the consensus. You can even tune economic parameters. And this is what we did with Cardano and Ouroboros. We created this concept of K in the system and it's just a parameter and it's like a forcing factor that tends to accumulate a certain amount of stake pools, so you can set it to 200 and then 500 and 1000 and so forth. But the basic idea is, as the price of ADA goes up, you make K larger, and then you end up, in practical terms, having a larger and larger set of actors making blocks that are unique and distinct. And the other good thing is this is a virtual resource instead of a physical resource, which means it's portable by a click of a button. So let's say China says mining is bad. We're going to shut it all down. It looks like they're moving in that direction. You have all these people in WeChat just trying to sell miners, or trying to figure out how the hell do I move miners? Because they have these huge data centers they've constructed. You can't exactly go and grab a server and take it with you. It's huge, it's a lot of work. And if the government seizes it, well, it's their property. Now, a virtual resource, you can click a button and redeploy it to a different jurisdiction. So to me, for a virtual app.










