Securing the Cosmos with Bitcoin PoW – Fisher Yu of Babylon

5 Oct 2022 · 24:07

Fisher Yu of Babylon joins Sebastien Couture on The Interop to explain how the project uses Bitcoin's proof-of-work as a security layer for Cosmos chains. The conversation covers Babylon's architecture, Bitcoin checkpoints and light clients, the tradeoffs between BLS and threshold signatures, and the project's roadmap for shortening unbonding periods.

Speakers

Topics

Transcript

the unbounding period could be slashed from 21 days to just a few hours to just a few hours yeah just a few hours all right [Music] I'm here at Cosmo verse and this is the last day and I met up with Fisher from Babylon hi and I wanted to talk to you because I think what you're building is

really cool it really as you describe it kind of makes the best of both worlds between uh Bitcoin consensus and proof of stake if you like these videos please make sure to subscribe and hit the notification Bell to get notified when we put out new interviews um yeah thanks for doing this so what's Babylon and why did you choose to effectively notarize proof of stake consensus in Bitcoin yeah sure so arguably Bitcoin is the most secure blockchain in the world proof of work world all the proof of stake vote and on the other hand pure exchange such as cosmos zooms have fast

finality a very good Energy Efficiency but the security level it's not as good as a Bitcoin so that's why we want to bring the best of Two Worlds by bringing the extracted Bitcoin security to the customer museums yeah that's I mean that's really cool because I think like as you were explaining to me earlier it unlocks so much practical applications for proof of stake change it's not just like a gimmick of hey we're going to time stamp uh proof of stake blocks and improve of work blockchain yeah can you talk about like why would one want to do this why would we want to you know put the put put the blocks into work yeah yeah sure of course so I mean like bringing big security Bitcoin security to a cost mode

zone is like very abstract so yeah once you have Bitcoin security so what right so I would like to describe to you a very concrete use case once you get Bitcoin security so I would like to start by asking you a question indeed yeah if you imagine you are a cost ozone Staker or validator yeah and you want to get yours token back for some reason or part of it how long does it usually take well it usually takes between like 14 and 21 days 14 21. I even heard a project with 28 days yeah they're up for 28 yeah also yeah yeah so why so long right I mean I yeah I think it has to do with

um you know potential reorgs but yeah yeah exactly so tenements provide fast finality but that finality is only in short term if we look at a longer time scale a POS or tenement is not less secure because once you unbond like take your money back you then you attack the system by reoperate or create a fork the system is not able to slash you because you already catch up yeah right so in order to prevent you from doing such attacks after you Unbound they set a very long unbounding period and during this period they will check whether you have done anything wrong yeah to the

system or not so this is the nothing at stake problem or is that a different problem uh someone quite long range attacks or restake or like stick reuse yeah okay yeah and so yeah so by by having Bitcoin uh Bitcoin transactions secure a proof of stake change and you were able to then get security guarantees that the stake uh stake that's been unbonded hasn't been you like won't be used for a sort of long-range attack yeah yeah so so to expand this I would like to First describe what happens within this 21 days yeah currently okay so currently like during this 21 days the

stakeholders of the POS Channel or tenement or cosmosome they do something called social consensus it's like they get together through like WhatsApp or Whatsapp Twitter or Telegram and say okay this week the train has grown to height 100 and the corresponding pattern hash it's XYZ this is finalized we agreed on this checkpoint wait what yeah validators get together in WhatsApp groups to agree on what's finalized yeah so if you go to the tenement client if you uh the software if you want to launch a new node you find that in a configuration there's a line ask you what's the

trusted height and The Trusted hash that's anything before that you believe it is the wrong truth okay then how do you get this trusted height okay up to a certain height yeah yeah so yeah yeah which at which height in like the entire history of the cosmos chain for instance do we think like this is the trust we all agree that this is like the trusted height so what you're saying is that there's a kind of rough consensus that happens off chain where people get together in telegram groups or discords or whatever to decide that like this is the trusted height and that um is constantly sort of moving forward

as the chain grows yeah I didn't know this yeah so if you if you yeah read the tender mean document it actually says you used to grab this height and hash either through a trusted mode or through your friends or through a social media where people now all say all follow the Twitter of the founder yeah yeah so they can get a trusted height and hash that is insane yeah okay um and so like this this trusted height how often does this happen oh it's actually up up to the Little tune yourself yeah but on average like uh over a week or two weeks or yeah so roughly I would say every week okay so like every week they decide um okay this is the latest trust

height and hash this is the latest trust uh uh hyphen hash okay so like human so this is like a human checkpointing okay right it takes time so that's why it had 14 days 21 days 28 days okay and so by yeah all right so I'm I'm getting it understand here so basically by having a checkpoint in Bitcoin you you're able to eliminate that human checkpointing because Bitcoin is essentially um well after a certain amount of blocks passed we have you know High probabilistic guarantees that that is the longest chain and that these transactions have been uh notarized yeah notarized exactly so I use the term notarized but it's like a professional

deformation from having done like notice a previous startup and like notarizing things in Bitcoin but yeah yeah checkpointing yeah yeah yeah you get it so the human version of the Trap pointing at this card is called social consensus and he also has another more academic name called weak subjectivity okay it's subject it's subjective because it's human making a decision offline offloading so it's subjective so from this perspective basically what bubble and dance for the zooms is to replace this human checkpointing with automatic and 100 objective checkpointing to bitcoin okay which only as you said only take a few hours to get the right to finalize it so can you

let's let's dive into how how this is architectured and like what what Babylon is as a chain and how it actually like checkpoints the Bitcoin yeah so talking asking about from Bob long to bitcoin yeah like let's let's describe the architecture and you know how it actually how the Babylon chain like issues that transactions to bitcoin and how is it able to understand also in like parse Bitcoin to know that something's been there in order to you know have these shorter checkpoint times okay so you need our architecture had three layers uh the trust anchor it's Bitcoin yeah and then Bobby in the barbell chain in the middle as an aggregator of your checkpoints and then in the third layer is the cosmos zooms okay they send their block headers sign

block headers to Bobby Long Edge checkpoint Bobby Long Aggregates all of them and generate a succinct checkpoints to bitcoin okay yeah so all of the cosmos zones I guess connect to Babylon via IBC obviously okay and so they're sending an IBC message uh to Babylon Babylon Aggregates those like on an Epoch scale or it's it's actually simpler than that okay IBC or it so with IBC so what does IBC do it's actually maintaining at the transport layer of IBC it maintains the header chain of both the standard chain and the receiver chain so by opening an IPC connection between a cosmo zoom and bubbling

IBC already upload all the headers of the customers this is automatic you know so no one has to issue a transaction to Babylon issue by having a connection an IBC relay Babylon already has the information you only occasionally send a dummy message packet to Babylon to trigger the synchronization of the header okay the message itself can just be hello yeah it doesn't have to meet to mean anything so all the headers of the zoom will be inside bubble Ledger then popular checkpoints itself to bitcoin which will ultimately allow the entire header header chain of the customer Zone to have Bitcoin timestamp okay yeah so how does Babylon submit transactions to the Bitcoin

Network okay great question so as we all know so just one second so Babylon is a chain it has validators yes so as we all know uh Bitcoin has a very very tight space and it's also very slow right so in order for Babylon to send checkpoints to bitcoin we want to make sure our checkpoint data it succeeds very small and it also it should be infrequent we can't just send checkpoints to bitcoin like every 10 seconds yeah yeah that doesn't make sense so Bobby Lane has invented quite a few Innovations and techniques to make sure our checkpoint to bitcoin is secure

succinct and infrequent okay one of the measures we take is we introduce the concept of epoch so every 400 will you see every 400 uh bubble and blocks uh forms an Epoch and within this Epoch we do not allow population validators to change that means whatever staking or unbounding request happening within Epoch is delayed to the end of the epoch so that during the epoch the validator set does not change right in this way we only need to checkpoint the last block of an Epoch because if this block is checkpointed it implicitly checkpoints all the decisions made by

the same value data set so it enables a slashable security okay so this way a roughly popular only needs to send checkpoints to bitcoin every half an hour every half hour yeah so every half hour Babylon is making is creating a Bitcoin transaction uh creating a checkpoint a check to be submitted oh okay which is like then mercolized perhaps like probably miracleized and then sent to bitcoin at the end of the epoch yeah and in order to make the uh track point verifiable then the checkpoint needs to be signed by problem validators yeah if we use ordinary uh signature algorithms then we like popular has 100 validators then the signatures list will be super long right

then we adopt the most advanced uh crypto cryptographic signature algorithm called BLS signature multisig which allows anyone to sign a sign a message and and the signal can be aggregated into just one signature okay yeah so the checkpoint is the BLS multi-seek of the last block okay yeah um so I have a question because yeah I don't I don't I don't think I understand BLS signatures very well I get threshold signatures yeah but yeah why BLS in that threshold because I think like uh axelr uses threshold signature monomic also use you see it right so why BLS and not

like threshold okay great question so if we want to use PR uh use threshold signature then there needs a ceremony it's needed before anything can happen so what's the threat host uh signature it means a set of stakeholders they run a program or several together and everyone get their own private key such that if more than a certain percent of the validators in this group signing it then this signature becomes uh valid okay yeah so in in order to have this

threshold say two-thirds 20 or 51 or whatever there needs to be a ceremony among all the validators okay yeah so we don't want to this to happen because otherwise whenever there's a value data set change in Babylon we need to run ceremony yeah okay I see and also this in order to use this the checkpointing has to use btc's Tap Root transaction okay the smaller multistake Capital transaction so this makes the truck pointing deeply coupled with Bitcoin got it if if the Bitcoin Community changes mind say oh no I'm not going to support noticing someday then the system will just break down okay so

we want to use Bitcoin in the most respectful Bitcoin native way negative way yeah okay so we create our signatures using BRS noticing which is not dependent on bitcoin okay so then anyone who sees this checkpoint data can submit it to bitcoin use the most simple Bitcoin transaction called up return transaction yeah which allows carrying arbitrary data so for us listeners who maybe are not familiar with with this because I realized like a lot of a lot of people listening are probably or watching are probably more like Cosmos proof of stake and so so in Bitcoin and Bitcoin transaction we have this vehicle operurn and it is essentially a field that

allows us to put like I think 80 bytes of data and you can put any data in here and like lots of there's been lots of companies and projects over the years that have like leveraged uh this Opera turn field to say notarize like a document so you've got like a hash of a document and you put it there and you can prove that it exists at one point in time there were also projects like colored coin back in the day which like pre-etherium that we're trying to do like tokens essentially on bitcoin and they were using uh you're not familiar with colored coin yeah yeah it's like OG Bitcoin stuff right like before there were Arc 20 tokens there were colored coins and you could create essentially kind of like these tokens that would be would exist sort of as a a secondary layer on top of Bitcoin but essentially

they were leveraging this operator and field to to parse the transaction data it was a little cumbersome but it worked and like I remember having you know yeah like counterparty tokens and stuff for for different projects back in the day so like yeah so that's the Bitcoin thing and so this has like high high security guarantee so whatever you put in here it once the Bitcoin chain uh once uh the chain is long enough like you know that that hash is you know has been effectively kind of secured there um so who who yeah who's issuing that transaction because a blockchain a proof of State Cosmos blockchain as far as I know can't make Bitcoin transactions or like they don't have a Bitcoin client yeah great this is a great question I think that's the one of the many

Elegance of a popular system anyone who sees the trackpoint created with in Bob blanching yeah can use their own Bitcoin wallet to submit the checkpoints to bitcoin and then Babylon will reward this volume here by asking them to put their put the Barberton address inside the checkpoint so that when bubblegum receives that tripod back and verifies it publicly can provide bubble tokens as a reward to the voluntary submitter so some random person sees these checkpoints are looking or looking at the Babylon

chain sees these checkpoints submits that transaction to bitcoin using his wallet yeah maybe there's like some easier way to do this and like copy pasting into a wallet but like whatever like they're basically making a Bitcoin transaction in that transaction they're also including an address and then the chain is able to parse this and then reward that person in tokens why wouldn't it be possible to have like all the validators run a Bitcoin like client and be able to make the transaction wouldn't that be possible to do that uh it could be possible actually the validators are motivated to help the system submit checkpoints to bitcoin because if no one submits according to Bobby Lonesome group then no one can

unbox yeah yeah I mean at the end of the day you can you'll submit or like someone from The Babylon team ultimate right yeah but yeah yeah I mean if the validator if the client basically could have a Bitcoin like client and be able to make that transaction what happens if two peoples or what if it happens if like you make that transaction and then I also make that transaction yeah we were we will split the reward okay so if like 100 people are making the transaction I think you'll become very same oh that's okay so how do you handle how do you handle incentives there well so the designing of the incentive is like in our next stage okay we just proved that we can actually send very 16 checkpoints to bitcoin yeah yeah so I think the beauty of this solution is

that you only need one honest submitter yeah in the entire world yeah to make the system work yeah yeah and also in order to solve the concerning just raised Babylon also indeed provide apis for the sub meter to check whether this checkpoint has already been submitted or not right if it has already been submitted don't waste your time yeah okay so the last piece of the puzzle here is to understand how the chains who that are submitting block Header information to um to Babylon how they get to parse this information is that I mean that's the whole point right the point is for the chance to process information so that effectively we can have shorter

unbonding periods yeah on staking or earn staking periods so how does that work like how do the chains get to get all this information okay so that there are two steps here so first okay I just mentioned like uh the popular checkpoints will be reported to boblin with the including proof towards Bitcoin so that Bobby Lane will use the IBC connection to report the checkpoints back to the cosmos Zoom with the inclusion proof of the checkpoint at the popular so this is the first step that means by simply building a IPC connection with problem the cosmo Zone can already get the BTC timestamps yeah

then come to the next step how to interpret it yeah timestamp and bobbyland will provide so if you wish you want to have popular support yeah the Bob loan actually provides you a new Cosmos module that process the checkpoints and compare it with the BTC mainnet and make sure the checkpoint is deep enough once it's deep enough you will send the signal to the um to the staking module of the cosmos Zoom okay hey this from ptc's perspective this is good to go so there's a there's a new module a new Cosmos SDK module that Babylon will provide yes change that one to benefit from this get to just

Implement that module in a chain upgrade and then that module sends information to the staking module and assuring it that um there has been a Bitcoin checkpoint and then I guess chains all they would all like change their own bonding periods to like three days or something or yeah yeah so using sudo code then currently the unbounding rule is if the bonding request is 21 days old or it's like say 10 000 blocks old in terms of the cosmo Cosmo Zone block okay then I'm bound now now this line is changed to if 21 days or Bitcoin say it's okay okay

yeah okay so so there needs to be an upgrade also to like the the chains like individual chains binaries yes so I imagine there will be a governance yeah yeah to update the software okay and do trains have to pay anything to battle like I mean does Babylon have a revenue model that chase Chains would pay it yeah do this yeah so when you sum when a zoom submit transactions to popular so there will be a transaction with low Bill transaction fee yeah then there will be a transaction fee paid okay yeah so we should ultimately handled by IBC okay yeah but for now we focus on bringing a security

so how to do the economic side we haven't fully figured that out okay yeah this is super cool I really I really really like this I mean thank you so much I like it because it makes use of Bitcoin like and I think making use of Bitcoin for things like this is something that I've been very interested in and you know for for a long time like using Bitcoin to secure information that you know isn't transactional but it's also cool because it has like a practical application which is that it reduces bonding on staking periods for Cosmos zones um yeah what's the what's the roadmap like what are you launching and how can people

start learning more about Babylon so we are currently at our definite stage which means we just built we have just finished a development of the barbell training itself and its checkpointing mechanism to bitcoin so our next step is to launch a public test net with necessary apis for the cosmos zones to try out barbella so ideally we have like a drawing test net bobbyland test net in the cosmosome test net connected through IPC then we can see from a cosmod Zone side the unbounding period could be slashed from 21 days to just a few hours to just a few hours yep just a few hours all right yeah so this is cool uh yeah

thanks so much I'm looking forward to learning more about this and yeah thank you so much Sebastian for giving me a chance to yeah to claim Babylon to the world thank you thank you very much [Music]