Epicenter - Learn about Crypto, Blockchain, Ethereum, Bitcoin and Distributed Technologies - Simon Harman: Chainflip - Native cross-chain AMM

Episode Date: October 27, 2023

While competition fosters innovation, the proliferation of different blockchains has resulted in the fragmentation and isolation of liquidity within each ecosystem. Early attempts to address this issu...e primarily involved bridges and wrapped assets. Unfortunately, these solutions were often vulnerable to hacks and exploits, and the value of wrapped assets was contingent on the security of the wrapper contract, rather than the underlying asset. Cross-chain swaps of native assets hold the promise of resolving liquidity fragmentation, but numerous technological challenges must be overcome to make them as seamless as same-chain swaps.We were joined by Simon Harman, founder of Chainflip, to discuss multi-chain liquidity fragmentation and how Chainflip’s JIT AMM (Just in Time) aims to solve this, by providing cross-chain native swaps.Topics covered in this episode:Simon’s background(Legacy) Bridging vs. Threshold Signature SchemeChainflip’s Just in Time (JIT) AMM vs. Uniswap’s V3/XProviding liquidity on ChainflipSlippage and UXDeciding trading pairsChainflip validatorsValidator stake auctionsGovernanceRoadmap and bootstrapping liquidityEpisode links:Simon Harman on TwitterChainflip on TwitterThis episode is hosted by Felix Lutsch. Show notes and listening options: epicenter.tv/519

Transcript
Discussion (0)
Starting point is 00:00:04 Welcome to Epicenter, the show which talks about the technologies, projects, and people driving decentralization and the blockchain revolution. I'm Felix, and today I'm speaking with Simon Harmon, who's CEO and founder of Chain Flip. Chainflip is a cross-chain, decentralized exchange, and messaging protocol. Welcome to Epicenter, Simon. So glad to have you here. Likewise, Felix. Thanks very much for having me. Right, so I introduced it a little bit like what Chain Flip is already. We're going to obviously talk about that a lot, but as, as is it's a lot. but as is customary on epicenter, we like to start a little bit with the history of the guests, how they found their way into crypto.
Starting point is 00:00:51 I think for you, it is quite an interesting journey with like many contributions already to like cryptography and crypto economics in general. So like, yeah, why don't you tell us a little bit how you fell into the crypto rabbit hole? Yeah, sure. You know, crypto's been a part of my entire adult life. I just turned 27, but I bought Bitcoin in high school in my last year. Wow, that's coming on for a decade now. That's crazy. And I can't believe that.
Starting point is 00:01:22 Yeah, I guess me and my best friend were very interested in politics and economics and things at a very young age. And for some reason, you know, also being very into video games and such and developed a lot of stuff around Minecraft and other games as well, a lot of websites and things like that. That was kind of my high school job. So I don't know, Bitcoin just kind of spoke to us when we were young. And through all the money I was making from website development into Bitcoin for reasons which elude me even today. But, you know, that obviously kicked off a massive journey, you know, started university
Starting point is 00:01:59 and Ethereum came out and was margin trading on Poloniacs at 18 years old. And, you know, there's crazy, you know, things for, young people to be doing, I guess, but we were kind of crazy, so it makes sense. But I guess, you know, my journey as a crypto founder, I guess, really started after university when I turned when I was 21. And I was very interested in the privacy space, especially at the time, obviously still am. But yeah, the idea of, you know, deploying blockchain networks to do stuff off-chain, so to speak, was always something that I thought was quite appealing and something that people weren't really doing, especially at that time. And so I founded a project
Starting point is 00:02:47 called Loki, now called Oxen, where we have spent the last almost six years developing. The main product that we've been developing on top of this network is called Session. It's a secure messaging app. It uses similar encryption to Signal, but it's all deployed on a fully decentralized network backed up by about 1,200 independently run service nodes they're called like validators basically and we have like this sharded distributed storage system and I think we're coming up on like 5 million downloads now I think about 800,000 monthly active users so you know after many years of development and a lot of pain now finally starting to see this get adopted in all sorts of crazy ways. There was, you know, the Iranian protest movement last year. That really kicked off
Starting point is 00:03:41 the adoption of session and, you know, getting random emails from like the Swiss government saying, oh, hey guys, I just wanted to say, like, we're all using this and enjoying it. So thanks, keep up the good work. Which, yeah, after so many years of developing in the bear market and, you know, having a lot of struggles to go through as a result is, you know, really awesome to see. I'm not involved on a day-to-day basis anymore in that project. Still being run by my co-founders, Chris Key and Josh, down in Melbourne, Australia. But a couple years ago, I moved here to Berlin to take on chain flip. And, you know, it's another good example of a project which, although is, you know, heavily dependent on blockchain technology,
Starting point is 00:04:29 you know, we're doing a lot of stuff off-chain, so to speak, to create a product that so far has, eluded the space for many, many years, you know, ever since Ethereum became a thing. And alternative blockchains as well, like even like coin and stuff, I remember these sorts of conversations happening. Like, for, you know, for a space that's so oriented around permissionless money, you know, why are we using all these exchanges to do all the value transfer within the space and, you know, what potential other solutions are out there? You know, Bitcoin or Ethereum swaps is kind of, you know, I can. consider it to be the holy grail of the space. And although there has been some good progress
Starting point is 00:05:10 in the last couple years, you know, a lot of the time it's been some weird wrapped token thing where, you know, you have this fragmented liquidity and this bridging risk and stuff and pretty low adoption. So yeah, I guess that's sort of a hopefully a pretty succinct summary of how we got here and what links at all. But yeah, as you say, it's been an incredible journey from start to well it's not over yet far from it but yeah the cryptography side of things has always been very interesting particularly in the privacy space that was a really really good introduction into that diving straight into the deep end building off the back of a manoe based blockchain which has some pretty crazy stuff in it and now you know the sort
Starting point is 00:06:00 of core of this protocol relies on threshold signature schemes in particular a scheme called frost which is a Schnorr signature-based system, which allows us to create essentially wallets on a bunch of different blockchains, and it's all controlled by the validating network, which we've capped at 150, could go higher, but 150 validators signing, transactions, doing key gen, rotating the keys,
Starting point is 00:06:27 rotating funds through these vaults, we call them. And that allows us to achieve a kind of architecture that the centralised exchanges kind of figured out by default, I guess. You have several block chains out there. You just create a wallet on each of those. And then you sort of do the accounting and the swapping and the trading separately from that. So you settle using this threshold signature scheme, but then you do all of the accounting separately,
Starting point is 00:06:55 what they would call a matching engine. In our case, it takes the form of something called the JOTAMM, which I guess we'll talk about later probably. but yeah, I don't know. Is that a good summary? I'm on the right time. Very happy. You already dove into some topics that we want to like go into some more, I guess.
Starting point is 00:07:14 So you've been working on this since around when you said like quite a bit, right? Like, Trey Flips, but didn't. We started doing research into the topic at the start of 2020. I mean, for context, you know, at the time Oxen was, you know, doing okay. but Bitcoin just dipped to $3,000 at the beginning of the pandemic, and we were kind of concerned that we weren't really going to be able to continue with the level of resources that we'd had. We'd been building throughout the bear market on what we'd raised very early 2018.
Starting point is 00:07:51 But, you know, at that time, for those that were around, you'd probably remember how dire things seemed at that moment in time. So we were keen to expand what we were doing and try and find an angle that could sustain everything. And luckily that wasn't necessary in the end, but it did give rise to this idea of chain flip. So yeah, we started researching. I think the first version of the white paper for this came out in July of 2020, which was right around the same time that Uniswop and the whole yield farming thing in the DeFi summer kicked off. So we were looking into this even before then.
Starting point is 00:08:29 Right. Yeah, I think that's actually very interesting because now, I guess that was actually before all the cross-chain stuff really happened with old L-1s and, you know, like, I guess the concepts from Ethereum being ported over to like other chains and then like sort of these systems interacting. And now we do have a bunch of bridges around, right? But I guess, you know, like your network sort of expands on that and gets rid of some of the problems that some of these early bridges have. Maybe we can like, yeah, start there again. I think you already mentioned you have this threshold signature scheme. Can you talk a little bit about how it works and like what are the benefits over, you know, maybe some alternatives of bridges that are being deployed right now? You know, what's the core issue that dissolves?
Starting point is 00:09:20 Yeah, sure. I guess like as a fundamental principle, we came into this thinking about the entire vertical of native cross-chain swaps. You know, what is the user experience that we're targeting here? And, you know, that sort of informed all of the decisions that we made in the protocol design and all of the updates that we've made to it along the way as well. But as you point out, you know, there's been various forms of bridges and wrap tokens and things around for years now, none of which have really proven to be, you know,
Starting point is 00:09:57 100% dominant in any particular vertical. So, you know, we've had a lot of hacks because a lot of these were just pumped out by, you know, random teams who either ran off with the money or built them in a rush and, you know, didn't do the necessary due diligence. And I think to an extent that's still very much happening today, although, you know, there has been some consolidation, thankfully. But, you know, wrapping a token in one place and having it being available and another is fine. But the liquidity available on these alternative chains can be very limited. You accept a lot of tail risk as well. And, you know, I don't think I need to explain how much money's been lost doing this. It's extraordinary. I think the closest to
Starting point is 00:10:47 equivalent protocol that you might compare to chain flip, there's probably two that I would point out. One would be Thorchain, who definitely paved the way for this technology of having this threshold signature scheme based settlement system and then layering a trading system on top of that. You know, it's conceptually the most similar to chain flip, although there are differences at every level between the two. We don't share any code or anything like that, but conceptually, that's, pretty close. And then the other one that I'd point out is probably Axela, which allows you to
Starting point is 00:11:22 bridge US dollars from one chain to another. That's pretty much the only use case for it at the moment. And for cross-chain messaging in general, we haven't seen really anything else pop up that people seem to be using in terms of the interoperability category, which is a word people love to throw around, but then in practice falls short very often. They too have a decentralized validated network, they're sort of doing this, you know, minting, burning, Oracle thing. They have Axel USB as a sort of middle step that allows the minting and burning of USD balances from one place to another. And then from there, you can use that to swap in and out of various assets through, you know, the usual suspects, uniswap, pancakes, so on and so on.
Starting point is 00:12:08 So, you know, there are now solutions out there that are miles ahead of, you know, the more traditional bridging technologies. But still, there is definitely room for improvement, especially within the native swaps vertical itself. Like, for example, Bitcoin, you know, you can do Bitcoin swaps natively now through Thorchain, which is great. The only downside is, you know, due to the market structure, you do have to wait quite a long time for those to be processed. You know, depending on the size of the swap, it can take hours or sometimes even days, depending on on what you're trying to do. And there's definitely improvements that can be made there.
Starting point is 00:12:49 And then anything outside the EVM ecosystem is a bit of a black box. You know, you have, you know, ICB within the cosmos ecosystem, but getting in and out of there has been a challenge until recently. Bitcoin, woefully undersupported. It is a dinosaur protocol. I hate to say, but, you know, working with it directly, you can clearly see how far we've come from that original design. and the number of workarounds you have to develop
Starting point is 00:13:17 in order to be able to work with it. In something like this is not fun. But it is what it is. Pocodot, Solana, the list goes on. File, coin, telegram, open network. There's many, many examples of these sort of non-EVM or non-less compatible EVM. It's not a one or the other thing, you know,
Starting point is 00:13:40 there really is a spectrum going on here. but with such a diverse range of blockchains out there and the size of some of the assets in terms of the volume and the liquidity and such that you see in the centralized exchanges compared to the level of support it has within defy and within decentralized exchanges generally is quite surprising and has remained so ever since we started and long before that as well so yeah i guess we can probably dive a little bit into the architecture and talk more rigorously about some of the components that enable this. But I guess our end goal is that, you know, with one transfer,
Starting point is 00:14:21 you can send funds from any wallet to any wallet and receive the asset that you're looking for at essentially a zero slippage price with, you know, a very minimal bridging time as well. We've got some unannounced features coming up around that, which we're excited about. I can't really talk too much about that. But, you know, I guess the idea. The core idea is to repeat what Uniswop did for Ethereum-based assets.
Starting point is 00:14:47 You know, before Defy Summer, you know, all of the ERC20 tokens were still pretty much exclusively traded on centralized exchanges. But, you know, this year, even now, even in this, you know, pretty bad market, Uniswap's been crushing Coinbase in terms of volume. You know, there's the Ethereum ecosystem has really stepped up and above beyond. the centralized exchanges in terms of convenience and speed and all of that kind of stuff, as long as you can get that pricing and that liquidity aspect right and make it fairly straightforward, we believe we can also repeat a similar level of adoption for assets that are outside of the EVM ecosystem. So, yeah. Yeah, I think the core here being sort of this combination almost like made it of the swan
Starting point is 00:15:41 swap and the bridging and like kind of thinking from that user perspective which which I think will probably helps a lot like actually achieve that too and so that's also why I want to dive into you also mentioned already the first white paper was like kind of when uniswap came out now the way I understand you have this just in time liquidity protocol right that's that's sort of similar to uniswap v3 but I guess initially when you when you started check flip uniswit uniswold V3 wasn't even the thing yet. Did you already like sort of think in similar direction about how like liquidity provisioning should work or did you later adopt the Uniswap V3 kind of model and maybe also like in general how how is do we have to think about like chain flips like decks kind of as Uniswap V3 like native cross chain features or are there like other differences? There are other differences.
Starting point is 00:16:37 I would probably most closely related to Uniswap X's. proposed intense feature, which isn't even out yet, rather than Uniswad V3. Yeah, but you're right. At the beginning, you know, Uniswilv2 was out and, you know, it'd been running for a couple years, but it didn't really have the liquidity necessary to, you know, have it be widely adopted.
Starting point is 00:17:01 But then DeFi Summer came and that changed the game. Then Uniswap V3 came out. And then after that, we decided, you know, rather than just do V3, which would have, is an improvement. But in this particular context, we thought we could go further. And so we developed this thing called the JIT AMM. So we were seeing with Uniswap V3, this new type of MEV attack, quote unquote,
Starting point is 00:17:27 it's not really an attack because, you know, the user wins, which is always nice. But essentially, if you had a big enough swap coming in on Uniswap B3, you could submit a flashbots bundle where you could essentially create an incredibly tight liquidity position around the market price of the asset. So say it's like a million dollar swap right, you could set up a flashbots bundle where you add a bunch of liquidity at whatever price you, like basically whatever you can get on finance and the prime brokers, OTC desks, everything else. So, you know, you're basically sourcing liquidity externally.
Starting point is 00:18:08 deploying that liquidity, then you execute the swap and then you remove that liquidity. So what you've essentially done is you've just front run all of the other LPs and given the user a better price to win the liquidity fee. And so that became very popular very quickly for larger swaps. But because of the gas costs involved, because of the bribery that you have to do to execute that, you know, the size of the swap has to be massive for that to make sense. But we realized, well, you know, in our context, because this is like a bridge and an Oracle and an AMM all in one, because of the delay in bridging, everyone can know what swaps are coming.
Starting point is 00:18:53 So if you send one Bitcoin to be swapped into chain flip, you know, it will take an hour for that deposit to confirm. We're going to, we'll, that won't be the case soon, but we'll ignore that for now. you don't need an hour to do this. You need a minute at the top. You don't even need a minute for the active LPs. You know, this is all done automatically, programmatically. But because you know it's coming, you can essentially go, okay, well, you know, I'm willing to offer X price on Bitcoin, say 25K.
Starting point is 00:19:26 And there's another liquidity provider who is also doing the same thing. And then, well, I'm going to offer 25K and $2. You know, I'm going to beat you. So you have this system where liquidity providers can submit maker-only limit orders on top of the standard UniV3 pool. So if you want to provide passive liquidity, you can. And the execution will move through that liquidity where it can. But these limit orders on top really supercharge the marketplace because it means that rather than depending on what is used. usually quite an inefficient pool structure, you can have liquidity providers quoting in real
Starting point is 00:20:12 time based on global index liquidity. So effectively it means you get zero slippage swaps. You wouldn't be able to get a better price on any particular centralized exchange because that doesn't aggregate all the order books. So at least it's a market order. So that's a really cool feature and it's all nicely mathematically integrated. We've forked Uniswob v3. converted it into Python, then ran some experiments, and then once we were happy with the design, we then converted it into Rust and deployed it in the state chain within the chain flip ecosystem.
Starting point is 00:20:49 So, yeah, you kind of have LPs front-running each other to offer you the best price. It's kind of like an open OTC market for native cross-chain swaps, which is pretty unique. I don't know of anyone else doing it this particular way. Cow Swap kind of has a similar thing going on, but again, that's only single chain swaps.
Starting point is 00:21:06 And Uniswop X intense will also have a similar thing. But again, single chain kind of options for incoming flow. So yeah, hopefully that means for users, you know, you can swap 200K worth of Bitcoin and get the same, if not better price than you would on Binance. But it's all done completely decentralized. There's no accounts. You don't have to sign up for anything. There's no withdrawal delay or anything like that.
Starting point is 00:21:33 As soon as the swap is done, that's it. Your tail risk is over. which is yeah I think hopefully going to be very appealing to people yeah super interesting like I think I read somewhere in your dogs that this sort of liquidity provisioned just in time liquidity versus like as a reasoning has sort of been like 3% of the volume in 2022 do you know if that number actually went up in the meantime and maybe I guess you already sort of mentioned it is that mostly because so it's like relatively low I guess still, is that because of the cost on Ethereum, like the gas fees and sort of just
Starting point is 00:22:12 not enough people doing it and or where do you expect it to go? Do you think this will like go to 100% at some point that we're like much larger like maybe. Yeah. Well, I think with Uniswop X, like the intense infrastructure that they're building now does exactly this. It allows, it creates a bit of time and a bit of space and this sort of off chain system whereby, you know, market makers, liquidity providers, whatever you want to call them, can put forward a bid for incoming flow. So this is not a radical idea, right? This is something pretty widely understood even in the traditional finance world. The V3 AMM or just AMMs in general are the strange thing that's occurring in the industry, right? That's been the deviation from the norm. But yeah,
Starting point is 00:22:58 the reason why it's not like 100% is because when you're doing a $50 swap, you know, to submit a flashbot's bundle in the first place to be able to execute this kind of action costs. I don't actually know off the top of my head, but it's significant. It's hundreds of dollars potentially. And you have to be able to clear enough in profit to make that worthwhile. So the size of the swap has got to be, you know, several hundred thousand dollars before it even makes sense to even think about doing this kind of just in time liquidity provision on uniswap v3 again because of the gas costs but on chain flip because we're running in this
Starting point is 00:23:41 app chain environment the cost is essentially zero so you can you can bid for this flow with no downside risk and you know locally source in real time from whatever market making software you happen to be running so for users this is really good because it means that even if i am doing a $50 swap i'm still going to get you know access to those same sort of rates which is exciting Right. And so just to clarify, I guess the liquid providers or the market makers or whatever we want to call them, they interact with the chain flip state chain to like submit their orders. And how does it work at practice? There like some API or? Yeah, it's called the LP API. Very creative, I know. But it's essentially just a blockchain client, really. And you can subscribe to it. And you know, and you can subscribe to it. you connect an account to it, so you have some local keys. So you deposit funds into your LP account.
Starting point is 00:24:42 So you send some Bitcoin, you send some Ethereum, you send some US dollars, whatever, or USDC rather, to the chain flip protocol through deposit channels, and then you have a free balance inside your LP account. So really, it's pretty much like a centralized exchange in many ways. Many of the exact same API calls. It's just you're dealing with it through this wrapper that talks to a blockchain rather than through an API
Starting point is 00:25:04 that talks to some matching engine somewhere on someone's server, right? So, yeah, it's, you can think of it like an exchange account, you know. If I want to provide liquidity, I, you know, send some money into the exchange, and then I can, you know, place orders against any particular pair, and they'll, the trades will take place, and then I can settle that later and withdraw any of the assets that I have there. So the LBAPI has many of the same things, you know, like place order, cancel, order, modify order, that sort of thing, range orders as well as limit orders, you know, deposit,
Starting point is 00:25:40 withdraw, you know, all the same sort of API calls that you would make as a normal LP are available to you as well as, you know, lots of data feeds like, you know, you can also, the unique thing, though, is that you can subscribe to a list of incoming swaps. So, you know, it'll actually pull information off the state chain to say, okay, there is a big question. coin swap coming in this block, which is estimated to be around this sort of time at this size, so that you know, and then you can essentially automatically trigger a bid against that using whatever market-making software you happen to be using. So API, basically, in a rust-ridden wrapper, which is fun. Right, yeah, that's awesome. And I think, I guess one sort of complication,
Starting point is 00:26:31 I guess in this approach, at least like from what I understood, is that you don't really know in advance as the user how much slippage you're actually going to experience in the end your price. Can you talk a little bit about again why that is? I guess and how you're like sort of dealing with that or how does the user interaction look? Is it like basically like you give you some range of a price that can be expected or how do you treat that for a user. Yeah, I mean, it's a good question, right? Like, you can't just read the state of a
Starting point is 00:27:05 pool and then, you know, pull a price from it. But you can, the exact same thing is true for UDISw. You know, by the time your swap is included in a block and all of these transactions, so adding, removing liquidity, other swaps have taken place before yours gets executed. The state of the pool has changed. The prices that people quote, or not people, but these front ends quote, that you see across defy i actually have no bearing on the final price you get and they don't factor in things like m evi and uh you know uh price risk over a period of time or whatever the case may be you know there there is no such thing as a guaranteed price um with on chain trades it's just a reality unless you place um strict slippage limits which people don't do because um they want their swap
Starting point is 00:27:54 to go through so they set a 0.5 percent slippage limit or something like that And then you are essentially at risk of losing up to 0.5% of the money. But people don't seem to care about that as long as there is some sort of slippage limit, which is why, although I don't think this is really going to make any practical difference in 99.9% of cases, we are actually adding a feature now called fill or kill, which allows you to set a minimum price. So we'll actually simulate the swap on the chain at the moment of execution so that, we can make sure that if we are going to do a swap for you,
Starting point is 00:28:33 that it is at a certain minimum price that you're willing to accept. If not, we will revert it and send it back to wherever it came from. It does require a little bit more effort on the user side, and we can't do it in all cases, particularly where it's like we'll get into the cross-chain messaging and things like that. But if it's one hop along a string of swaps that's coming to or going, coming from or going to some other bridge, some of the chain, some of the decks.
Starting point is 00:29:00 It's very composable in that way. But if it is one step in a long string of steps, you know, we can't always guarantee that we can go backwards, right? We can't always send back the money because we don't necessarily know where it came from. We have an address, but it might be Binance or it might be a smart contract that you don't have control over or something like that. So, you know, there's a lot of edged cases that we have to handle here, which is why we didn't set slippage limits originally because that means you have to provide a refund address and you
Starting point is 00:29:28 have to provide an origin asset and things might get stuck. So we didn't do that, but we are adding that as a feature. So end users can have the confidence that if they send money into this thing, they are going to get a minimum price if they're willing to do the configuration step. Right. You mentioned there like it can go through some other bridges. Do you mean like are you also aggregating like other bridges or meaning like other like because everything is sort of within the cross chain chain flip protocol is all like bridging happening within that sort of validator set or are you also like using no no I mean I mean like reality is when we launch we're going to support like five pairs and people want to swap more than just five different assets right
Starting point is 00:30:15 um so as an integral part of our product where we partnered with squid um it came out to Axel originally. But that, so chainflip will be included in, in a route. But, you know, if I'm swapping from, I don't know, name, name something on a unyswap, die, right? We don't support die. Right. But uniswap does, right?
Starting point is 00:30:37 So we can, like, we can configure the entire route such that we do a die swap, then we ingress the USC, then we swap it to Bitcoin, right? but we don't we we don't control uniswap we can't revert back and we're not going to send it just back to uniswop um so yeah we expect that the majority of routes that we um are involved in are not chain flip end to end right there'll be some but unless it's like usd btc which actually could be the majority of the i don't know um but there'll be a lot of cases where um you know it either starts on some axelah supported that we don't support or it starts or ends in a decks that are not us, right? So we don't have full control over the whole route.
Starting point is 00:31:26 And as such, we have to build in all these different things to handle different edge cases depending on the situation. So it is quite complex. Luckily, for you as a user, this is all abstracted away and you don't have to think about this at all. We've done the hard work for you. Great. So you mentioned like it's five pairs.
Starting point is 00:31:44 I guess can you tell us like which ones it are? It feels like VTC, use these one, right? And then is the plan to basically expand that? And I guess for more, is that like a permissionless process of how pairs are added in? It can't be permissionless, unfortunately, just on the basis that if we're going to support a new chain, all of the validators have to connect to some node on, you know, whatever that chain happens to be. And also adding new pairs, everything is denominated in USD. which right now is only collateralized in USC,
Starting point is 00:32:21 although as an end user, you don't have to care about that. Again, we'll swap it to or from whatever you want, but all the LP positions are collateralized in USC to start with. So, yeah, that's for liquidity reasons, though. By constraining the possibilities, we make it much, much more efficient, right? By having only BTC USD and then ETH USD, it means that we've seen this play out in Uniswap so much,
Starting point is 00:32:48 Like the only pairs that are really there now are all back to USD in some way. Because it just means no matter where you start and where you end up, you're combining all of the liquidity for each of those assets in such a way where the end price is always better. So having a direct ETH BTC pair would just detract liquidity from all users. So yeah, this fragmented liquidity piece is a big problem. and permissionless pools are part of the problem. You know, there are some assets which have like, you know, six or seven copies of exactly the same market structure
Starting point is 00:33:27 where it's just not necessary, right? I don't know how many ETHUSD pools there are out there in the world, but there are too many. I can tell you that. And it makes things worse for users because what capital is out there is split across more pairs than is necessary. So, yeah. Right. And I guess these sort of like wrapped assets don't help much there either because...
Starting point is 00:33:51 Oh, they make things infinitely worse. Yeah. Right. Okay. Yeah, that makes sense. And then so yeah, let's dive back a bit into the whole like validator thing where I guess we mentioned the threshold signature scheme, but yeah, maybe you can expand how, what do the validators on chain flip do exactly and maybe also like, you know, how, you know, are new chains added in this world? Well, what do the validators do they do? Everything. It's a, I guess you'd say, it's an Oracle, Bridge, Dex.
Starting point is 00:34:28 It's not really an L1, but there is a blockchain that they also validate. Decentralized custody thing all rolled into one. So everything that I say that Chainflip does, the validators do it. So witnessing incoming deposits. So someone wants to make a swap. they create a deposit channel, the validators organize that. They then make that deposit and then it appears on the Ethereum blockchain or whatever. The validators observe that and then they have this consensus system where they agree that this has taken place, so kind of like an Oracle.
Starting point is 00:35:02 And then that triggers a follow-on action, which is usually a swap, which is then executed in the following block. And we have specific execution rules. so it's not an L1. You can't do whatever you want on this chain. There are, you can own, swaps are only triggered through deposits. So, you know, you can't sit there and submit a swap transaction. This is all automatically executed by the validator network. So this app chain environment that we've built works quite differently to what people are used to.
Starting point is 00:35:37 There's very few agent initiated actions. So on uniswap, to do a swap, you actually do the swap. You pay for the execution. You actually do the smart contract interaction. That's what you're signing. And then whether or not it follows the rules is how it's determined. But in this case, the validators are doing that execution automatically, which is very cool because it means we can automate a lot of stuff.
Starting point is 00:36:05 We can add a lot more bespoke rules around it. But it's all part of the consensus-driven process. And then once you're... end up with the asset on the other side, then the validators are going, okay, we now need to send this money somewhere. So they'll agree on what the transaction looks like. So how much gas we're going to pay where it's going to be sent to, how much we're sending all this kind of stuff. And then they'll get together and they'll do a threshold signing ceremony. So they'll use this massive Schnorr signature scheme, 100 of them at any time, 100 of 150 is the threshold.
Starting point is 00:36:38 And then they'll do a joint signing ceremony. It's the large. just decentralized custody network system, I think, in crypto. I could be wrong, but I can't find any other examples of this, especially at this scale. And that's pretty cool because then, you know, you have now produced a valid Bitcoin transaction or a valid Ethereum transaction, which one of the validators is then nominated to broadcast. If that fails, everyone has a copy of it so they can deploy it again and so on and so on. So they're doing everything. They're doing everything that a centralized exchange does all in one and altogether. You know, this is consensus driven, which is why it's taken as three years to develop, because the number of edge cases
Starting point is 00:37:21 that you have to deal with, and even simple things, for seemingly simple things like tracking gas and determining, you know, what the price is, you know, there's no human on the other end that can go, ah, shit, that was too low. I'm going to have to, you know, boost it now. Like that's not a thing. We can't really, I mean, we could do that, but this all has to be done completely automatically, all through a blockchain. So, you know, it really is like pretty cutting edge stuff. And we're not the only ones that have pulled it off. You know, Axelara's done parts of this. Thorchane's done a lot of this as well. But, yeah, it is, yeah, difficult to say the least. But, you know, we've been running test stats now for over two years. And you mentioned like 100 of 150. That's
Starting point is 00:38:04 that's because of like consensus thresholds like two thirds need to sign off on something. Exactly. So there's no point doing 150 of 150 because you only need 100, right? So to make it scalable, yeah, you pick the minimum size you randomly select from the group. And then if that fails, you retry with the second group within the 150 set. And that means like each of the validators needs to have like the same amount of stake or the same say, I guess. in the network, is that correct? Yeah, and I guess we'll talk about the auction soon and how that works.
Starting point is 00:38:37 But, yeah, essentially, you could describe it as proof of authority, but it's not really. There's a sort of bond level that everyone's bonded to in any given epoch. But yeah, exactly right. They have an equal share. They have an equal weight, I guess, just because of the nature of the threshold signature schemes. Right, so yeah, let's start actually with the auction. you write, like, again, we have 150 validators. They run all the networks.
Starting point is 00:39:07 Actually, that's maybe also a question. Is it like all the validators have to run all the networks, or can validators choose which ones? Yeah, they've all got to have the same endpoint connections. I mean, we could shard this out in some ways. There are ways we could re-architect it. But, you know, for now, you know, Axelor is able to have all their validators run 20 endpoints. So it doesn't really seem to be a huge limiting factor. So yeah, in order to be a validator, you need to have an endpoint available for all of these different chains.
Starting point is 00:39:37 Oftentimes, the best way to do that is to run your own node, but there are some networks where that's just completely impractical. Like running a Solana validator, for example, is, yeah, very, very expensive. So, yeah, we leave it up to the providers. You know, Thorchame, we're pretty big on forcing everyone to have their own light client or something of that nature, but that didn't really work. So then everyone ended up home to run a full node. but that's very expensive, very cumbersome, very painful. So then, you know, of course, validated operators being validated operas developed workarounds and then just ended up using, you know, in fewer or whatever for the equivalent thereof,
Starting point is 00:40:13 which is fine. You know, as long as there's diversity, it's really down at the end of the day, the validator operators themselves are on the hook. If they end up using a malicious endpoint, you know, they're probably, they're going to be in the minority. And as a result, they're going to get penalized for that. if it fails. So, yeah. Right. And I guess, you know, a bunch of the validators, depending on what sort of entities they are, probably already maybe running or Solana validator and might be able to use
Starting point is 00:40:41 that architecture. Exactly. Exactly right. Yeah. Okay. So again, I guess the difference here with this weight from people that maybe know like proof stake in other ways is like there's generally maybe like delegation and like different stake amounts. Now you guys have a bit of a different system because of, I guess, the limitations or the TESS, what that requires. And that's this auction, right? You need to essentially have, or can you explain actually how are the 150 validators that end up running the stuff chosen and like, you know, yeah, I guess the entire system that's Banda. Yeah. So this was a real challenge to come up with crypto economically.
Starting point is 00:41:27 Like there are some very specific constraints in place in the system that mean that, you know, it's just not going to work like other networks. There is a finite number of authorities or validators that can hold the keys because of scalability constraints. You can't wait those different shares either. They're all worth the same thing. So the question is, you know, how do you distribute, how do you make sure that the stake is distributed as evenly as possible across the set.
Starting point is 00:41:56 And what we developed in response to that is a system called simultaneous single round open Dutch auctions, which is a horrendous mouthful. But basically the idea is we have a rolling auction and the start is going to be every day, every 24 hours, but we're going to reduce that every 72 hours. And essentially what happens is the top 150 bidding validators are then selected and the lowest value uh the lowest staked value of that becomes the bond or the minimum
Starting point is 00:42:30 active bid is sometimes we sometimes refer to it so everyone is is committed to the same level of stake every auction and it's all determined based on the lowest bidder so even the the stake the required stake is evenly spread anything on top of that can be withdrawn and that's so we can enable you know dynamic rebalancing. So if I'm a validator operating, let's say I have three validators and the minimum stake is like 100,000 flip, let's say, or the bond ends up being 100,000 flip through this round of auctions, but two of my validators have like 150,000 and one of them has 100,000. I can now, you know, split off that excess stake, take that off the top and deploy it into a new validator, thereby increasing the amount of validators I have to four, and now I have
Starting point is 00:43:24 400,000 flip steak by I'm earning more rewards. So it's trying to encourage this natural redistribution across auction cycles, and it's trying to make sure that the level of stake provided within each validator is equal. So as the dynamics shift, you know, this will change two. There are also rewards for backup validators for those that are not successful in the auctions just to keep them around and there's a whole thing around that but i think this is um a really exciting component of of the protocol actually and particularly around the flip staking dynamics as well we also have a liquid staking product that's been developed on top by a company called thunderhead st flip so you know if you're not a validate operator directly um you know you you can you can
Starting point is 00:44:10 you can just go to them and they'll do this rebalancing for you across their providers So, you know, from an end-user perspective, for a flip-holders perspective, this may not be that crazy relevant. But, you know, we've had to develop it in this particular way in order to, yeah, overcome some of the requirements that arise as a result of having this decentralized custody system with this equal weighted shares across each of the validators. Like, you know, the people ask me sometimes like, oh, why aren't you a parochain? You know, you have the substrate thing. like why well like yeah we could be a para chain but then we'd be paying for security that doesn't really help us because you know securing our blockchain and securing the extrinsics in that one thing but these guys are holding key shares to vault with millions of dollars in them that
Starting point is 00:44:59 you know are not held on on our blockchain they're actually held externally so you know adding a dish like that's the most vulnerable part economically um of the system and so everything has to be oriented around that. But I think the auction dynamics be quite exciting because the stake will probably start out low. There probably won't be 150 bidding validators in the first rounds of auctions. So it'll be really easy to get in and like earn rewards and stuff. But then it'll like slowly scale up as more rounds are conducted. So I'm really excited to see that play out with the main net launch coming up very soon. Right. Yeah. Yeah. It sounds super interesting like novel sort of mechanism. I think yeah, what I'm wondering, I think there's a similar thing a little bit on sui that I'm aware of where the validator sort of bid on the minimum gas price for the epoch, which also like kind of means the validator has to like do this extra step that they generally maybe don't do like on top of like just running the software and validating transactions, like actually actively sort of submitting some sort of bid for something that is I guess in the sui case for the gas based on their hardware cost, which is also already like.
Starting point is 00:46:10 you know, how do you actually measure that? I feel like the space maybe not at that point yet, but can you maybe explain in the chain flip case how, like what are the like parameters that the validators take to kind of make a bit or like how much, how do they determine how much stake they should bid? Is that based on like the competition or the expected rewards that come from flip staking or, you know,
Starting point is 00:46:38 how do you actually set this value? as a validator. Yeah, I mean, it's, it's purely down to market dynamics. So it's purely down to the appetite of other validator operators, right? So if there's, you know, 150 validators, but they're all only staking a thousand flip, then they have no reason to stake more than a thousand flip. But because of the rewards, you know, there's obviously an economic equation that comes into this, which is okay, you know, if I stake a thousand flip, my APY is going to be like a thousand percent. And so you can imagine that, you know, a lot of people are going to then go, well, I'd be crazy not the stake. So, you know, you have this market dynamics system whereby
Starting point is 00:47:20 at some point there'll be some equilibrium that's reached where the level of reward is, reaches the level of, essentially the level of stake. So, you know, if my APY is, you know, effectively 10% and that equates to for arguments say like a thousand dollars a year it won't be that I don't know what it's going to be but let's say it is right but I'm spending a thousand dollars a year and running this thing anyway while I mean I'm not making any money so I'm not going to bid anymore and if I get dropped I don't really care so then the stake comes down to account for that like just through natural auction dynamics people will leave the network and then the stake will come down, the API will go up. And so, you know, there's this constant rebalancing that's taking
Starting point is 00:48:07 place which trades off operational costs versus the revenue that's coming in versus the value of the collateral, it's perceived future value and all these kind of equations that each individual validator operator is going to make. But from an auction dynamic perspective, you know, that means that we're always going to be at a level of collateralization that across the validator set trades off all of these different factors. So hopefully this is a set and forget thing for us as protocol developers. You know, this is a system that we've developed that we think will mean that we never have to touch it. There won't have to be a discussion about raising or lowering things unless it's sort of a central government, central bank kind of situation, right,
Starting point is 00:48:53 like where you control interest rates and then that has knock on effects, which affects people's economic behavior. So we could increase or decrease the level of emissions that are being paid to validate. That's the one lever that we can sort of adjust to influence the auction dynamics there. So if we increase it, the APY is going to jump up and then people might want to stake more. And then, you know, that will lead to a higher level of staking, at least in terms of flip. Vice versa. If we reduce the level of emission, then there won't be as much reward.
Starting point is 00:49:28 which may cause people to drop off, which then may in turn lead to a decreasing stake. So, yeah, token economically, I think it's pretty interesting. But, you know, I'm a nerd, so I don't know. No, no, it's great. Yeah. And this sort of governance decisions, like, can you maybe actually talk a bit about how these are made?
Starting point is 00:49:51 It's just like token voting from flip holders or, you know, what system? Yeah, that could be a thing. at the moment the way we've got it set up is we kind of have a governance council which right now is chain flip labs and i hope it will continue to be in that way for some time but we have token weighted voting in a in place to change the governance council if it's a elected new government basically you could you could think of it as but you know obviously you know like any blockchain developer we do all this in consultation with the community and the stakeholders and the valetian and the LPs and everyone who's using the system. Because ultimately, you know, that's that that's where the value is being driven. That's where all the stakeholders are. So we're not going to do anything that we think will be, you know, existentially bad, hopefully.
Starting point is 00:50:43 But there is, there are options, the nuclear option for the community to get rid of us, if that's what's needed. But yeah, when you're running your own blockchain network, like it's not that there's really no, it's not worth pretending that there is another way of doing it. Because, like, this is all connected to the validated software and someone's going to publish that. Someone's going to sign that, you know, at the end of the day, you know, whoever is running the development process, someone has authority, at the ultimate authority, including Bitcoin. You know, there are no networks where this doesn't apply. If you're running on a smart contract on someone
Starting point is 00:51:21 else's network, okay, that's a different story. But that's not the situation here. So any independent network, any network for that matter, has a similar dynamic. So yeah, in the future, you know, we could definitely develop like a token weighted governance. I mean, the governance palette that ships with substrate has a lot of this in place already. But it would have to then be linked back to all of the specific functionality that we're voting on. So to even do a vote, the developer would have to create the hooks in order to decide between different outcomes for the token weighted voting to even make sense. So, yeah, it's governance is an interesting one, but yeah, I think overall, you know, the reality is, is that chain flip labs is going to be
Starting point is 00:52:08 leading the way, especially early on. But yeah, we don't exercise any utilateral control over the network or the people that run it or anything like that. So, you know, we don't, we don't hold anyone's money, which is very important. But, yeah, from a governance, perspective, you know, we're really going to be trying our best to iterate quickly, especially in the opening first few years, because, you know, we don't, no one really knows how this is going to play out, whether or not the settings that we said at the start were right or not. And, you know, so we have to, yeah, adapt based on what we see, I guess. Yeah, yeah, you know, that makes perfect sense to me.
Starting point is 00:52:48 I guess you can also, like, signaling proposals or something, I guess, because also flip, as I understand is that ERC20 on Ethereum also, right? So you could even use snapshot or whatnot, right? So I guess there's a lot of ways to at least somehow involve. I mean, yeah, government is a whole topic that is quite complex. So we don't need to like dive much deeper. But yeah, that's helpful for understanding. So maybe also like one more thing there is we were talking a bit about how new networks
Starting point is 00:53:17 are at it. And that's then basically like chain flip or like the labs team in discussion. with the validators or this decides like a new network that should be added and then it will be added to the software and from then on all the validators need to run that additional clients. Yeah, from a certain point, yeah, there'll be a release like a consultation period, then there'll be a release which enables them to add it and then at some point there'll be a switchover which is triggered with an on-chain governance extrinsic. But, you know, if we were to just decide, oh, we're listing like coin tomorrow and then
Starting point is 00:53:53 no one's actually added it and we don't run the runtime upgrade and nothing's happened, then the whole thing just stops. So, you know, we can't, we can't just do whatever we want. It doesn't work that way. We have to work in concert with the whole validated network. So we talk a lot about like the system of chainflip, but obviously you've been working on it for the last three years, maybe to slowly wrap things up. We can we, we can talk a little bit about, you know, where you are at right now, the roadmap. Maybe also do what future use cases you could imagine like chain flip network being being used for. I guess, yeah, let's let's get to that.
Starting point is 00:54:35 So maybe we start with, you know, when mainnet and, you know. Well, just between you and me and I guess everyone listening, which is not very secret, I suppose, but we have already conducted a stealthy mainnet sort of soft launch. we're not going to use the network that we did that with but we you know just wanted to sanity check all of our work and make sure that what is working on test net right now which you can go check out live at any time is you know makes sense on main net and you know things like gas estimations and all that work out and it worked so we did find a couple things but you know we are we are very much there now after three god damn yes we're it's fine finally putting it out um
Starting point is 00:55:21 We have a loose TGE date. So the main net is going to be live in the next two weeks, but it won't really be live because it won't be public, because no one will be out of stake to it or do anything like that because they haven't got the tokens to do it. So the actual token distribution, go live date, everything, auctions beginning, all that kind of stuff. So far, it's been slated for November 8th.
Starting point is 00:55:42 I hope that date holds, and by the time this goes out that may have changed, maybe not, we'll see. Launchers like this are always a moving target. You know, there's a lot of things to consider, you know, both with main net operational concerns, but then also commercial concerns as well with exchanges, custodian, so on and so on and so on, which we've been working very hard on as well. But, yeah, finally, that item on the roadmap ticked off, boom, hopefully by the time you listen to this,
Starting point is 00:56:10 it'll already be live. Then straight after that, we have a period where we need to allow the validators to collateralize the network. So as I alluded to before, you know, starting at a stake of zero, we have like just three boot nodes basically that don't really have much of a stake. You know, that needs to grow to 150 validators with a fairly significant stake in order for us to be able to safely deposit liquidity into the system for it to be secured. So we're leaving it running for a few weeks. We don't know exactly when that's going to be yet. We probably need to see what happens in the first couple weeks to be able to lock in a date for swapping to go online. because, you know, we don't want to ask LPs to be throwing millions of dollars into
Starting point is 00:56:52 liquidity pools if there's, like, you know, only 10 valenaders or something crazy like that. So I don't think that's going to happen, but, you know, we have to, we don't want to ask people to do anything crazy like that. So, yeah, the idea is hopefully by the end of November, which is rapidly approaching as winter sets in. Time is accelerating, thank God, get through this cold spell. but yeah the swapping itself will go live LPs will be able to make deposits
Starting point is 00:57:23 users will be able to make swaps will be live and squid router from day one so you know a complete anti-end user experience will be there also got several other wallet and aggregator integrations as well in various stages of development and so yeah hopefully we'll be able to generate you know some of that early volume and hopefully the whole thing will make sense
Starting point is 00:57:46 economically from end to end it might not but um you know that's uh that's the nature of the business you know you got a got to be in it to win it so um yeah in terms of follow-on roadmap stuff we've got a bunch of new features that we're going to bring out uh before christmas um and then into the new year as well including new blockchains um new features to make swapping faster make it cheaper make it better make it more competitive in the aggregator market you know and uh you know things like this fill kill feature that I talked about before as well. Yeah, we've got something in the works with, in regards with the USDC and cross-chain transfer
Starting point is 00:58:27 protocol by Circle themselves, which allow for seamless liquidity rebalancing across a lot of different blockchains, which will be very, very cool. Again, a part of that efficiency piece, making sure we're not fragment. We don't have like a USDC, USDC pool on like two different chains because, like, why? Why would you do that if you don't have to? You're just wasting US dollars that could be deployed to fill actual swaps, like swap swaps, you know. So, yeah, the roadmap is endless. You know, there is so many things that can be done in this vertical to improve it for users,
Starting point is 00:59:00 be that more chains, more assets, making the swaps faster, making them cheaper, and so on. But, you know, you asked before, what else could the chain flip network be used for? and the answer is nothing. We do this. A lot of projects like try to sell you the world, you know, this is the interoperability solution. It can do all of the things.
Starting point is 00:59:25 And yes, we have cross-chain messaging, but that's only so we can make the swaps compatible with aggregation. We only do swaps. We only do native cross-chain swaps. We spend three years on it, and we have a feature list a mile long to make that better.
Starting point is 00:59:41 So, you know, you won't see us doing a lending product. You won't see us doing some sort of yield farming thing, although we can do like liquidity programs and stuff, but it's all in service of cross-chain native swaps. That is our vertical and we are staying well within that. You could use this architecture. If you were to like go away and re-engineer it, you could maybe use it for other things as well.
Starting point is 01:00:04 Some sort of cross-chain lending protocol. You could build a derivative platform that settles on all these different chains and stuff. But there's already a bunch of protocols that do that, you know. This has been specifically engineered so you can go swap half a million dollars in Bitcoin in a completely decentralized fashion in under a minute with zero slippage. I mean, if that's not cool enough for you, I don't know what is, Felix. I'm really sorry, but I can't help you. Nice, yeah, that's a great pitch.
Starting point is 01:00:33 And I'm very excited to see your work of the last three years go live soon. So we're recording this October 12. I think we're actually going to release this quite soon, so it might be that it's live before the RH life. Maybe we can hold out a bit and release it with the actual launch. It would be great. But yeah, thanks so much for expanding.
Starting point is 01:00:53 I do think, right, that focus is key. I think one thing that I also learned over the last five years in crypto is that, you know, yeah, sometimes projects maybe that haven't received, they gotten the traction with their, like, core thing, try to sell you everything else in the like attempt to like sort of stay relevant or sort of find something that has PMF, but maybe it's, maybe it's better to like stay focused on the one thing.
Starting point is 01:01:17 And especially if that has traction, double down on it. I mean, yeah, Uniswap being maybe one example for that or also the IDX, which like sort of awkward there. I mean, I've experienced personally as well with Session. I mean, you know, in the first two years, it was, it was not good. You know, the adoption was not good, but the app was also not very good. but we didn't give up you know we kept working at it and now
Starting point is 01:01:41 you know we're experiencing month on month downloads growth consistently without spending any money on marketing you know so finding product market fit i think people have very short term expectations in this industry you know it's either pops off now or it's it's dead but if you that is true for a lot of things which are sort of don't really have strong fundamentals
Starting point is 01:02:04 but for something like this where you know, people are swapping billions of dollars of Bitcoin every day and we're developing a unique venue for it, it may take time. It may take, you know, several months, several years before, you know, this achieves some of product market fit. I don't think so. I think I'm going to market strategy is good, but, you know, I've experienced personally that if you believe in the fundamentals of the product vertical that you're operating within and you're willing to be able to adapt your thesis and adapt to the market as you go. live, I think that, yeah, sticking to a vertical is absolutely the way forward for many teams
Starting point is 01:02:43 at this point in this level of maturity that we've achieved in the crypto space over the last decade. Awesome, Simon. Thanks so much for coming on today. And yeah, we'll link a bunch of the documentation and stuff in the show notes. And yeah, glad to see Chainflip Live soon. And thanks so much again. Let's have it goes well.
Starting point is 01:03:02 Thanks so much, Felix. Thank you for joining us on this week's episode. We release new episodes every week. You can find and subscribe to the show on iTunes, Spotify, YouTube, SoundCloud, or wherever you listen to podcasts. And if you have a Google Home or Alexa device, you can tell it to listen to the latest episode of the Epicenter podcast. Go to epicenter.tv slash subscribe for a full list of places where you can watch and listen.
Starting point is 01:03:27 And while you're there, be sure to sign up for the newsletter, so you get new episodes in your inbox as they're released. If you want to interact with us, guests or other podcast listeners, you can follow us on Twitter. And please leave us a review on iTunes. It helps people find the show, and we're always happy to read them. So thanks so much, and we look forward to being back next week.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.