# Improving the Federated 2-way Peg by Matt Luongo (Devcon5)

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2020-10-09
- Duration: 12:09
- Topics: blockchain, smart contracts, distributed ledger, ethereum
- Watch: https://streameth.org/watch/yt-NHTuLnrDaUA
- YouTube: https://www.youtube.com/watch?v=NHTuLnrDaUA

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more.
https://archive.devcon.org/archive/watch/5/improving-the-federated-2-way-peg-a-new-sidechain-design-for-trustless-bridges-on-ethereum

In this talk, we'll introduce a novel mechanism to maintain 2-way pegs, as well an initial implementation of a Bitcoin peg on Ethereum.
## Problem
Bitcoin's stable codebase is a strength. Developers are loathe to introduce significant changes, reasoning that a store of value should prioritize stable operation.
While this cemented Bitcoin's place in the market, we all know the costs- Bitcoin's ossification at the expense of public experimentation and diverse use cases.
In 2014, the answer to this problem was "sidechains". Trustless sidechains are the ultimate vaporware- and since 2014 the goalposts have moved.
## Approaches
Blockstream's Liquid touted itself as the "first production sidechain", built on a multi-sig federation. No hashpower validates the sidechain-- funds are fully trusted to 15 Bitcoin multi-sig participants.
BitGo's WBTC takes a similar tact-- but instead of building a new chain, custodians operate on Ethereum. Neat! Unfortunately, they require KYC :(
These centralized projects have a few custodians that can be convinced by governments-- or their own interests-- to censor or seize funds.
## Design
We propose a new approach-- the *bonded, multi-federated peg*. We believe this is the best candidate for a sufficiently trust-minimized alternative, unlocking Bitcoin for use in DeFi.

Speaker(s): Matt Luongo
Skill level: Intermediate
Track: Execution layer
Keywords: technical

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 5 was held in Osaka, Japan on Oct 8 - 11, 2019.
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

hi I'm not I founded a Bitcoin company in 2014 been doing this for a little bit got into aetherium early 2017 and I want to talk to you about a project called TBD see where we're bridging Bitcoin in aetherium it we're doing this in collaboration with what we're calling the cross chain group James press which Summa and a couple other folks so why are we all here I know some of us came for the unstoppable code some of us came for the world computer but the latest meme is D Phi so D Phi is around a half billion dollar market give or take the last month's market gyrations and there's this like I think we're excited there's a new there's a new narrative but I guess my question is is is d Phi growing and as D Phi as exciting as we think because when you look at half a billion dollars and you compare it to again these are old numbers the 24 billion dollar market cap for ether you start to realize maybe we're actually going to hit a ceiling soon and so when you look at projects like maker you look at other the other projects that are limited by collateral we're all kind of thinking how how can we get access to more value on this chain up to do more define so some people are interested in security tokens or real estate I'm not I'm interested in trustless assets so for me the next obvious pool of collateral is Bitcoin which is a little bit bigger than than the other two so one way to frame this discussion is how can we bring defy to Bitcoin that's a little paternalistic I think a lot of big corners who may or may not be watching this would be like Bitcoin doesn't need Defy but another way to look at it is you know Bitcoin was was the first defy be run bank now we have cash how can we get loans so I actually went to buy a house recently and I knew okay my most of my life's work is crypto this is going to be an interesting experience and so I started looking for what Lindner could help me out and keep me from having to sell my crypto so I finally found someone I got really excited and so I talked to this mortgage provider and they were like oh yeah we're totally crypto friendly we're so glad that you came to us and so I said cool what do I do and I said sell your crypto just sell it and come back in 30 days we'll pretend like we didn't have this conversation and then you can buy a house no so well you know one way is how can we bring one way to look at this is how do we decentralize finance with Bitcoin another is how can we make Bitcoin available everywhere so aetherium has this opportunity to be an interrupt to bring assets on to the chain to work with defy today how can we make Bitcoin one of those assets but you know for the engineers in the room also just like wind side chains so we've been talking about side chains and interrupts since at least 2014 probably earlier and so far they've been for the most part vaporware a bunch of El ones right now are working on bringing out something new but it would just be really intellectually satisfying to see a side chain between Bitcoin and aetherium today so people have been trying to solve this problem mostly through hacks so the first big hack that people have used our Federation's if you guys are familiar with WBT see in the etherium space liquid in the Bitcoin space and the basic idea behind a federation is that you have a bunch of folks that come together you trust them they hold your Bitcoin and then you know they'll they'll validate somewhere else so what's great about Federation's you get your price exposure that defy is so interested in and you have a super simple implementation okay so anyone in this room I imagine who has touch solidity before could create something similar to W BTC today which is great so why are we here so the reason that I joined crypto was to own my own money I don't know if you guys saw Taylor's talk from my crypto the other day but it was a little bit about back to basics why are we all here we're here for individual ownership consent and sovereignty and the second you take a peg a Federation based peg that's that's trustful you've lost that so you've lost seizure resistance you've lost you've lost any sort of like trust nests of this system so the other big approach the people are using to get price exposure on aetherium their synthetics basic idea you guys are probably familiar as we lock up a bunch of eath and then there's some sort of algorithm does something with it so that you peg a price to an external asset so synthetics are great there's censorship resistant so for example if you have like something that's pegged to a stock on aetherium you can be confident that that's not going to be seized from you you get your price exposure and of course there are downsides so there are two that I see so one is is just that it's dangerous the more synthetics you stack the more FX risk you stack and the more of a chance of like a Black Swan event happening through all of our defy systems so if I asked you guys how much eath would you be willing to lock up to be confident that that amount was going to be more than one Bitcoin in six months I think we would all have different opinions on what that is it's it's a difficult problem and then the other thing with synthetics is you can't redeem them for Bitcoin so if I'm trying to convince my my Bitcoin friends from from the earlier earlier 2010s to use a system like this they're not interested in any attack synthetics they want to know they're using Bitcoin on aetherium so what's my desire what do I really want that I'm not getting from these two systems I'd like a censorship resistant fully Bitcoin backed ERC 20 token so no trust no kyc confident that any attacker is going to lose money and that you can always get back to your Bitcoin how so before I dive into the sidechain mechanism I'm actually going to give you guys a super quick demo what we got so far just to kind of like make it concrete the way that we've piled up these videos we'll see how it goes so this is T BTC it's a pretty straightforward app experience it's actually a cross aetherium and bitcoin dap you open up a deposit here you you fetch a BTC address so you actually get someone off chain to give you a public key hatch and then you pay one BTC you can use any wallet in this example we use green wallet it's I guess not any wallet it is seg wit we would rather not stick with legacy BTC and once this confirms I'm pretty sure I see there we go good you don't have to wait on the full 10 minute confirmation for this particular video you submit an SP V proof to the etherium chain showing that you made a Bitcoin deposit and it's actually safe for for us to mint tea BTC on the etherium side voila so what's the idea behind that we're calling it a bonded multi federated peg which is a whole bunch of words relative to a pretty simple demo the idea is that side chains have talked about this two-way peg for years there are a lot of problems with Federation's that I've already talked about so how can we fix them at one you can actually watch the Bitcoin chain too you should not trust entire economies to 11 of 15 multi 6 and 3 if you're going to have to trust someone get them to put down a deposit first so going into that in a little bit more detail in T BTC every Bitcoin that is deposited has a new dynamic Federation that's been created so we actually have our own random beacon that we built on aetherium and that is then going to sample validators and they're going to come together and they're gonna create a new wallet to bond all the Federation members obviously you guys know what we're gonna do with the bond but the basic idea is make sure everyone has skin in the game before you accept them as a validator read Bitcoin history so again if you're familiar with solidity obviously we're not really reading Bitcoin history what I mean is someone off chain is providing SPV proofs from the Bitcoin chain to aetherium and then finally what are we gonna do with that bond so if someone misbehaves we slash but typically when you're talking about slashing at the consensus level you just want to like burn it to the ground right you don't want that token to exist anymore and you want the person who misbehave to feel it but here slashings not just punitive we actually use the funds that are slashed to make sure that that the peg is hole so if someone does misbehave in a system like this not only do we take their money we take their money we use that to buy bhakti BTC and maintain the supply pack so I don't have a slide for this going off script a little bit but what do we need here we obviously we need a price feed so originally the the v1 spec of TB TC just has a centralized price feed it's even simpler than makers makers v1 median Iser right and I put that out and I knew I felt bad as a system designer we were all unhappy but you know we wanted to get the main that faster but it was a lightning rod for Bitcoin depositors they just could not stand the idea of a centralized price feed so since then I don't know if you guys were around a couple days ago on floor 6 we've actually been whiteboarding a decentralized price feed alternative we're calling it feed list feeds so interested excited really to share a little bit more with you guys about that but I'm not going to go too far into it now so the other question that this brings forward is collateral so there's a a 2.5 x collateral requirement for this naively I say 2.5 because I wanted to be honest and choose the big number but if you think about it it's really more like 1.5 X collateral because there's liquidity on the etherium side but actually through some cleverness and by allowing the Bitcoin depositors to collateralize against each other you can get it down closer to a 1.4 total collateral so some takeaways from this it is expensive to run it's more expensive than getting GOx t' or sorry less expensive thing getting Cox Cox is very expensive and it should be good for youth as well we are still walking up eath and we do fall back to a synthetic in the case of misbehavior so you know it's Def Con they're devs here I want to invite you guys to check out TBT seed Network if you are interested in building gaps on Bitcoin if you're interested in using Bitcoin is collateral and your defy project please come talk to me talk to James pres rich or one of these other guys who are all kind of involved with this project it's gonna be sweet and thanks a lot my name's Matt Longo you can follow up a little bit more with the cross chain group as well so we've got three minutes guys if anyone has any questions around t v-- TC i'm happy to give you guys some more details ok guys well that's everything I've got so thanks a lot looking forward to talking to you after
