Skip to main content
The function checkSigFromStack compiles to the opcode OP_CHECKSIGFROMSTACK (CSFS). It takes a signature, a public key, and a message. The function checkSig verifies a signature against the sighash of the transaction. CSFS verifies a signature over any bytes that the spender supplies. A signer signs a message offchain. The spender supplies the message and the signature, the script checks the message, and then it verifies the signature against the signer key. Escrow does this in complete:
contracts/escrow.ark @ 95582b1
CSFS proves which key signed the bytes, but it does not prove that the bytes are true. The signer key is the root of trust. The emulator runs the script and cosigns only when every require passes. It accepts Schnorr keys (BIP340) and ECDSA keys on secp256k1 and P-256. The PriceVault contract of the prediction market verifies ECDSA reports from RedStone (Examples).