code: function checksig(msg, sig, key) {
    return secp256k1.verify(msg, sig.slice(0, -1), key);
  }
docs: Verify a signature, taking into account sighash type.
  @param {Buffer} msg - Signature hash.
  @param {Buffer} sig
  @param {Buffer} key
  @returns {Boolean}