This document is a reference/explainer for the new CTL features introduced with the Chang Hardfork.
Table of contents
See the What is SECP for a general overview of what SECP is and how it effects the Cardano blockchain.
For a more in depth oversight please see Cip-49.
Cip-49 provides two new Plutus builtin functions for signature verification.
Both functions take the following as Parameters:
- A verification key;
- An input to verify (either the message itself, or a hash);
- A signature.
The two functions are:
1. A verification function for ECDSA signatures.
2. A verification function for Schnorr signatures.
CTL provides off-chain variants of these functions that work the same way (the only difference is that in CTL the arguments are typed, while in Plutus BuiltinByteString
s are used).
Additionally, CTL exposes functions that allow to work with private keys (derive from bytes, generate) and public keys (derive from a private key), as well as to sign arbitrary data or data hashes.
All SECP256k1-related domain types (public keys, signatures and hashes) are made serialize-able to PlutusData to allow for simpler offchain/onchain interop.
Public interface for ECDSA support in CTL
ECDSA verification usage example
Public interface for Schnorr support in CTL
Schnorr verification usage example
Both examples show how a signature that is constructed off-chain can be passed for on-chain verification.