10 releases

0.11.4 Dec 8, 2023
0.11.3 Oct 5, 2023
0.11.2 Sep 12, 2023
0.10.2 Oct 18, 2021
0.1.0 Mar 17, 2019

#158 in Cryptography

Download history 92563/week @ 2024-08-06 100928/week @ 2024-08-13 78906/week @ 2024-08-20 99446/week @ 2024-08-27 105186/week @ 2024-09-03 96889/week @ 2024-09-10 95482/week @ 2024-09-17 95972/week @ 2024-09-24 105510/week @ 2024-10-01 103272/week @ 2024-10-08 107509/week @ 2024-10-15 104484/week @ 2024-10-22 93033/week @ 2024-10-29 110465/week @ 2024-11-05 90368/week @ 2024-11-12 68550/week @ 2024-11-19

382,650 downloads per month
Used in 934 crates (41 directly)

BSD-3-Clause

240KB
3K SLoC

schnorrkel

Schnorrkel implements Schnorr signature on Ristretto compressed Ed25519 points, as well as related protocols like HDKD, MuSig, and a verifiable random function (VRF).

Ristretto implements roughly section 7 of Mike Hamburg's Decaf paper to provide the 2-torsion free points of the Ed25519 curve as a prime order group. (related)

We employ the merlin strategy of type specific hashing methods with sound domain separation. These wrap Mike Hamburg's STROBE128 construction for symmetric cryptography, itself based on Keccak.

In practice, all our methods consume either a merlin::Transcript which developers create handily by feeding data to context specific builders. We do however also support &mut merlin::Transcript like the merlin crate prefers. We shall exploit this in future to adapt schnorrkel to better conform with the dalek ecosystem's zero-knowledge proof tooling.

We model the VRF itself on "Making NSEC5 Practical for DNSSEC" by Dimitrios Papadopoulos, Duane Wessels, Shumon Huque, Moni Naor, Jan Včelák, Leonid Rezyin, andd Sharon Goldberg. We note the V(X)EdDSA signature scheme by Trevor Perrin at is basically identical to the NSEC5 construction. Also, the VRF supports individual signers merging numerous VRF outputs created with the same keypair, which parallels the "DLEQ Proofs" and "Batching the Proofs" sections of "Privacy Pass - The Math" by Alex Davidson, and "Privacy Pass: Bypassing Internet Challenges Anonymously" by Alex Davidson, Ian Goldberg, Nick Sullivan, George Tankersley, and Filippo Valsorda.

Aside from some naive sequential VRF construction, we currently only support the three-round MuSig for Schnorr multi-signatures, due to all other Schnorr multi-signatures being somewhat broken. In future, we should develop secure schemes like mBCJ from section 5.1 starting page 21 of https://eprint.iacr.org/2018/417 however mBCJ itself works by proof-of-possession, while a delinearized variant sounds more applicable.

There are partial bindings for C, JavaScript, and Python as well.

Dependencies

~2–3.5MB
~74K SLoC