Mempool front-running of a Taproot hashlock spend
I built a Taproot address with a SHA256-hashlock leaf (OP_SHA256 <h> OP_EQUALVERIFY OP_TRUE, preimage "helloworld"). On mainnet I spent that leaf — the witness necessarily contains the preimage and the leaf script.
Within a few minutes, a different transaction spent the same UTXO to an unrelated address, paying a far higher fee, and confirmed instead of mine:
- my spend:
44bb85269ffacd88903154e8e2af0d4963ba4022cc57e706b5819fd008e978d3(replaced) - the replacement:
9fc1923c513cdf5a620ef88f61dbc3997e697cad0381b6f6c28827e4332dc363(link)
My understanding is that spending a hashlock reveals the preimage in the public mempool before confirmation, and under default full-RBF anyone can broadcast a higher-fee conflicting spend of the same output. Is this the correct explanation? Is automated "sweeping" of revealed-preimage / anyone-can-spend outputs a known, active phenomenon on mainnet, and is there any way to spend such an output without exposing it to this race (e.g., out-of-band submission)?
from Recent Questions - Bitcoin Stack Exchange https://ift.tt/4CBjID8
via IFTTT