• Stars
    star
    264
  • Rank 155,103 (Top 4 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust language general purpose elliptic curve cryptography.

Build Status Latest version Docs License dependency status

Curv

Curv contains an extremely simple interface to onboard new elliptic curves. Use this library for general purpose elliptic curve cryptography.

The library has a built in support for some useful operations/primitives such as verifiable secret sharing, commitment schemes, zero knowledge proofs, and simple two party protocols such as ECDH and coin flip. The library comes with serialize/deserialize support to be used in higher level code to implement networking.

Usage

To use curv crate, add the following to your Cargo.toml:

[dependencies]
curv-kzen = "0.9"

The crate will be available under curv name, e.g.:

use curv::elliptic::curves::*;

Currently Supported Elliptic Curves

Curve low level library curve description
Secp256k1 rust-secp256k1 bitcoin wiki
P-256 RustCrypto NIST.FIPS.186.4
Ed25519 cryptoxide BDLSY11
Ristretto curve25519-dalek ristretto group
BLS12-381 bls12-381 BLS12-381 For The Rest Of Us

Security

The library was audited by Kudelski security on Feb19. The report can be found here. No critical issue were found and all issues found were fixed.

The code was reviewed independently by few other cryptographers. Special thanks goes to Claudio Orlandi from Aarhus University.

In general security of the library is strongly dependent on the security of the low level libraries used. We chose only libraries that are used as part of other big projects and went through heavy audit/review.

The library is not immune to side channel attacks but considerable effort was given to try and catch as many such attacks as possible (see audit report).

Build

Use cargo build to build everything including curve implementations, cryptoprimitives, BigInt, etc.

Big integer implementation

The library supports a couple of bigint implementations and can easily switch between them. You can choose any one which you prefer by specifying a feature:

  • rust-gmp-kzen, uses GMP bindings, requires GMP to be installed on a machine. Used by default.

  • num-bigint, Rust's pure implementation of big integer. In order to use it, put in Cargo.toml:

    [dependencies.curv-kzen]
    version = "0.8"
    default-features = false
    features = ["num-bigint"]

    Warning: num-bigint support is experimental and should not be used in production. For this bigint implementation, we use prime numbers generator which is not considered secure.

Examples

The library includes some basic examples to get you going. To run them: cargo run --example EXAMPLE_NAME -- CURVE_NAME for example: cargo run --example proof_of_knowledge_of_dlog -- secp256k1

Docs

To build docs, use:

cargo doc
RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps --open

License

Curv is released under the terms of the MIT license. See LICENSE for more information.

Development Process & Contact

This library is maintained by ZenGo-X. Contributions are highly welcomed! Besides GitHub issues and PRs, feel free to reach out by mail or join ZenGo X Telegram for discussions on code and research.

More Repositories

1

multi-party-ecdsa

Rust implementation of {t,n}-threshold ECDSA (elliptic curve digital signature algorithm).
Rust
975
star
2

awesome-tss

A curated list of distributed key generation and threshold signatures implementations
271
star
3

gotham-city

Gotham city is a fully functional project to demonstrate real-life example of minimalist Bitcoin decentralized HD wallet using 2 party ECDSA
Rust
192
star
4

multi-party-schnorr

Rust implementation of multi-party Schnorr signatures over elliptic curves.
Rust
170
star
5

multi-party-eddsa

Rust implementation of multi party Ed25519 signature scheme.
Rust
132
star
6

zk-paillier

A collection of Paillier cryptosystem zero knowledge proofs
Rust
113
star
7

thresh-sig-js

Javascript threshold signatures SDK
TypeScript
110
star
8

white-city

Network layer for MPC (Secure Multi-Party Computation) based on Tendermint
Rust
103
star
9

mnemonic-recovery

Bitcoin and Ethereum mnemonic phrase recovery tool
HTML
81
star
10

kms-secp256k1

Multi Party Key Management System (KMS) for Secp256k1 Elliptic curve based digital signatures.
Rust
72
star
11

bulletproofs

Bulletproofs and Bulletproofs+ Rust implementation for Aggregated Range Proofs over multiple elliptic curves
Rust
71
star
12

multi-party-bls

Threshold BLS signatures in Rust
Rust
69
star
13

class

Rust library for building IQC: cryptography based on class groups of imaginary quadratic orders
C
63
star
14

mpc-over-signal

Secure transport for running MPC protocols backed by Signal
Rust
62
star
15

binance-thresh-wallet

Wallet for Binance chain powered by two-party ECDSA
TypeScript
51
star
16

ShareLock

ShareLock: mixing for cryptocurrencies from multiparty ECDSA
JavaScript
50
star
17

multi-hop-locks

ECDSA based construction for Anonymous Multi-Hop Locks (https://eprint.iacr.org/2018/472.pdf)
Rust
43
star
18

big-spender

A tool for checking BigSpender vulnerability in your Bitcoin wallet
JavaScript
38
star
19

JugglingSwap

Scriptless atomic cross-chain (and cross-curve) swap protocol based on a fair exchange of secrets.
TypeScript
33
star
20

fs-dkr

FS-DKR: One Round Distributed Key Rotation
Rust
32
star
21

solana-tss

PoC of TSS in Solana blockchain
Rust
27
star
22

round-based-protocol

Driver for round-based protocols in Rust
Rust
23
star
23

vdf

Simple RSA VDF in Rust
Rust
19
star
24

thresh-rust-u2f

U2f implementation with threshold signatures
Rust
16
star
25

terra-multisend

A multisend smart contract for the Terra blockchain using CosmWasm
Rust
16
star
26

inspirational-crypto

A list of exceptionally good cryptography libraries that inspire our work
16
star
27

emerald-city

WASM/HW-friendly lightweight client application for threshold ECDSA
Rust
15
star
28

zengo-will

Rust
15
star
29

vice-city

distributed RSA modulus generation in Rust
Rust
15
star
30

rust-elgamal

Rust implementation of ElGamal encryption
Rust
14
star
31

compound-playground

Basic interaction with the Compound suite of smart contracts
TypeScript
13
star
32

paradise-city

Rust implementation of Zcash multi-signautres
Rust
13
star
33

two-party-ecdsa

Rust
13
star
34

dlog-verifiable-enc

JS Implementation of Practical Verifiable Encryption and Decryption of Discrete Logarithms
Rust
13
star
35

two-party-musig2-eddsa

Rust
12
star
36

centipede

A scheme for instantiating KMS's with recovery
Rust
12
star
37

tss-bugs

supplement material for BlackHat2020 talk: Multiple Bugs in Multi-Party Computation: Breaking Cryptocurrency's Strongest Wallets
12
star
38

flippable-operator-filterer

Solidity
11
star
39

Ethereum2.0-Resources

A succinct list of the best Ethereum 2.0 resources
10
star
40

silent-ecdsa

Rust
10
star
41

extra-ordinaire

Inscription trading implementation in Rust
Rust
9
star
42

badger_dao_script_analysis

An ongoing analysis of Badger Dao's script
JavaScript
7
star
43

ZenGo

Repository related to ZenGo: Bitcoin & Crypto Wallet
6
star
44

signature-simulation

Solidity
6
star
45

cosmos-thresh-wallet

Cosmos full featured wallet working with 2 party ECDSA
TypeScript
5
star
46

random-beacon

Rust
5
star
47

terra-thresh-wallet

A new implementation for Terra wallet using the new sdk
TypeScript
5
star
48

crypto-key-calculator

This project is based on a paper by Ittai Eyal et al. that looked into different key configurations used for crypto wallets and their probability of being compromised.
JavaScript
5
star
49

two-party-eddsa-wrapper

Client-server wrapper for Two-Party EdDSA
Rust
4
star
50

taquito-taquito

TypeScript
4
star
51

gotham-engine

Traits for abstracting 2MPC signing infrastructure of gotham-city server
Rust
4
star
52

TLS-masterkey-recovery

Python
4
star
53

pps-gc

Rust
3
star
54

rust-utils

Utilities and documentation for coding in Rust
3
star
55

libs-core-bindings

Rust
2
star
56

CHILL-STORAGE-TM-bitcoin-export-privkey

Export a ZenGo constructed private key to WIF & address
JavaScript
2
star
57

pps

Stealth addresses based on inner product FE
Go
2
star
58

klaytn-thresh-wallet

Klaytn wallet powered by Two-Party ECDSA
JavaScript
2
star
59

Bad_randomness_tls_client_handshake_pure_python

Python
2
star
60

anchor-playground

Playground for basic functionality and explanation about the Anchor protocol
TypeScript
1
star
61

spec-multi-party-ecdsa

This project is a Haskell implementation of multi-party ECDSA protocol spec.
1
star
62

crypto-gmp

Rust
1
star
63

walletconnect-premint-test

TypeScript
1
star
64

smart-contracts-workshop

JavaScript
1
star
65

foundry-workshop

Solidity
1
star
66

public-docs

Zengo's repository of public docs, white papers, etc.
1
star
67

walletconnect-tokenproof-test

TypeScript
1
star