Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
During parsing of Bitcoin data from blockchain, I found many transactions which has invalid script (example 37b828de0da38f0b3b9ec09f6f8b7883c3202a99a285b0b0087f19f9cbf526d9
,f6502e80d8a8dc9e59bb518a62a6443479dd72cd153929272ac21bab26317226
)
Is there a way to parse these scripts to pull out the output address? If not, what happened to the BTC send to these invalid script?
During parsing of Bitcoin data from blockchain, I found many transactions which has invalid script (example 37b828de0da38f0b3b9ec09f6f8b7883c3202a99a285b0b0087f19f9cbf526d9,f6502e80d8a8dc9e59bb518a62a6443479dd72cd153929272ac21bab26317226)
Is there a way to parse these scripts to pull out the output address?
Addresses are human-readable shorthand ways of writing scriptPubKeys that follow a certain template. Not every script has a corresponding address. Only these are defined:
- P2PKH addresses (1...):
OP_DUP OP_HASH160 <keyhash> OP_EQUALVERIFY OP_CHECKSIG
. - P2SH addresses (3..., defined in BIP13):
OP_HASH160 <scripthash> OP_EQUAL
(defined in BIP16). - P2WPKH addresses (42-character bc1q..., defined in BIP173):
OP_0 <pubkeyhash>
(defined in BIP141). - P2WSH addresses (62-character bc1q..., defined in BIP173):
OP_0 <scripthash>
(defined in BIP141). - P2TR addresses (62-character bc1p..., defined in BIP350):
OP_1 <tweaked key>
(defined in BIP341). - Future native witness addresses (bc1..., defined in BIP350):
OP_n <program>
.
Any scriptPubKey not matching any of the above templates doesn't have a corresponding script. Unparseable scripts are among those.
If not, what happened to the BTC send to these invalid script?
Those coins are lost. There is no way to spend them, because the script can't be executed if it can't be parsed, and without it executing successfully it can't be spent.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments