bitauth / libauth

An ultra-lightweight, zero-dependency TypeScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.

Home Page:https://libauth.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BCH_2019_11 & BCH_2020_05 support

rkalis opened this issue · 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.
  • A new opcode called OP_REVERSEBYTES has been added to the script system.

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: #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!

Update: @rkalis knocked out a large part of this with PR #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.)