@cloudflare/zkp-ecdsa

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

https://github.com/cloudflare/zkp-ecdsa

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.4%) to scientific vocabulary

Keywords

crypto cryptography ecdsa zero-knowledge zkattest

Keywords from Contributors

mesh sequences interactive hacking network-simulation
Last synced: 6 months ago · JSON representation ·

Repository

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

Basic Info
Statistics
  • Stars: 215
  • Watchers: 16
  • Forks: 20
  • Open Issues: 2
  • Releases: 3
Topics
crypto cryptography ecdsa zero-knowledge zkattest
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

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:

```ts // 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 signature = new Uint8Array( await crypto.subtle.sign( { name: 'ECDSA', hash: 'SHA-256' }, keyPair.privateKey, msg, ) ); ```

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).

```ts 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.

This proof does not reveal which public key was used during signing.

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

// Create a zero-knowledge proof about the signature. const params = generateParamsList(); const msgHash = new Uint8Array(await crypto.subtle.digest('SHA-256', msg)); 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.

ts 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"](https://doi.org/10.1007/978-3-030-99277-44)_ published at Selected Areas in Cryptography (SAC 2021) authored by Armando Faz Hernández, Watson Ladd, and Deepak Maram.

A copy of this paper can be downloaded at research.cloudflare.com or at the IACR ePrint 2021/1183.

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.5 Accessed Nov 2022.

BibTex Source

bibtex @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.5 Accessed Nov 2022}, }

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

Owner

  • Name: Cloudflare
  • Login: cloudflare
  • Kind: organization
  • Location: San Francisco, London, Austin, Lisbon, Singapore

Citation (CITATION.cff)

---
cff-version: 1.2.0
version: 0.2.5
title: "zkp-ecdsa: A Typescript Implementation of ZKAttest"
license: Apache-2.0
abstract: >
   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.
authors:
  - family-names: Faz-Hernández
    given-names: Armando
    affiliation: Cloudflare, Inc.
    orcid: "https://orcid.org/0000-0001-5502-8666"
  - family-names: Ladd
    given-names: Watson
    affiliation: Cloudflare, Inc.
    orcid: "https://orcid.org/0000-0002-1674-8529"
  - family-names: Maram
    given-names: Deepak
    affiliation: Cornell Tech.
    orcid: "https://orcid.org/0000-0001-5324-6889"
date-released: "2021-06-14"
keywords:
  - zero-knowledge
  - cryptography
  - crypto
  - ecdsa
repository-code: "https://github.com/cloudflare/zkp-ecdsa"
message: "If you use this software, please cite it as below."
preferred-citation:
  type: conference-paper
  doi: "10.1007/978-3-030-99277-4_4"
  title: "ZKAttest: Ring and Group Signatures for Existing ECDSA Keys"
  authors:
    - family-names: Faz-Hernández
      given-names: Armando
      orcid: "https://orcid.org/0000-0001-5502-8666"
    - family-names: Ladd
      given-names: Watson
      orcid: "https://orcid.org/0000-0002-1674-8529"
    - family-names: Maram
      given-names: Deepak
      orcid: "https://orcid.org/0000-0001-5324-6889"
  collection-title: "Selected Areas in Cryptography"
  editors:
    - family-names: AlTawy
      given-names: Riham
    - family-names: Hülsing
      given-names: Andreas
  publisher:
    name: "Springer International Publishing"
  month: 10
  year: 2021
  start: 68
  end: 83
  isbn: "978-3-030-99277-4"
  notes: >
    Available at https://github.com/cloudflare/zkp-ecdsa.
    v0.2.5 Accessed Nov 2022

GitHub Events

Total
  • Watch event: 14
  • Delete event: 4
  • Push event: 3
  • Pull request review event: 4
  • Pull request event: 7
  • Fork event: 1
  • Create event: 4
Last Year
  • Watch event: 14
  • Delete event: 4
  • Push event: 3
  • Pull request review event: 4
  • Pull request event: 7
  • Fork event: 1
  • Create event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 28
  • Total Committers: 6
  • Avg Commits per committer: 4.667
  • Development Distribution Score (DDS): 0.5
Past Year
  • Commits: 9
  • Committers: 4
  • Avg Commits per committer: 2.25
  • Development Distribution Score (DDS): 0.444
Top Committers
Name Email Commits
armfazh a****h@c****m 14
dependabot[bot] 4****] 9
Hrushikesh Deshpande 1****e 2
Thibault Meunier t****t@c****m 1
Watson Ladd w****n@c****m 1
Hrushikesh Deshpande h****e@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 25
  • Average time to close issues: about 23 hours
  • Average time to close pull requests: 5 days
  • Total issue authors: 5
  • Total pull request authors: 6
  • Average comments per issue: 1.29
  • Average comments per pull request: 0.24
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 10
Past Year
  • Issues: 0
  • Pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
  • 0xjjpa (2)
  • bmdelacruz (2)
  • CruiseMan (1)
  • manel1874 (1)
  • darkedges (1)
Pull Request Authors
  • dependabot[bot] (14)
  • armfazh (11)
  • 3for (2)
  • hrushikeshdeshpande (2)
  • marcellobardus (1)
Top Labels
Issue Labels
question (1)
Pull Request Labels
dependencies (14) documentation (2) javascript (1)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 3,353 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 7
  • Total maintainers: 35
npmjs.org: @cloudflare/zkp-ecdsa

zkp-ecdsa: A Typescript Implementation of ZKAttest

  • Versions: 7
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 3,353 Last month
Rankings
Downloads: 3.0%
Stargazers count: 4.2%
Forks count: 5.1%
Average: 8.7%
Dependent repos count: 10.4%
Dependent packages count: 21.0%
Last synced: 6 months ago

Dependencies

package-lock.json npm
  • 479 dependencies
package.json npm
  • 0x 5.2.1 development
  • @peculiar/webcrypto 1.3.3 development
  • @types/benchmark 2.1.1 development
  • @types/node 17.0.23 development
  • @typescript-eslint/eslint-plugin 5.17.0 development
  • @typescript-eslint/parser 5.17.0 development
  • benchmark 2.1.4 development
  • eslint 8.12.0 development
  • eslint-config-prettier 8.5.0 development
  • eslint-plugin-prettier 4.0.0 development
  • eslint-plugin-security 1.4.0 development
  • prettier 2.6.1 development
  • pvutils 1.1.3 development
  • typescript 4.6.3 development
  • webpack-cli 4.9.2 development
  • typedjson 1.8.0
.github/workflows/node.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite