FUNCTION
verify_signature
function verify_signature(data_hash: byte_array, pubkey: byte_array, signature: byte_array): booleanVerify a signature against a message and public key.
More precisely, verify that signature was obtained with a procedure equivalent to
get_signature(data_hash, privkey), where privkey and pubkey form a keypair.
Accepts valid public keys of size 33 or 65 bytes. Note that not all byte arrays of acceptable
length constitute valid public keys.
Parameters
- data_hash — the original (unsigned) 32-byte array
- pubkey — the public key (33, 64 or 65 bytes)
- signature — the 64-byte signature to verify
Returns
true if the signature is valid, indicating that the message was indeed signed by the
private key belonging to the keypair of the given public key; false otherwise
Throws
exception— when: -data_hashdoes not have length32-signaturedoes not have length64-pubkeydoes not have length33or65-pubkeyis not a valid public key
Since
0.10.6
© 2026 Chromia