building @magicstx

Joined February 2022
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.
2
7
quick update regarding mainnet (its live!) and the last contract change we made:
2
2
3
our contracts have been fixed, tested, and deployed to mainnet. if you were interesting in running a supplier / front-end, now is the time! magicstx.gitbook.io/magic-pr…
1
2
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
1
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? 👇
1
14
5
64
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
1
1
3
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: github.com/magicstx/bridge/b…
2
2
16
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 👇
1
1
1
6
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.
1
2
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 😎
2
here's a real-world bitcoin script for depositing into magic. it's mostly a typical HTLC script, but with some extra magic on top ✨
3
the magic bridge testnet app is live! there are still many improvements to come, but we wanted to let you check it out as soon as possible. let me know what you think 🪄 testnet.magic.fun
4
anyone know a user-friendly bitcoin testnet wallet? i use electrum, but you need to start it with a cli flag to run in testnet mode.
2
2