Function createInstructionSetBCH2023

  • create an instance of the BCH 2023 virtual machine instruction set.

    Parameters

    • standard: boolean = true

      If true, the additional isStandard validations will be enabled. Transactions that fail these rules are often called "non-standard" and can technically be included by miners in valid blocks, but most network nodes will refuse to relay them. (Default: true)

    • __namedParameters: {
          ripemd160: {
              hash: ((input: Uint8Array) => Uint8Array);
          };
          secp256k1: {
              verifySignatureDERLowS: ((signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array) => boolean);
              verifySignatureSchnorr: ((signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array) => boolean);
          };
          sha1: {
              hash: ((input: Uint8Array) => Uint8Array);
          };
          sha256: {
              hash: ((input: Uint8Array) => Uint8Array);
          };
      } = ...
      • ripemd160: {
            hash: ((input: Uint8Array) => Uint8Array);
        }

        a Ripemd160 implementation

        • hash: ((input: Uint8Array) => Uint8Array)
            • (input: Uint8Array): Uint8Array
            • Returns the ripemd160 hash of the provided input.

              To incrementally construct a ripemd160 hash (e.g. for streaming), use init, update, and final.

              Parameters

              • input: Uint8Array

                a Uint8Array to be hashed using ripemd160

              Returns Uint8Array

      • secp256k1: {
            verifySignatureDERLowS: ((signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array) => boolean);
            verifySignatureSchnorr: ((signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array) => boolean);
        }

        a Secp256k1 implementation

        • verifySignatureDERLowS: ((signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array) => boolean)
            • (signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array): boolean
            • Verify a DER-encoded ECDSA signature using the provided publicKey and messageHash. This method also returns false if the signature is not in normalized lower-S form.

              Parameters

              • signature: Uint8Array

                a DER-encoded ECDSA signature to verify, max 72 bytes

              • publicKey: Uint8Array

                a public key, in either compressed (33-byte) or uncompressed (65-byte) format

              • messageHash: Uint8Array

                the 32-byte message hash signed by the signature

              Returns boolean

        • verifySignatureSchnorr: ((signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array) => boolean)
            • (signature: Uint8Array, publicKey: Uint8Array, messageHash: Uint8Array): boolean
            • Verify a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).

              Parameters

              • signature: Uint8Array

                a 64-byte schnorr signature to verify

              • publicKey: Uint8Array

                a public key, in either compressed (33-byte) or uncompressed (65-byte) format

              • messageHash: Uint8Array

                the 32-byte message hash signed by the signature

              Returns boolean

      • sha1: {
            hash: ((input: Uint8Array) => Uint8Array);
        }

        a Sha1 implementation

        • hash: ((input: Uint8Array) => Uint8Array)
            • (input: Uint8Array): Uint8Array
            • Returns the sha1 hash of the provided input.

              To incrementally construct a sha1 hash (e.g. for streaming), use init, update, and final.

              Parameters

              • input: Uint8Array

                a Uint8Array to be hashed using sha1

              Returns Uint8Array

      • sha256: {
            hash: ((input: Uint8Array) => Uint8Array);
        }

        a Sha256 implementation

        • hash: ((input: Uint8Array) => Uint8Array)
            • (input: Uint8Array): Uint8Array
            • Returns the sha256 hash of the provided input.

              To incrementally construct a sha256 hash (e.g. for streaming), use init, update, and final.

              Parameters

              • input: Uint8Array

                a Uint8Array to be hashed using sha256

              Returns Uint8Array

    Returns InstructionSet<ResolvedTransactionCommon, AuthenticationProgramCommon, AuthenticationProgramStateCommon>

Generated using TypeDoc