All Projects → cloudflare → zkp-ecdsa

cloudflare / zkp-ecdsa

Licence: Apache-2.0 license
Proves knowledge of an ECDSA-P256 signature under one of many public keys that are stored in a list.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to zkp-ecdsa

FISCO-BCOS
FISCO BCOS是由微众牵头的金链盟主导研发、对外开源、安全可控的企业级金融区块链底层技术平台。 单链配置下,性能TPS可达万级。提供群组架构、并行计算、分布式存储、可插拔的共识机制、隐私保护算法、支持全链路国密算法等诸多特性。 经过多个机构、多个应用,长时间在生产环境中的实践检验,具备金融级的高性能、高可用性及高安全性。FISCO BCOS is a secure and reliable financial-grade open-source blockchain platform. The platform provides rich features including group architecture, cross-chain communication protoc…
Stars: ✭ 1,603 (+1258.47%)
Mutual labels:  crypto, zero-knowledge
dtls
Datagram Transport Layer Security (DTLS) client.
Stars: ✭ 72 (-38.98%)
Mutual labels:  crypto, ecdsa
mrrcrypt
A command line encryption/decryption tool using an adaptive mirror field algorithm.
Stars: ✭ 41 (-65.25%)
Mutual labels:  crypto
Sparks
No description or website provided.
Stars: ✭ 12 (-89.83%)
Mutual labels:  crypto
rich-uncle-pennybags-bot
A telegram bot for all of your crypto needs. Works over the bitfinex and coinmarketcap APIs
Stars: ✭ 15 (-87.29%)
Mutual labels:  crypto
sodium
An wrapper for libsodium in golang
Stars: ✭ 54 (-54.24%)
Mutual labels:  crypto
asherah
Asherah is a multi-language, cross-platform application encryption SDK
Stars: ✭ 46 (-61.02%)
Mutual labels:  crypto
DEGEN
Distributing POAPs to DAOs in discord, twitter, and more.
Stars: ✭ 27 (-77.12%)
Mutual labels:  crypto
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+92.37%)
Mutual labels:  crypto
krypta
Generating random bits, passwords, recovery phrases and Bitcoin private keys / addresses (including QR codes) from text seed and salt.
Stars: ✭ 18 (-84.75%)
Mutual labels:  crypto
whirlpool
whirlpool cryptographic hashing library
Stars: ✭ 21 (-82.2%)
Mutual labels:  crypto
conan-openssl
[OBSOLETE] The recipe is now in https://github.com/conan-io/conan-center-index
Stars: ✭ 25 (-78.81%)
Mutual labels:  crypto
gotham-city
Gotham city is a fully functional project to demonstrate real-life example of minimalist Bitcoin decentralized HD wallet using 2 party ECDSA
Stars: ✭ 109 (-7.63%)
Mutual labels:  ecdsa
zkc
zero-knowledge chat suite
Stars: ✭ 96 (-18.64%)
Mutual labels:  zero-knowledge
virgil-crypto-c
This library is designed to be small, flexible and convenient wrapper for a variety crypto algorithms. So it can be used in a small micro controller as well as in a high load server application.
Stars: ✭ 24 (-79.66%)
Mutual labels:  crypto
zkp
Experimental zero-knowledge proof compiler in Rust macros
Stars: ✭ 121 (+2.54%)
Mutual labels:  zero-knowledge
HTML-Crypto-Currency-Chart-Snippets
💹 Simple HTML Snippets to create Tickers / Charts of Cryptocurrencies with the TradingView API 💹
Stars: ✭ 89 (-24.58%)
Mutual labels:  crypto
virgil-crypto
Virgil Crypto is a high-level cryptographic library that allows you to perform all necessary operations for secure storing and transferring data and everything required to become HIPAA and GDPR compliant. Crypto Library is written in C++, suitable for mobile and server platforms and supports bindings with: Swift, Obj-C, Java (Android), С#/.NET, …
Stars: ✭ 74 (-37.29%)
Mutual labels:  crypto
CryptoLogos
Hundreds of crypto logos simply named by their normalized contract address
Stars: ✭ 14 (-88.14%)
Mutual labels:  crypto
CoinMarketCap-Desktop
A simple desktop wrapper for CoinMarketCap
Stars: ✭ 21 (-82.2%)
Mutual labels:  crypto

NPM NPM DOI

NPM

zkp-ecdsa: A Typescript Implementation of ZKAttest

ZKAttest proofs knowledge of an ECDSA-P256 signature under one of many public keys that are stored in a list without revealing which public key was used to sign the message.

Usage Development Cite This Future Work

Usage

Ready to use ZKAttest proofs, follow this short guideline.

Step 1

Suppose you already have a signature of a message using ECDSA (P-256). Otherwise, create signature as follows:

// Message to be signed.
const msg = new TextEncoder().encode('kilroy was here');

// Generate a keypair for signing.
const keyPair = await crypto.subtle.generateKey(
    { name: 'ECDSA', namedCurve: 'P-256' },
    true, [ 'sign', 'verify'],
);

// Sign a message as usual.
const msgHash = new Uint8Array(await crypto.subtle.digest('SHA-256', msg));
const signature = new Uint8Array(
    await crypto.subtle.sign(
        { name: 'ECDSA', hash: 'SHA-256' },
        keyPair.privateKey, msgHash,
    )
);

Step 2

Then, insert your public key in a ring of keys. This allows to hide your public key behind the ring of keys. (In this example, assume the list was generated with valid keys).

import { keyToInt } from '@cloudflare/zkp-ecdsa'

// Add the public key to an existing ring of keys,
const listKeys = [BigInt(4), BigInt(5), BigInt(6), BigInt(7), BigInt(8)];
listKeys.unshift(await keyToInt(keyPair.publicKey));

Step 3

Now, create a ZKAttest proof of knowledge showing that

  • the signature was generated using the private key, AND
  • the public key is in the ring.

However, the proof does not reveal which public key was used during signing.

import { generateParamsList, proveSignatureList } from '@cloudflare/zkp-ecdsa'

// Create a zero-knowledge proof about the signature.
const params = generateParamsList();
const zkAttestProof = await proveSignatureList(
    params,
    msgHash,
    signature,
    keyPair.publicKey,
    0, // position of the public key in the list.
    listKeys
);

Step 4

After this, everyone can verify the proof is valid, which means the message was signed by the holder of an ECDSA key pair, but without identifying exactly which one of the keys in the ring was used to produce the proof. Do not disclose the original signature as it is already embedded inside the proof.

import { verifySignatureList } from '@cloudflare/zkp-ecdsa'
// Verify that zero-knowledge proof is valid.
const valid = await verifySignatureList(params, msgHash, listKeys, zkAttestProof)
console.assert(valid == true)

That's all.


Citation

This software library is part of the article "ZKAttest: Ring and Group Signatures for Existing ECDSA Keys" published at Selected Areas in Cryptography (SAC 2021) authored by Armando Faz Hernández, Watson Ladd, and Deepak Maram.

To cite this library, use one of the following formats and update the version and date you accessed to this project.

APA Style

Faz-Hernández, A., Ladd, W., Maram, D. (2021). ZKAttest: Ring and Group Signatures for Existing ECDSA Keys. In: AlTawy, R., Hülsing, A. (eds) Selected Areas in Cryptography. SAC 2021. Available at https://github.com/cloudflare/zkp-ecdsa. v0.2.3 Accessed Oct 2021.

BibTex Source

@inproceedings{zkattest,
  doi       = {10.1007/978-3-030-99277-4_4},
  title     = {ZKAttest: Ring and Group Signatures for Existing ECDSA Keys},
  author    = {Faz-Hernández, Armando and Ladd, Watson and Maram, Deepak},
  booktitle = {Selected Areas in Cryptography},
  editor    = {AlTawy, Riham and Hülsing, Andreas},
  publisher = {Springer International Publishing},
  address   = {Cham},
  isbn      = {978-3-030-99277-4},
  pages     = {68--83},
  month     = {oct},
  year      = {2021},
  note      = {Available at \url{https://github.com/cloudflare/zkp-ecdsa}.
               v0.2.3 Accessed Oct 2021},
}

CFF Style

Find attached a CITATION.cff file.


Development

Task NPM scripts
Installing $ npm ci
Building $ npm run build
Unit Tests $ npm run test
Benchmarking $ npm run bench
Flamegraph Profile $ npm run flame
Code Linting $ npm run lint
Code Formating $ npm run format
Bundling Library $ npm run bundle

Future Work

  • Accelerate proof verification.
  • Implement the proof in other programming languages.
  • Remove dependency on native Bignum.

License

The project is licensed under the Apache 2.0 License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].