libauth icon indicating copy to clipboard operation
libauth copied to clipboard

BCH_2019_11 & BCH_2020_05 support

Open rkalis opened this issue 5 years ago • 2 comments

Currently the most recent implemented instruction set is BCH_2019_05, while there is also a BCH_2019_11_SPEC option. To use modern functions such as OP_REVERSEBYTES we need to implement support for the newer hardforks.

According to the specs on GitHub (https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/), these are the features that were introduced by these hardforks. These should be added to libauth to support these newer instruction sets.

BCH_2019_11

  • [ ] Enable Schnorr signatures for OP_CHECKMULTISIG(VERIFY).
  • [ ] Enforce minimal push and minimal number encoding rules in Script.

BCH_2020_05

  • [ ] Bitcoin Cash's SigOps counting and limiting system is replaced with a new system, referred to as SigChecks.
  • [x] A new opcode called OP_REVERSEBYTES has been added to the script system.

rkalis avatar Jul 09 '20 16:07 rkalis

Just an update on this: my overall goal is to implement the latest instruction sets at the same time as developing a set of flag-less VM bytecode test vectors: https://github.com/bitauth/libauth/issues/31. I’m also planning to refactor the source for each instruction set to be more verbose, where every instruction and associated method is clearly listed in a single place (to be easier to review vs. the large amount of indirection currently used).

Right now I'm focused on the transaction signing API in Libauth, so this may be a few months. However, if anyone would like to take a shot at implementing just the minimum necessary changes (no need to worry about the above), I'd love to take a PR!

bitjson avatar Jul 29 '20 23:07 bitjson

Update: @rkalis knocked out a large part of this with PR https://github.com/bitauth/libauth/pull/56, but I'll leave this open until we have full support for the latest VM version. (Likely will happen at the same time as #31.)

bitjson avatar Aug 07 '20 23:08 bitjson