bitauth / libauth

An ultra-lightweight, zero-dependency TypeScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.
https://libauth.org
MIT License
274 stars 53 forks source link

createInstructionSetBCHCHIPs uses isStandardOutputBytecode rather than isStandardOutputBytecode2023 #133

Open rkalis opened 4 months ago

rkalis commented 4 months ago

It is my understanding that createInstructionSetBCHCHIPs should result in the most recent instruction set based on chipnet rules, which I'd expect to be further than BCH_2023. However, the BCH_CHIPS instruction set treats P2SH32 as non-standard output scripts. We ran into this while trying to debug a WalletTemplate scenario that sends to a P2SH32 locking bytecode.

See https://github.com/bitauth/libauth/blob/ade015123b2bfdbca721602cda19191c6f12252d/src/lib/vm/instruction-sets/bch/chips/bch-chips-instruction-set.ts#L697C16-L697C40

bitjson commented 4 months ago

Thanks for the report @rkalis and @mr-zwets! This will be fixed in https://github.com/bitauth/libauth/pull/134, it was just an oversight while merging CashTokens support (BCH_CHIP wasn't updated with some of the final changes). The linked PR creates BCH_2023_05, and proposed VMs for BCH_2025_05 and BCH_2026_05, as well as a BCH_SPEC which will serve as a long term testing ground for any mutually-compatible VM proposals (some explanation here).

I'm still deep in VM work, but I plan to merge and release #134 once I've finished implementing a few more types of benchmarks (and the learnings have made it into https://github.com/bitjson/bch-vm-limits).