gm stacks fam 🙂 i'm really excited to share @magicstx. what excites me most about @stacks is the possibilities for direct connections with the Bitcoin chain, and Magic takes full advantage of that. i'll be sharing more soon!
🌟 Announcing @magicstx a Magic Bitcoin Bridge.
✨ A protocol for atomic swaps between BTC and xBTC on the @Stacks blockchain.
💫 Now you can import Bitcoin directly into your favorite protocols on @Stacks.
🪄 Completely open source, on-chain, decentralized, and trustless.
overall, this is a pretty uneventful 'issue', but we wanted to share this information with our friends. these kind of edge cases make defi a fascinating environment to build in
our contracts have been fixed, tested, and deployed to mainnet. if you were interesting in running a supplier / front-end, now is the time!
https://t.co/AwZ13SQ6IC
our solution supports up to 10 consecutive flash blocks - which I don't think has ever happened.
want to check it out? it's the `was-tx-mined-prev?` method in our `clarity-bitcoin.clar` contract:
https://t.co/jXfh3ciZ5i
at @magicstx, we just pushed code that allows our contracts to validate BTC txs, even if they were in a flash block.
this builds on top of @judecnelson's core "clarity-bitcoin" contract, which has been used by many projects to validate if a tx was mined
how does it work? 👇
so, if a tx was in a flash block, we now:
- get the next possible btc block that wasn't a flash block
- fetch all btc headers going back to our tx
- in Clarity, verify that each header is a valid "parent" of the latest block
this scenario is a win/win - the supplier ends up paying a low fee to get their BTC, and swappers get paid to bridge into xBTC. pretty cool if you ask me 😎
did you know that magic supports suppliers setting *negative* fees?
with negative fees, a swapper is actually getting _paid_ to make a swap. why would a supplier ever want to do this?
this allows for some interesting supplier dynamics 👇
acting as a supplier is more work and takes longer, but this user will end up swapping all of their xBTC into BTC for a much lower fee than they'd get from acting as a swapper.
@devloper_xyz absolutely nothing wrong with this mindset - it's smart. if you really wanted to try it, use a small amount. wait for audits and for the lindy effect to kick in. read the docs to understand what's happening. this goes for any new project, regardless of how well it's built