ZKPodcast: Statistical modeling of PoS systems with Tarun Chitra

5 May 2019 · 59:14

Tarun Chitra discusses statistical modeling of proof-of-stake systems on the Zero Knowledge podcast, drawing on his earlier work building non-blockchain ASICs and financial models for high-frequency trading. The conversation covers how those techniques translate into modeling blockchain consensus and security.

Speakers

Topics

Transcript

[Music] welcome to zero knowledge a podcast where we explore the latest in blockchain technology and the decentralized web the show is hosted by me Anna and me Fredrik in this episode we sit down with Tyrone to chat about his work on Asics to modeling high-frequency trading and the nuances of statistical modeling for proof of work systems block chips thank you to this week's sponsor trail of bits

here's a little story this fall at the world's most competitive undergraduate security competition students faced a test they needed to enter a giant can of Lacroix modeled in Second Life to break the post quantum cryptography defending an enchanted typewriter trail of bits JP Smith was the architect behind this bizarre challenge and his write-up is on the trail of bits blog right now check it out at blog Trey lab it's calm we're gonna add the link in the show notes and now here's our conversation with Tarun so we're sitting here

it's Frederik Tarun and I hi guys hello hey Tyrone do you want to start off by introducing yourself yeah sure I'm Tarun Chitra I live in New York and I am the founder of gauntlet networks which is a company that is aiming to bring simulation tools from a lot of different other fields to the blockchain space basically I've spent a lot of time being on the sidelines in this space since 2011 and then sort of at some point realized that there were just things

that I liked doing that also mapped a thing that I felt like we're needed in this space so simulation tools it's actually a thing that's been I've seen popping up a little bit and it almost feels like you save a lot of people coming to this space that have a different background than the founders of the crypto era where it's now more like series engineers who have built things like no existing tools and frameworks and they come in and sort of bring bring that whole thing in I know a couple of companies who are working on simulation both like network simulation but also like game theory simulation things like

that what specifically are you trying to build yes so we have basically a combination of network simulation and game theoretic simulation so the design of our code and and system was is kind of based on the experiences that I had in computational physics and also in high-frequency trading if you want to properly simulate the game theory as well as the networking behavior of a blockchain system you you have to combine sort of figuring out how to quantify interactions between different agents that have some type of utility

reward potential some type of measurement of of how progress they're making locally as well as understanding how actions they they take propagate through the system and how you can correctly model that type of propagation and those interactions and the impact of those interactions as it flows through the system so a sort of simple example is the quintessential selfish mining example so in selfish mining what happens is a miner will withhold blocks and if they have enough hash power then they keep a private chain that they publish to the rest of the network when that whenever someone else publishes a block and then their private chain beats the other chain because in expectation

they have some advantage of say an extra block or 0.5 blocks now an interesting kind of little wrinkle to this is after the original paper came out on selfish mining people did a number of more detailed analyses that showed that the actual network latency is that you incur in an actual blockchain system can dramatically change the efficacy of selfish mining so figuring out how to both measure the reward of hey I'm mining a private chain as well as the cost of hey I have a lot of uncertainty from both the network and also potentially what measurements I'm making of what everyone else is doing

and figure out how to balance those two is a unique challenge to block chains that kind of combines a lot of different types of existing simulation but it's definitely a novel challenge which is why I was drawn to it and and one that one of the more interesting things is a lot of the academic papers especially of the more recent high-throughput protocols have really focused on a lot of probabilistic arguments that require a lot of assumptions and in practice those assumptions are potentially never true for things like Avalanche and Al Gore and and so the only way to really know that the choices you make of parameters or architectures is kind of

to try to come up with models for for the network as well as the types of rational and irrational behaviors that you can think of like you may not be able to think of every possible class of user but your goal is to try to construct as many as possible and have them play as many games as possible this is something that we really want to dig into in this episode but I think before we do that I think would be really cool for you to tell us a little bit more about your background you just mentioned that you had been in physics and in finance can you tell me a little bit more about what you were doing there and maybe what you've learned there that you've brought into this so when I graduated college I basically was I said I studied math and like more or less

electrical engineering it's kind of a degree called applied physics which is ends up closer to electrical engineering than physics and I was gonna go do a PhD in string theory and basically I got this weird job at this billionaire funded private Research Institute called D Shari search in New York and you know 21 year old me was like why wouldn't you want to live in New York who I go with him like some Californian suburb for four yeah immediately so I ended up working there for five years and that dissuaded me from going to grad school I started working on sort of a more

theoretical physics project we were building Asics kind of to do these large-scale simulations of proteins and generic sort of condensed matter physics so I worked on running really long simulations of glass forming materials which a very slight aside your childhood has probably been filled with lives where everyone told you that there are three or four phases of nature but in reality there's at least thirty if there's probably eight in the room here and there are tons of phases of nature that exists you know in your screen right now is liquid crystal glass is something that's neither a solid nor liquid so anyway no one knows why

glasses glasses particularly weird any liquid can become a glass so that's why people want to study it so I first worked on that and then I started doing more CS and sort of more like high-performance computing kind of low latency stuff touching touching our Asics we had like weird custom compiler and all this other stuff and we did some machine learning on our hardware also so I really did a lot of things that like I feel like I would have done in grad school somehow but I ended up doing at this place and is awesome and then a lot of people from that place ended up moving to high-frequency trading so in in in high-frequency trading people

build this kind of weird high-performance computing architecture to do billions of simulations every day of like how you think the rest of the market is behaving and how your trader behaves and you kind of do these game theoretic simulations although you don't do many that many agents you really try to focus on optimizing your agent relative to historical data but it's kind of an interesting challenge where it mixes things like alphago where you're kind of like learning to play this game with something that has a lot of statistical uncertainty like markets so I went and did that and I learned a lot I don't know if I would go back to that industry but I definitely learned I learned a lot I learned a lot about engineering I

learned a lot about finance I guess you learned a lot about modeling or had you already learned that in the previous thing the previous thing taught me a lot about like modeling interactions between things and then the finance thing taught me a lot about how you model rationality and irrationality and accommodate for your rationality in in the previous episode with axel to invest there was a bit of questioning around the notion of like should we only be modeling rational agents versus having some models for rational agents in finance you you you try to model or at least in high frequency you try to model yourself as as rational as possible and then try to model the rest of the network as as irrational as possible and try to optimize your

rational strategy conditional on treating everyone else's irrational but in reality you kind of have to have like this mix of strategies I think it's there's definitely some sort of impossibility theorems to whether you can like ever perfectly optimize these types of of games where you assume arbitrary strategies so if you really want to measure game theoretic rewards in kind of the Byzantine fault tolerant land there is a whole complexity class called ppad which gives you a ton of problems decision problems that are potentially worse than NP that you have to solve if you wanted to kind of mix like modeling economic rationality with the FT style behavior so what you learn

from that is that you have to do statistical methods because you're never going to solve these things exactly so yeah so anyway so that's how I but how I got into blockchain is actually a weird and Bitcoin really is a weird story so in 2011 when I was working at de Chartres research basically so we were building Asics and there were very few people building a six in 2011 pretty much the only other ASIC builders were networking companies so for instance at your telecom company or your cable company they have these huge custom hardware pieces to do F of T's the fast Fourier transforms and that that type of

stuff has forever been like unique as put the population grows you need to like optimize that more but other than that and like academic projects there weren't many Asics like most people were a twenty until this is actually just as a side this is super interesting to hear about Asics not in the context of luck chain because that is something that I've often heard about them and I think a lot of our audience probably has too so that's really kind of neat that you were working on these early Asics for very different purposes than the way that we think about them today the the story I'm gonna tell wouldn't be very weird right now but it was weird in 2011 and the reason it wouldn't be weird now is now there's a lot of competition for Asics base between self-driving car

companies so for lidar so when I say self-driving car company ad I'm including big car manufacturers also but anyone who's in that ecosystem as well as machine learning processors competing with like the Google's TPU everyone now has an ASIC in their iPhone that does face scanning thing to unlock your phone exactly but Apple has like weird foundry relationships so they're they like they have special access I'm sure to like weird TSMC things before they launch but yeah but yeah there's there's a ton of even small companies have have access to this but the the interesting thing about the ASIC world is if you have an order that's not super large and you want to go to the like most kind of the smallest

feature size like the smallest physical size per transistor you oftentimes can't get one of the big manufacturers tsmc or Samsung to listen to you unless you have an order of like around a billion dollars and so so what you have to do is you basically go through this like supply chain where there are these aggregators who a grenade a bunch of orders and then make that make it a single order on the single wafer and then send it to TSMC or Samsung or something so that was how we made chips so we we made like this one year one hundred million dollars of chips or like Louis like a little less than that but so it wasn't big enough to merit us TSMC even saying hi to us so basically we

have to go through these suppliers and what happened in 2011 was there was we had this supplier that kind of started ghosting us and and didn't you know we had a big order out with them of like over ten million dollars they just kind of ghost at us and then three months later like oh well give you like a 10% discount sorry for the delay and real like what what a really that's that come on you got to tell us what happened and that was one of the first ASIC mining companies that eventually kind of got destroyed by bitman or acquired by bit means wait the company the supplier was the ace errors they couldn't deliver because there was some minor that had bought all of them yes so some minor must have paid more than what we paid

and they like just removed us and oh wow okay okay so it's kind of like they would they front around us they like say let's say we paid X million dollars they were like we'll pay you to X million dollars to our supplier if you do it you know yeah put us ahead which is kind of just crate in 2011 that's crazy right now that's kind of par for the course yeah like ever everyone you talk to in hardware seems to say it similar things but basically what you're saying is that was the first time like you're working at this a6 company because of some supplier [ __ ] kind of that you were made aware that this is this that this was happening yeah there was Bitcoin was very miners trying to grab as many Asics as possible and I guess before that

point like what did you know about Bitcoin I mean I'd seen the paper but I just hadn't I hadn't really followed the forums I hadn't really looked at limbic I mean it wasn't even called the Bitcoin memory it was it was just like a bunch of random C++ or actually I think the first version was like mainly three files I don't think there was any C++ fun but you know I I'd like casually you know go open like open github and look at it and people had talked about it but I never actually started really poking around I'm looking at things until then and then I kind of stayed on the sidelines in the sense of I didn't really contribute development wise so I

started just reading academic papers I think one of sample and ski-e-o towns influences paper of red balloons and Bitcoin was one of the first academic papers I had remember reading and it was really interesting because it like was the first paper that was like hey there's a lot of surprising game theory algorithm that came through here that's like a little nuanced and it was the first kind of introduction I think to the a cat more academic audience so this the paper that really had me following the literature a lot more was a ghost paper from 2015 basically that was the paper that led to kind of a lot of the improvements that Letta theory I'm get to kind of the block production rate that it had because it basically found a

way to make these uncle blocks kind of useful so people don't like uncle blocks now but at that time it was really revolutionary that you could get the speed up and get the same security guarantee by just not wasting blocks that were on a bad Fork and it came from a game theoretic considerations and they gave probably the most rigorous probabilistic proof that I've seen because they actually analyzed the entire net try to analyze the network at that time at that time even even now I'd say people try to avoid analyzing the networking in the space other than that paper they did they they gave a very precise networking model which was which was really novel and a lot of people use that result site that result so yes I I

just kind of followed this stuff for a while and then I think the paper that really made me start writing simulation code for fun just like in 2017 was probably Al Gore and because some of the claims were like a little in particular Appendix C of that paper has like a little bit of there's a little bit of trickery there that it doesn't seem like it's actually as as it has a as claimed under the type of asynchrony assumption they made so that kind of got me into writing simulations for fun and then at some point I started talking to player one projects and I was doing consulting and then after a while I started realizing everyone kind of has

these same set of problems and there's a lot of tools from other fields for doing computer-aided design so whether it's computer-aided design of an airplane wing whether it's computer design of you know an economic system there's a lot of there are a lot of these tools but blockchain protocols especially ones that are trying to achieve high throughput have a lot of moving knobs that you have to turn there are a lot of parameters you have to tweak and you're never going to get like perfect guarantees the way you do about the underlying cryptography when you add in a lot of the uncertainty of the actual networking and also the actual game theoretic behaviors of maybe there's no maybe someone's not rational yeah so yeah so that that kind of led to me

starting gauntlet and now they're six of us and we're basically my my co-founders he he used to work on self sharing cars at uber so we kind of we try to cover as many simulation backgrounds as possible that's amazing I find it interesting that you point this out that a lot of people just don't do the simulation so don't actually look at the network as a whole life I found that as well when reading papers and reading research and I find it kind of worrying because they always just say something vague like under this assumption this this thing holds and and there's no backing of okay can we make that assumption like is that an accurate assumption to make or not and I think a lot of these assumptions

are not naturally that accurate and in a lot of cases it might be something like yeah we have some sub-second latency okay well do you actually have sub-second latency and in like a super adversarial Network or in a network that tries to send satellites to space to communicate blocks maybe that's not actually true so yeah it's it's tricky and I'm excited to see this sort of simulation space and flourish and and come up to speed if I understand correctly you've looked at quite a bit it like proof of stake and when people talk about proof of stake especially like on the consensus layer it's always this hesitation and people saying that it

relies on these game theoretic principles I don't actually know if those are true it's so much more complicated than proof of work and I I don't actually know if this is secure or not do you think your simulations or simulations in general could help bring some confidence to the to whether or not proof of stake actually works yeah absolutely I think there are a lot of ways to show different types of metrics for incentive compliance and the way at least at a high level that I like thinking about the difference between proof of work and proofs take this proof of stake is collateralizing a lottery ticket with energy whereas proof of stake is collateralizing a lottery ticket with a digital asset and the

harder part about reasoning about that is with the energy it's like kind of a one-way function it's irreversible right it's just it's a physical process that you know just strictly increases entropy whereas with the digital asset you don't actually know that and the the key is like you don't want it to be reversible but you have to spend all this effort like trying to force people to coerce the irreversibility of the asset so I think simulation helps you a lot in trying to both measure security measured in this kind of sort of high level notion of whether a digital asset can be made irreversible but also in kind of helping one think a lot about how the actual distribution of stake looks so in proof of work right the the distribution

of stake is really your hat distribution of hash power what percentage or half per gram and the genius of Bitcoin was basically to come up with a simple online estimator for like how much you think the rest of the network hash power is so difficulty adjust mean Bitcoin is basically you constructing a really simple statistical estimator of what you think the true network hash power is I'm based on that estimating like what the difficulty is and everyone who's honest does the same thing in selfish mining what you actually do is you withhold something such that everyone else can miss estimates a difficulty and a lot of the follow-up papers after mining basically prove that you when you make the most of your returns and

selfish mining is around one of these anomalous difficulty adjustment periods where difficulty is kind of this geometrically decaying curve and we're approximating it by this linear step staircase and those deviations are when the worst side behavior happens for proof of stake the hard part is that we're doing many of those types approximations with proof of work the difficulty adjustment is kind of like the crown jewel and I think that simulation helps you figure out these types of things of like am i approximating this curve really well because you can show that your system asymptotically can tolerate you know maybe in the limit of an infinite number

of transactions or like a really high transaction volume or a really high number of shards or some type of limit that it actually obeys these properties which is what a lot of the papers do but in practice people are using some type of finite approximation method and there's in in pretty much every other field you you have to test those to get quantitative bounds on those you have to do some type of testing whether it's Monte Carlo whether it's you know to some extent you're fitting a statistical model to it and then in the case of proof of stake a really cool thing is that monitoring the evolution of the state distribution is built into the

system whereas in proof of work it's it's kind of not as clear because you don't actually ever know the true hash power you don't actually know the true apportioning at any given time you're kind of guessing you're estimating it via difficulty but someone could be withholding a bunch with proof of sake you actually do know the whole state distribution and then you can actually start to talk about modeling like how close is this to random like does this look like a certain stochastic process that we know represents a random state distribution or a sort of random state distribution or a less random state distribution and you can adhoc go back and analyze the entire stake distribution and reoptimize what you do in the future and that that to me is the fact that there's

a you have the ability to evolve the security model and proof of stake that you sort of don't improve for work because the data is kind of hidden in terms of who actually is contributing hash power so this is interesting that you you've just before you mentioned statistical security but when we think of security usually in this space it's code security do you see maybe too much of an emphasis on code security do you think that people aren't paying enough attention to the modeling yes so so let me give kind of like the example quintessential example of this outside of the blockchain space so in trading algorithmic trading in general so like when machines are doing all the execution of trades one does not release a trading strategy because the

code is correct let's suppose that you have a trading strategy that just says head up the last ten prices divide them by five and if that's greater than one send a trade that code could be perfectly correct it's a very simple program right but it actually may just perform poorly because there's actual bra market data and you're interacting with everyone else's utility function reward function whatever right and and someone else can realize that you're doing that and then do something that's exactly the opposite in trading kind of one of the crowned infrastructure jewels that people build is called back testing software and back testing software lets you take historical data replay the

historical data and inject the things you're trying like where you placed an ad order where you cancelled where you know like what price you bought at a lot of different things or like maybe like you bought something in a correlated product it basically lets you statistically check like on average over all the historical data even when I shuffle it and do all these other things this thing has an expected return of X or Y and if you think about it things like selfish mining are giving you bounds on expected rewards they're not saying they're gonna work every time even though the code does not suppose to let you do it there's still kind of this hidden state that you didn't think about in real life systems when you're building these engineering systems there are often times you cannot really

predict all the states that your system is going to go through and your your your best bet is to kind of like come up with these statistical methods for for doing this but do you still think that there's not enough focus on this do you think that code security and audits like do you think that companies tend to invest more in that direction right now yeah so I think I think they invest in that direction partially because there's not as much used yet I think like once you have start having more significant use of a token where it's security is controlled by not only the on chain security of like how much does it cost to do a double spend but also the off chain security of how much collateral can I short this asset by in a

derivatives market with low leverage costs the moment you start adding in all of those factors you start saying like ok we can't really just model it simply but there's just not enough use such that you know if I if I want to buy a short aetherium derivative that is close to the size of the market like if I want to buy a 10 billion dollar aetherium short it's impossible to do right now right basically basically no one would underwrite that oh and it would just never you know it just never would would really really work out but if there's a lot of volume on these things you you will actually start to see short markets and in the normal markets that happens

where like the short market the derivatives market can dominate the underlying to be the biggest example of this is the SP future where the SP future trades 10 times the volume of actually the SP 500 itself that 10 is fluctuating but it's significantly more it's a multiple and that's just because it's you have lower collateral cost you don't have to like you to get you to get $100,000 of future exposure you may have to put up $5,000 of collateral and that's that happens once there's a lot of utility for something you'll start seeing those like derivatives markets grow as much as the underlying and and you're now gonna have to expand your definition of security and that's going

to be school so I think in the beginning the code audits are super important but they're complementary because you need to make sure your code is running correctly that's just like a given but after that now you have to start thinking about these exogenous notions of security and exogenous notions of how people are going to interact with you and that's really where the value of kind of these techniques from for finance or self-driving cars or even you know fluid dynamics simulations this is something that comes up and when talking about proof mistake is specifically like all the time because you you always have this notion of you put up a stake and if you misbehave that slashed and you lose that stake but what if you shorts on an

external market and so you put in a huge shorts but and then you misbehave so that the price goes down and therefore your shorts gains you more money than your slashed stake then you're still net profitable by misbehaving and like the best answer I've heard to this so far is just like yeah we'll have to make like the stake large enough that that secondary market can't outweigh it's our like that now we assume some sort of behavior of users on this networks and not you know let the price crash or I don't know like you I never heard a really good argument for it it's just

these kind of weird assumptions around how it's going to play out yeah definitely I mean there's there's kind of a weird hidden hidden hand that's like holding this from not happening right now which is bit mechs fees and derivatives fees the only mark derivatives market with a lot of liquidity in actuality is bit banks and that nexus fees are like daylight robbery compared to like the normal centralized markets mainly because they don't have any viable competition like people have tried that have have not been able to successfully get market makers to show up so the fact that the fees are so high means that the entering secondary market transactions costs you you you have a high fixed cost for some potentially large variable cost but also

potentially large negative costs if people don't want to take that uncertainty I think that's the best argument that I've heard against it is the uncertainty risk so you you can argue that yeah even if you are able to take a Big Short and blah blah at the end of the day you're never actually sure they are going to come out on top like you're making when you're making this play and misbehaving getting slashed you're assuming that the price will drop enough but what if it doesn't and so you're you're taking on this huge risk and the argument is that people aren't willing to take this risk exactly so in trading people would always ask about this thing called the st. Petersburg paradox which is this kind of famous game by Daniel Bernoulli

who's the famous mathematician physicist he basically said suppose you have a game where you flip a coin if it's heads I double your money and if its tail's I take away half if you write out the expectation of this it's going to actually be infinite of like how much reward you get because it's going to be 1/2 times 2 plus 1/4 times 4 plus 1 over 2 to the N times 2 to the N that's infinite but the variance is infinite - and it actually grows faster than the mean and so the moral of this thing is that you actually have to somehow measure how fast your variance of your return grows relative to your mean and that in normal portfolio theory that's something called a Sharpe ratio so the simplest way to really start quantifying

these types of adversarial behaviors and these systems is to start developing measurements of volatility or uncertainty that a certain strategy takes so even if a strategy is dominant in the sense that it's mean ghosts infinity faster than everyone else was mean if they have to take a huge amount of uncertainty then they probably won't do it and in derivatives markets everything is about measuring those uncertainties and the cool part about the blockchain space especially as people are going online making more decentralized derivatives is that there's an opportunity for kind of a new version of black Scholes a new version of how people measure volatility to show up because now your volatility depends on both the networking and the on chain

asset and the correlations the on chain asset and there's a sense in which proof of stake is really the financialization of proof of work you're kind of making a like bomb when you make a bond for the reward that you get in the future and have a slashing condition you've kind of turned a bond into an option and you you know if you start actually trying to take a lot of the normal financial modeling for four different types of assets into proof of stake land you start to see that there's actually a lot of similarities and you can actually learn a lot about how to design these things from those federic your in your example this you mentioned that like if someone slashed that the price of the token goes down or the market if they misbehave then one could expect like if

they misbehave by including a double spend for instance with the price of the token go down because there is no a double spend in the blockchain yeah like like how there was a double spend and et seen the price didn't go down is it just because something has something bad has happened to the network and we are expecting the price to go down and not irrationally only go down by 7% and I think then bounce back there also lots of like interesting attacks against so sorry there are 3-3 attacks that people we talked about number one there's nothing at stake which is that it doesn't cost you to vote on a bad fork whereas in Bitcoin you're spending half power to vote on a bad floor number two is long-range attacks in the early part

of the stake distribution there might be a few people who have overwhelmingly high stake in the system you bribe them to kind of like make a really long chain and because they have all the stake they can notarize everything and the third is a grinding attack which is you have all of these random number generators that you need to draw from this distribution but what if what if someone has high compute power and can basically sample all the random numbers and basically figure out which random number seed had gives them some slight advantage so for the first two attacks suppose the liquidity cost a transaction cost was let's just say zero for this saga Donkin basically transaction cost is zero you actually want to always vote on all

nothing at stake possible branches you just make sure that you have an outstanding future that you roll over it doesn't cost you any money to roll over the expiration date under this assumption of no transaction fee and the transaction fees are very he to whether this works or not but in this case there are none yes in this case there are none so you basically can can commit nothing at stake attacks all the time you don't mind getting slashed because you're basically making up in the the other market but the more interesting thing is that is that all of these thought experiments run in this world where people assume that the underlying is independent of the derivatives market like that there's enough like infinite liquidity in one and finite on the other or one way or

the other but they're actually intrinsically linked and so that's really where it gets interesting in terms of like how you have to model different users because sure I took a short position in the derivatives market there's a counterparty there and that counterparty clear was able to lend to this asset which means they held this asset for some reason which means they have some expectation of it which is correlated to the actual underlying price so these kind of complicated loops are actually very hard to prove things about it's very hard to prove a formally verifiable theorem about these types of systems because they depend on a lot of randomness and we don't know the correct thing we're drawing from like we don't know the space of possibility is to say

like we put this probability distribution on this space and we took a sample from it in real life what happens is those probability distributions are changing a lot over time and certain things that were accessible at time T are not accessible at time T plus 100 years and so so there is some intrinsic security even in this nothing at stake world that comes from transactions these and so so so modeling that type of stuff is also very important I kind of related note is that high frequency market makers and the equities markets would not be making any money without exchange rebates what I really like about what we're talking about is it it does harken

back to the conversation that we had with Axel that you just mentioned earlier and that was an episode that we recorded I think back in October where we went through the fundamentals of POS and we talked about some of the attack vectors do you feel like in bringing a lot of these models and this modeling these modeling concepts to this space do the space complex or is it quite simple compared to these other like maybe more established industries where you require modeling things like self-driving cars or physics modeling with Asics that you were doing back in the day I think the modeling is more complicated but the technology is simpler because in all

honesty I mean they're just just not a focus on like low latency or high throughput yet because people are still trying to figure out what cryptographic primitives they want to use kind of what architectures they want to use and how they're going to construct these things it's more like in the space of people are still designing stuff so they don't really know there's nothing to optimize two words because we're still kind of trying to figure out the main first cut but I do think that the desire to get to high throughput especially with this desire to like get visa level transaction rates out of out of public blockchain systems will basically

require taking in all of that knowledge you know III I mean people are now starting to be like oh wait maybe we shouldn't use like raw TCP packets when we're like sending blocks we should actually just have like UDP streams and like do what Google does in Chrome to make like buffering faster Google quick so like I've heard a bunch of layer 1 projects talk about like oh we're now rewriting our networking stack and doing like cut weird custom UDP stuff so it's getting to that point I think we're at this inflection point where like now we're starting to crystallize on the design space and we're kind of getting to the optimizing time and that's really what that's what we are kind of really looking at it I think you need to get

something out to start experimenting and do simulation and analysis in parallel like like you were saying like switching from TCP to UDP streams like you wouldn't or you even shouldn't do that in your first cut like yeah it just don't optimize what you like don't know is going to be a bottleneck and I think too bad depends also very much on like what kind of scaling design you're going for are you trying to get as many transactions as possible on one single chain then you need to do one design if you're trying to do sharding and so sort of break up you can you can have pockets of high or like pockets of low transaction but as the system as a whole

has a lot of throughput then you have a completely different design again but I think ultimately like even a shorted system eventually you want each shard to be very fast so you then go back again to like trying those low-level optimizations so yeah I agree like it's so early that like we haven't really even decided on on any particular architecture but that being said the proof of stake when there's this kind of this there is a lot more optimization there because people who have proposed protocols have a ton of parameters and those protocols for different types of malicious behavior you are deducted this and the reason simulation and optimization tools are really important

and interesting I think from a two to a non specialist I think the easiest way I've always thought of explaining this is in the u.s. we have a recycling tax so when you buy a bottle or a can you pay five cents on purchase and then when you recycle it you get the five cents back so that value that five cents actually varies a lot from state to state but you now now do the thought experiment let's suppose we made that tax five dollars so that's significantly more than any beverage right like a can will cost you let's say a dollar so what what do you incentivize you incentivize people to a double spend so so if if the recycling tax for slashing gives you a

reward of five dollars you are much more incentivized to break open whatever the recycling machine is and try to figure out how to like send the same can in a bunch of times and you also probably cause demand destruction because you just made the prices go up 5x for a can on the other hand if you make the tax a millionth of a cent people are not incentivized to actually go recycle or actually what you see in New York for instance is that homeless people like collective we go into trash cans and like find all the cans that people just threw out and then go recycle them at some point that's not incentivized so you have to somehow choose these parameters such that you get behaviors where people are really dissuaded from being too far from

the rational assumption because the uncertainty is just way too high and so that's that's the stage at which I think per se kisna hitting this optimization it the switch from architecture to optimization also I guess because it's I guess both proof of work and proof of stake would be model a bowl but here it because it's really it has nothing to do with this song cost of electricity there's a lot of like it's it's far more in the pure game theory I figure it's just like numbers right it's just like flashing amounts and yeah that's why I say that proof of stake is just the financial is it the inevitable financialization of proof of work you know a lot of diehards would say that's

a bad thing I don't necessarily think that's a bad thing I think it's just like that that in order to get throughput you have to give up something and what you're giving up is it's like you have to now control this entire lifetime of the asset as opposed to like lifetime up to electricity burn the only thing I regret with a switch from proof-of-work to proof of stake is you're removing this cyberpunk element of like using your computer to heat your apartments to get some cyber coin thing and yeah you don't have this like cool sense of buying a bunch of hardware and sitting in your basement and tinkering it's more just like buy some asset on an

exchange and put a first dish yeah well I mean I I guess the more interesting question also that and this is something that I think simulation ends up being useful forward to is is token distribution models are now getting rocky and the token distribution for proof of stake tokens and also sort of layer to things that look like proof of stake liked ecr's sorry token cure to registries completely determines whether you hit a stable equilibrium or not no matter how rational everyone is if you give all the tokens to a small number of users it's inevitably gonna have this plutocratic effect and so this is another thing you have to design whereas like energy is not quite that like it's somehow we just Nature gave us

whatever distribution we have and that's it going back a little bit to engineering you want to focus a little bit on this what are you guys actually building and what are you building in and how do these simulations actually run so we have a C++ binary we have a way of like specifying the networking of the whole system we have a way of letting you specify ddossing so like removing parts of the graph we also have ways of specifying a compute model for each agent in the system and we're making a domain-specific language for for defining like what how an agent actually behave so it will be a scripting language that we compile down to our C++ representation the closest

analog I can give you to that is there's a a custom compiler from Google for tensorflow called xoa which they open-source recently but it wasn't open source for a long time that basically is a way to take the data flow graphs from say tensorflow run or you know whatever however is generating your your deep learning dependency graph and like figuring out how to you know map it map it down to kind of like a machine optimal thing so we're working on on that so that with with the idea of trying to get to a hundred thousand agents and a hundred thousand blocks in

under 10 minutes with agents of reasonable sophistication like they actually have a real they're not like stateless they actually are evaluating some yeah and that's a single core for single parameter let me see if I get this straight then so basically you define your network and your agents in this domain-specific language it compiles down it gets executed by you are C++ binary but how do you define the the behavior of the agents then I mean if I'm thinking about like how would I simulate a parody theorem for instance yeah I feel like I would actually need to run a parity Theory node because it's

so complex and like how the the transaction queue works and what type of transactions and how long they take to process and everything depend like block import time is that usually important part of propagation time for instance so the idea is to take as much of the actual raw timing data the data we're using right now is just stuff from Falcon so Falcon was is this like Bitcoin and aetherium forwarding project that kind of turned into this company called blocks route that's building this like forwarding thing but but they add public data on like actual latency numbers our goal is to like figure out how to make a problem generative model that generates

how these things look without all of the fine details yeah with the idea that if you have a generative model that you're continually training to real data then the generative model is removing some of the fine microscopic details but getting the high-level details that give you kind of the correct average statistics so that you can actually measure variances and means but you're not going to necessarily get like exact timing behavior correctly you just want them you want the moments of the statistical distribution to be the same or roughly approximate versus things that are totally you know totally random so that the key is not to get every little piece of a client correct so much is to get

the statistical properties of networking correct so one result that kind of led me down this path was I started I started simulating Bitcoin on different network graphs and I was able to kind of cause a phase transition under some some conditions so what do I mean by that so take a graph of a bunch of miners each of them is growing their own Bitcoin tree so I say tree here because I'm including all the forks if you look at the heights of those trees if you can basically construct Graf's who's kind of like maxcut has very high weight such that you basically get the heights to diverge statistically so the high correlation funky vanilluxe

rating around each other in a way that's uncorrelated which means that the two sides of the graph are basically on different Forks and they never revert to the same fork like even though they're it's like having this constant reorg thing where we're always on the opposite reword and statistically and so once I saw that I was like okay so clearly you can already get a lot of these effects if you remove some of the microscopic details just from trying to simulate the Layton sees between clients and between miners and that type of stuff is where where the physics analogy comes in because the the simulation I did the first kind of crappy slow Bitcoin simulation I did looks a lot like simulating something called the Ising model in physics where you have a grid

of points so the Ising model is a model for magnetism so basically it's a model where you have a grid let's say it's n by n grid and at each grid point is a spin which is just a plus 1 or a minus 1 and you you provide some local rules for interacting how those spins are together where you say opposites attract a likes repel and this is a very local rule and you can kind of measure the energy of the system and what you find is and you're at you when you write the energy you add in a temperature term and what you find is like below a certain temperature there only state that you can ever reach is everyone is aligned which is when your magnetized and then

above a certain temperature there's enough kind of like weird fluctuations that it looks like it's totally random and so with Bitcoin you can think of everyone agreeing on the same everyone in the whole network agreeing on the same branch as being in that magnetic state where everyone is kind of like aligned in the same direction and so I I was kind of trying to find ways of computing metrics that would like show for Bitcoin when that like are there adversarial graphs for which that happens or can you show that for a random graph ensembles like random networks for different models of the internet like that would or wouldn't happen and the fact that you can get those separate results from from removing some of the microscopic details suggest that you can get a lot of the averages you need to

get statistical results about the game theory without actually having to get every single time stamp correct so it's sort of like you're using some real-world data to test the protocol but not any specific implementation of that protocol yes I wouldn't use your library to like try to optimize parity Bitcoin you know run this thing fix a thing and run it again and see if it was faster and like it's not that type of benchmarking or simulation thing at all it's it's much more about testing the protocol game theoretic properties that that sort of thing yeah and also getting kind of SL ways on things so like you can now measure like expected round-trip latency is this type of testing - the financial part is is not that different

to how Google tests panner where they actually have like a simulation where they remove the actual span or client but they try to replicate all the messages span their sends and then measure like what is the expected latency when someone goes on Google Cloud and performs a query it's just a way of like coarse graining a little bit of the detail away but making sure you have just enough to not distort certain statistical properties such that you can measure how the game theory is working so this project gauntlet came out of this work I guess can you tell me a little bit about like what's next for you what's next for gauntlet yes so you know right now we're just honestly focusing on building out the infrastructure getting all the

statistical tools that are generic to all protocols implementing a bunch of basically all the tools needed to implement most proof of sake protocols making sure that we get correct latencies correct data get kind of all infrastructure work we as a company are basically trying to more or less have kind of like a developer tool product where you can put it in your CI and we'll go around the simulations we are really trying to make sure that we get all layers of the stack so we're also trying to get to the point where we can do statistical testing of contracts not just the layer one protocols especially because a lot of contracts

just end up recursing layer one protocol mechanisms within them like TC RS kind of our weird staking game we're instead of like once taking ensemble you have a tree of seeking ensembles it's like the fact that there's actually a lot of recursion and the types of algorithms that are being used suggest that you know if you can if you can really figure out how to categorize these you can do this so yeah we're just working kind of more directly with layer one projects right now and trying to make sure we our software works and then figuring out where we go from there with that with the code and the tools that you're building what's the plan going forward in terms of what do you intend to open-source or how do you imagine that people actually use this and you know

find it so we're planning on like open sourcing some of it and then basically selling just the service of us running it more because there's like a lot of annoying distributed infrastructure you would need to actually run it and like get the statistical results and get the dashboards and stuff like that we'll open source stuff so it gets audited but then you know like we'll sell the service of running it and our goal is to really be a neutral third party so we don't want to be partial to any particular project or any particular contract so we promise never to hold any crypto assets so even if we are paid in crypto assets we will not hold any because I think if you're trying to do something like this to give people this

guarantee of security you really have to be impartial and it's very hard in this space if you're holding yeah tricky I mean in other markets how do they actually create impartiality like that I just meant yeah it is very hard to actually be kind of a neutral third party you only develop that by like engendering the trust of every person that you end up working with mm-hm individually and and I think that's from our perspective really important because we really view the whole ecosystem and the whole space as providing this really amazing tools for reinventing law and like how people interact with the law but we just don't really have any strong opinions of which thing will work we

kind of are like whatever the data is what will really follow on so that's that's kind of our core does our core core values cool and and I your your pointer like how is this handled in other industries like I think that's actually one of the things that I like about the crypto space is that people like there are a lot of players who actually try to be impartial and try to say things like we don't hold any crypto nor just trying to do this or that where it's like when I worked in the financial industry financial advisors are the least the impartial they are so partial like they're being directly paid by funds to shield those funds it's yeah you know the same

problem exists everywhere and it's not always addressed yeah well one thing I actually find kind of funny and equip this space is that people in crypto land seem to get angry about these like eff coin do you guys know about eff coin it was this like exchange that paid the transaction fees back to miners by 150% and they incentivized miners to just like wash trade themselves because they would get more this is like the short market thing except on steroids and so like it a gob law transaction volume on the exchange for a little while but then they like remove the reward and no one did it so everyone you know people were writing all these like blog posts they're like oh this is crazy there's no neutrality the exchange is partials and miners but all markets that

have any significant liquidities offers some type of tiered system where like the more volume you have the easier it is for you and there's a rich getting richer phenomenon just like in proof of stake because someone took that early risk to get all that volume someone took that early risk to become the delegator so there is this kind of delicate balance between like ensuring there's liquidity and like pure uniform like Gini coefficient you know zero sort of so like that's kind of the cool part about the spaces it's exploring those boundaries and I think maybe to wrap up what's coming up in the space that's actually exciting for you I'm just really excited to see these experiments attempt to get scale I think one to

think that the the things that really to doubt ignoring sentiment on Definity I do think that threshold really is really an amazing amazingly simple way of generating randomness and it's kind of shocking that that it you get that kind of scaling property for free so I'm really excited to see will it actually be possible to do this distributed key generation all these little technical details have existed in academia for a long time are gonna be tested by reality and like that's to me that's like really exciting cuz I believe some of them at least one of them is gonna work I just don't know I don't have a lot of like confidence that I because there's so little data on like how these systems go

from theory to engineering I just don't feel the confidence to say any of them is better than the other I just I'm just excited to see see the data well hey I want to say thank you so much for coming today to talk to us today yeah thanks right thank you very much I guess we will add links to whatever we can in the show notes all right maybe you'll link to your website but maybe a link to your Twitter as well well thanks again and to our listeners thanks for listening thanks for listening you