Opcodes · crypto · enabled

OP_CHECKSIG (0xac)

Checks a transaction signature against a public key and pushes 1 or 0. Since May 2019 it accepts both ECDSA and Schnorr signatures, told apart by signature length.

Verified
Stack in → out
sig pubkey → ok
Since
Original Bitcoin script
Cost
Base instruction cost 100 plus 26,000 per signature check, plus hashing cost for the signing serialization (2025 VM limits). An empty signature adds no signature check. Also counted by the 2020 SigChecks limit.
Bitcoin status
Behaves differently in Bitcoin (BTC)BTC uses ECDSA in legacy/SegWit v0 scripts and BIP-340 Schnorr only in Tapscript; the signing serialization also differs (BCH uses SIGHASH_FORKID).

Example

<sig> <pubkey> OP_CHECKSIG

Step through it opcode by opcode in Bitauth IDE, the in-browser BCH VM debugger.

Sources

  1. Libauth BCH_2023_05 opcodes (bch-2023-opcodes.ts)
  2. BCHN upgrade specs: 2019-05-15 Schnorr signatures
  3. CHIP-2021-05 VM Limits: Targeted Virtual Machine Limits
  4. BCHN script interpreter (interpreter.cpp)