anders94 / bitcoin-supply.com

We're tracking provably lost bitcoin at https://bitcoin-supply.com
MIT License
9 stars 4 forks source link

Track coins lost due to committing to invalid BIP340 public keys #6

Open vostrnad opened 1 year ago

vostrnad commented 1 year ago

Inspired by this article: https://suredbits.com/taproot-funds-burned-on-the-bitcoin-blockchain/

There are P2TR outputs on mainnet whose 32-byte scriptPubKey commitment isn't a valid x-coordinate of a secp256k1 point as specified in BIP340, and so are forever unspendable. The article shows an example output that burned 0.0002 BTC.

anders94 commented 1 year ago

Thanks for pointing this out. I'll take a look to see how pervasive this issue is.

anders94 commented 1 year ago

As the blog post points out, there aren't tools to verify BIP340 compliance for public keys so I'm going to have to write something to check this. As you can see, I'm not on this full time so I don't know when I'll be able to get to this. I'm open to whomever would like to help.

0xSaksham commented 5 months ago

@anders94 I've been learning so much from your website's blockchain demo, I would like to help here.

anders94 commented 5 months ago

Thanks @0xSaksham for the offer of help. I haven't had the time to work on the above if that's something you can help with...

0xSaksham commented 5 months ago

Please lead me to helpful resources related to the project.

anders94 commented 5 months ago

Look at the secp256k1 parameters and make a tool that checks to see if the x coordinate is on the curve. Reference the above article and this: http://www.secg.org/sec2-v2.pdf - you could also look at the various implementations and wrap one of them in a try / catch block or something.