Bitcoin-com / bitbox-sdk

BITBOX SDK for Bitcoin Cash
https://developer.bitcoin.com/bitbox
MIT License
88 stars 62 forks source link

decodeOpReturn() reports invalid TX as valid #182

Open christroutner opened 4 years ago

christroutner commented 4 years ago

User @linkinpark9812 reports that bchjs.SLP.Utils.decodeOpReturn() reports an invalid transaction as valid:

Valid SLP send: https://explorer.bitcoin.com/bch/tx/a31c3167686f892d835727bc46b74bb11a46d74a8a6b08dc6cd82abb6e987b43

Invalid SLP send: https://explorer.bitcoin.com/bch/tx/a60a522cc11ad7011b74e57fbabbd99296e4b9346bcb175dcf84efb737030415

decodeOpReturn() reports the invalid SLP transaction as valid.

christroutner commented 4 years ago

I need to fix this same bug in bch-js. I'll try to submit a PR to fix this when I fix it there.

My plan of attack is to replace the built-in OP_RETURN parsing with the slp-parse npm library.