SchnorrFun!
Generate and verify Schnorr signatures on secp256k1. Uses secp256kfun.
Schnorr signatures were introduced (and patented until 2008) by their namesake in Efficient Signature Generation by Smart Cards. This implementation is based on the BIP-340 specification, but is flexible enough to be used as a general purpose Schnorr signature scheme.
Use
[]
= "0.6"
= "0.9"
Should use?
This library and secp256kfun are experimental.
Synopsis
use ;
use Sha256;
use ThreadRng;
// Use synthetic nonces
let nonce_gen = default;
let schnorr = new;
// Generate your public/private key-pair
let keypair = schnorr.new_keypair;
// Sign a variable length message
let message = plain;
// Sign the message with our keypair
let signature = schnorr.sign;
// Get the verifier's key
let verification_key = keypair.verification_key;
// Check it's valid 🍿
assert!;
Features
- BIP-340 compliant signing and verification
- Adaptor signatures