Post
Topic
Board Bitcoin Technical Support
Merits 5 from 2 users
Re: Would P2WPKH v1/bech32m addressee be legal (and usable and spendable)?
by
pooya87
on 01/03/2024, 14:52:07 UTC
⭐ Merited by BTCW (3) ,ABCbits (2)
Code:
020000000001013715989bfedc450192588c193465473d472fad620d6aea1768341af4aa2c49c10000000000fdffffff01318601000000000017a914628cde58e1bcd42efb72b1821ec9fdf49e0f1d49870120

b4b003aebb5672a4c4dbc37da21f0255f9034109b6f5bf26ddb95b7ed6ff24f8

00000000
I don't think you needed to provide any witness at all (the part I separated) to spend this output. Which is what anyone-can-spend means.

Quote
Bitcoin Core console, sendrawtransaction: "bad-txns-nonstandard-inputs (code -26)"
Electrum console, broadcast(): "TxBroadcastServerReturnedError: Witness version reserved for soft-fork upgrades"
That's the non-standard error I mentioned above. Mempool rejects it but if you can bypass standard tests (like if it is already in a block) it is considered valid.

Quote
so unless someone else has a brilliant idea of how to spend it, it is stuck, barring a miracle (such as a future soft fork that allows this address format).
You could spend some time trying to mine a block yourself if you want to have a record of it on a public blockchain.
Otherwise you could test all of this on RegTest.

Someone correct me if I'm wrong but Taproot is always active on RegTest. So just mine a 100 blocks, send the output of your first coinbase to your bc1p address and mine another block. Then create this final tx spending that non-standard output and mine that block too.

Read some sources on how to work on RegTest like this one for more information: https://gist.github.com/System-Glitch/cb4e87bf1ae3fec9925725bb3ebe223a

Quote
BUT! Isn't it strange that major wallet software allows sending to this homemade address type if outputs to such are forever unspendable?
Such outputs are actually spendable by anyone until there is a consensus rule added to handle these things, then it would depend on whether you can provide the correct script to spend them.

The decision to accept the address may be because of having forward-compatibility (if some day a new version would be added, the old clients are still easy to use) although I'd say they should show a big warning that to this version of software you run and at that time the destination address you entered is non-standard and your funds could be lost.