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

Loading player…

Improving CEXes with payment channels Using Layer2 tech to address fraud with Kamen Angelov

Ethereum DenverMon, Oct 9, 2023, 12:00 AM

With the recent collapse of yet another centralized exchange, there is a clear need to improve the opaque, custodial nature of CEXes. We describe how this can be done using Layer2 tech (payment channels) without sacficing their advantages over DEXes. We describe the architecture of such a system using the Kchannels payment channel system as well as the additional software that would need to be built. Kamen Angelov Chief Architect Kchannels Maurycy Pietrzak Co-founder Kchannels I am a cofounder of the Kchannels project. I was previously cofounder of Infura. https://twitter.com/maurycy

Transcript

uh my name is Kamen Angelov I'm the co-founder of a project called K channels um don't worry if you haven't heard about it don't worry if you haven't heard about it um I will give you a question introduction in a few minutes I'm going to be talking about improving exchanges with a payment Channel Tech now uh this is going to be a slightly different presentation from perhaps what we're used to this is a technical architect's perspective right I'm going to start with a high level overview of exchanges in the business domain so this is going to look very obvious until suddenly it isn't I'm going to be talking about what an ideal solution looks like for exchanges from different perspectives and and start talking about how we're going to be solving these problems with uh the channels all right okay show of hands how many guys know what this yellow circle is at the top how many of you have seen it no one really [Music] okay so uh this is uh the talk of ADM this is an architecture for develop sorry this is a framework for developing architectures which I sometimes used and I'm going to use it to just do the business analysis don't worry I'm not going photograph on you all right so um what are we doing here we are building a system to take one token and uh exchange it for another I have identified three separate actors which I'm going to call stakeholders you have your Trader who is your typical user looking to exchange a token their use of the system and their view of the system is very transactional it's a means to an end then you have your liquidity provider that is your investment type actor yeah looking to uh basically increase their Holdings they put us it in and look for returns and then you have your broker this is your typical business owner right they're looking to bring their users together and render services to them for um for a fee some of which they get to keep us profits now I have collected I have I have boiled everything down to uh five concerns these stakeholders have now um the asterisk State stand for um a loaded term I I think it's pretty obvious what those uh what is being packed in there I'm not going to unpack it so you have a Trader who is interested in convenient access access like an ATM they want to come in do their thing and move on with their day they are very keenly interested in the cost of their services everything being equal they're going to go for the least expensive one to them they have limited exposure to safety of assets basically limited to making sure the exchange happens as they expect the liquidity provider who is very very keenly aware of keenly interested in safety of assets they carry significant balances they want to make sure they're safe and they want to make sure they get payouts in exchange for participating their exposure to convenience of services is limited they in general will be willing to jump through some hoops to access the system you have a broker who is obviously interested in all of these because they have to provide those things and in addition I want to make sure this business is profitable so cost of doing business now um uh Pop Quiz everybody how many of you think how many of you think security falls under safety of assets shotguns all right how many of you thinks it's false on the cost of doing business show of hands well um here's the thing security is a technical term it is not well defined in a business domain it's sort of Falls between those two so what I'm going to do is discuss security in terms of those two concerns going forward all right which leads me to another important point we as Engineers like to look at the system and we look for and value certain things in it but our business users in general have slightly different perspective on that they look and value slightly different things and even when there is an overlap it's typically not for the same reasons so what I want to point out here is don't get stuck on the technology where users choose try to understand what's happening from their perspective now um stakeholder concerns are very conflicting this is going to become apparent very shortly all right all right so uh what common issues we have identified for exchanges today you have a safety of assets and operator fraud your security concerns the former impacts liquidity provider and a lot impacts all users lastly we have availability and accessibility of the exchange which mostly impacts Traders now we just got an entire presentation on security so I'm not going to really go into uh what those translate to and I'm going to explain availability and accessibility in a minute this became very apparent when we had high gas fees you will see it playing out in a minute ideal solution I'm going to be explaining what the system looks like for each of your actors what the ideal system looks like for each of your actors and it's very different for each one so a Trader wants to see a system which is where they are wherever that is it is uh on whatever side chain or level two they ended up being and they want to be able to use it quickly and cheaply and it must have very predictable Behavior regardless of external factors such as liquidity underlying technology basically it just has to work then you have your liquidity provider who is interested in increasing their Holdings you have they're looking for a strong guarantee A system that gives them strong guarantee of their assets while paying out decent dividends and of course they are willing to jump through some hoops to get that for example they might be willing to bridge to another chain which offers similar safety of the liquidity finally you have your broker which has the anonymous task to keep everybody happy while still being profitable now that's a very tall order how are we going to do that you see making anyone actor happy too happy makes everybody else very unhappy and you don't have a system right so how do you find balance so um we're going to be talking about how payment channels can improve things but first let's talk about what they are this is this has gone a long way in the last couple of years it is basically a special time of system which is bound by rules those rules are enforceable on the blockchain but the payment Channel itself is not held back by its technology it actually does not use the same technology so basically it can do whatever it wants as long as that is answerable on the blockchain and can be uh challenged on the blockchain so um what does that mean well we have this cool little opportunity to create a very very different user experience for the blockchain as long as we're still answerable to it we're good now uh typical properties are fast finality High throughput transactions you have very low cost for transaction it's still translucent non-custodial because you can challenge on the blockchain and it has this neat property to span and Bridge chains all right let's start looking into that very closely a payment Channel doesn't have to establish Global total order of transactions think about it in a blockchain you are establishing a global total order of transactions not just how what transactions you have but in what order that's a very strong consensus right and that's a very expensive consensus however with a payment Channel you don't have to do that every channel can set its own order its own local order as long as causality is maintained of course this means that transactions can happen in parallel this means that throughput is not a limited commodity anymore this is the perfect transaction engine observation too um what we call a transaction can suddenly look very different it just has to be answered on the blockchain right so this is going to become very important in a minute let's put a pin on it ah one downside is the payment channels at least today cannot run code trustlessly so well in fact you can build a some something over the top to run code it's not going to be trustless now here's a very important observation as l1s attract traffic gas fees is increase gas fees increase and your Traders get priced out they tend to flee to the periphery side chains ltus wherever the gas Visa the transaction fees are low liquidity providers on the other hand they go in the exact opposite direction they are looking for safety of assets so they're going to go to the more established chains right and if you happen to be a broker in this environment you're having a really bad day because your your Traders and your liquidity providers are now moving in opposite direction and you can no longer bring them together to provide services to all right I'm going to discuss a possible k-channel solution it's not by any means the only one possible others and I'm not even claiming it's the best one it's just a solution but first a crash introduction to K channels itself um how many of you have heard of K channels before today no one okay crash introduction credit channels is designed to emulate the great user experience of a traditional payment system from day one while still maintaining all the goodness from payment channels more traditional payment channels such as trustlessness and non-custodialists with assets it is service in the cloud layer 2 system in the cloud there is nothing to download you don't need to watch a blockchain you just call an API and sign messages if you can do that you can you can participate in K channels this is very much how traditional payments work by the way it goes to Great lines to eliminate points of friction in movement and assets of Assets in and out of the system typically deposits and withdrawals happen at the speed of genderly blockchain and go right against an open Channel you don't have to stop close down your channel in order to withdraw typically a deposit and withdrawal happens between one and two minutes depending on the speed of the underlying blockchain see pop up like that now um K channels very easily spans multiple blockchains right now we're spanning four we can add more if there is interest it has a very low and flexible fees well beyond anything offered by any other solution today because as mentioned it is non-custodial with assets but most importantly it has a very strong instant finality once you see the transaction complete that's it there is no callback what you get what you see you get you can withdraw it immediately if you like it is of course trustless via dispute process and you don't need a balance to open a channel you don't need to pay fees to open a Channel or to keep it open all right a possible solution what are we going to do well well our liquidity providers like being on L1 because that's where the assets are best guaranteed so let's just leave them there we're going to set up this looks horrible we're going to set up liquidity pools on all the chains that we spun and just have them deposit their funds in there Equity providers do not talk to anyone other than daily quality pools which they're comfortable with then you have a broker the broker comes along purchases funds with its purchases assets with its own funds and deposits them in 2K channels now this is frictionless it takes a couple of minutes and they can do that continuously they can bring Assets in to address um the next little while of projected exchanges do what they need to do then return the excess and bring more in and of course this happens for a convenience markup which amortizes this happens in bulk and with a convenience markup which amortizes uh the gas fees they have to pay now here's the secret sauce what we call transaction in a payment Channel is fluid as long as it's answerable on chain it can be anything I can for example I don't know maybe allow transactions to move Assets in both directions well such a transaction will have to be approved on both sides but given that's the case what have we just done we have created trustless Eastern exchanges right on L2 protocol level right what this means is that Traders doesn't need to trust Brokers anymore or vice versa nobody has to front asset to the other a transaction either happens it happens exactly as a great in its entirety or not at all so with that little property Brokers can start rendering near instant trustless services to Traders right where they are L2 where the gas where the transaction fees are very very low and they have very frictionless in and out with multiple ecosystems what about fraud well what about fraud liquidity providers only ever stay on L1 they don't even talk to K channels they are working with liquidity pools which are which are well known and enforce rules those rules extend to to Layer Two and the extent to Layer Two because Brokers you have to realize their gains by uh trading for those liquidity pools on L1 so an honest broker will see the liquidity gradually increase go up which allows you to maintain higher L2 balances and operate at a higher profit margins as they don't have to move assets as frequently a dishonest broker simply runs out of liquidity and stops functioning all together without hurting anyone else okay so now we have this virtual cycle here a broker is very well incentivized to be honest so at no point there's at no point do Traders and Brokers trust each other the way transactions happen makes that unnecessary furthermore Brokers don't need to be executed in a trustless fashion anymore since everything is known up front and it either happens in its entirety or not at all furthermore nobody has to trust K channels either because the only two impacted actors Traders and Brokers can simply go back to L1 challenge the system and withdraw their funds worst case scenario they just lose for the use of the system and they can recover all their assets by a sequence of signed proofs so in conclusion it is in fact possible to build a viable exchange on top of a payment Channel and at least in case for exchanges that results in a significant Improvement of of a more traditional L1 counterparts it has great user experience all around all users are met right where they want to be it is cheap and convenient it is cheap and convenient for Traders significantly improving on the status quo and liquidity is protected at all points in time and of course while trustless execution is still not possible I did not solve that problem sadly it is not required in this case by a sequence of strong guarantees on protocol level thank you very much foreign

Automatic transcript — names and jargon may be misspelled.