btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.1k stars 2.31k forks source link

txscript:Add supported script type WitnessV1PubKeyHash #2020

Closed loganever closed 10 months ago

loganever commented 10 months ago

support script type P2WPKH V1.

I noticed some pk script couldn't be parsed

Example: Tx:ba5fd9fe19d4b4b859779a98602e279c13072d17367aa6fb0bc81c2bb2e1e006

This tx's first output pk script is 5114c5e507cae1475ff181ce9ab56d74aca5e4508cf9, which means the first opcode is OP_1, and the second opcode is OP_DATA_20. That is a version 1 P2WPKH, and not be supported, so I add support script type P2WPKH V1 code. I hope this is helpful.

BIP350

guggero commented 10 months ago

A v1 P2WPKH type does not exist. Someone burned money, that's probably why it's only a couple of sats. That will never be spendable again (without a soft fork). The only valid v1 output is a push of 32 bytes.

loganever commented 10 months ago

A v1 P2WPKH type does not exist. Someone burned money, that's probably why it's only a couple of sats. That will never be spendable again (without a soft fork). The only valid v1 output is a push of 32 bytes.

ok,I got it