Hello! I’m thinking about a trustless 2 way peg BTC mechanism in Stacks because as far as I know it’s theoretically possible.
To peg in you burn BTC using OP_RETURN. The peg out could work like PoX. You could send your, let’s say, xBTC to a contract where it’s gradually destroyed as miners send BTC to your address, just like miners send BTC to stackers right now.
The main tradeoff seems to be that the peg out is limited in time by the Stacks block reward. For instance, if the block reward equals to 0,1 BTC and you want to peg out 1 BTC you have to wait 10 blocks (or more). Other users have to wait too, currently the BTC is only sent to you.
This mechanism has to be encoded in a consensus rule because it’s about mining. If there are peg outs it means less BTC is transferred to stackers or burned. That’s why I think it shouldn’t be costless, because you are consuming BTC that otherwise would be destined to PoX or PoB. It could be implemented like an auction with a minimum fee.
Now that you have the trustless 2 way peg mechanism you don’t really need to use it. It’s more efficient to simply do atomic swaps.
I’m sure I’m missing a lot. What are the challenges of building such a mechanism?