2.0.4 • Published 2 days ago

@anon-aadhaar/core v2.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 days ago

@anon-aadhaar/core

About

Anon Aadhaar Core is the cornerstone of the Anon Aadhaar protocol, encompassing all essential TypeScript components needed to interact with our cryptographic circuits. At its heart lies the innovative PCD framework from Zupass, which we leverage for structure and typings.

Key Features:

  • Interface of our Circuits: Directly interfaces with the Anon Aadhaar Circom circuits.
  • Use of PCD Framework: Utilizes the PCD framework from Zupass for robust data processing.

AnonAadhaarCorePackage

The heart of this module is the AnonAadhaarCorePackage, exported from src/core.ts. This package provides a comprehensive suite of methods to interact with the Anon Aadhaar protocol:

Methods

  • prove
    • Description: Generates a SNARK proof for the given arguments.
    • Usage: prove(args: AnonAadhaarArgs): Promise<AnonAadhaarCore>
  • init
    • Description: Initializes the Core package with necessary parameters.
    • Usage: init(args: InitArgs): Promise<void>
  • verify
    • Description: Verifies the provided AnonAadhaarCore proof.
    • Usage: verify(pcd: AnonAadhaarCore): Promise<boolean>
  • serialize
    • Description: Serializes the Anon Aadhaar core object for storage or transmission.
    • Usage: serialize(pcd: AnonAadhaarCore): Promise<SerializedPCD<AnonAadhaarCore>>
  • deserialize
    • Description: Deserializes a string back into an Anon Aadhaar core object.
    • Usage: deserialize(serialized: string): Promise<AnonAadhaarCore>

The core package also provide helper methods such as:

  • generateArgs
    • Description: Generates the arguments to generate a proof, from the scanned QR data and the corresponding certificate file.
    • Usage: generateArgs(qrData: string,certificateFile: string,nullifierSeed: number,signal: string): Promise<AnonAadhaarCore>
  • hash
    • Description: Hash the signal and makes sure that the output is compatible with the SNARK field.
    • Usage: hash(message: BytesLike | Hexable | number | bigint): NumericString

📜 Installation and Setup

yarn add @anon-aadhaar/core

To learn more about how to use the core package in your apps, you can check the @anon-aadhaar/react implementation.

2.0.4

2 days ago

2.0.3

26 days ago

2.0.2

1 month ago

2.0.1

1 month ago

2.0.0

1 month ago

1.0.2

2 months ago

1.0.1

3 months ago

1.0.0

3 months ago

0.0.10

3 months ago

0.0.9

3 months ago

0.0.8

3 months ago

0.0.7

3 months ago

0.0.6

3 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago

0.0.0

3 months ago