@cypher-laboratory/alicesring-lsag
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Alice's-Ring-LSAG-TS

This repository contains a TypeScript implementation of the Ring Signature algorithm using Spontaneous Anonymous Group (SAG).

About the implementation

The implementation is based on the SAG algorithm and uses the Elliptic Curve Cryptography (ECC) to generate the keys and sign the message.

We used the implementation proposed in Zero to Monero (p.36) as a reference.

Usage

import { RingSignature } from '@cypherlab/types-ring-signature';

const curve: Curve = new Curve(CurveName.SECP256K1);
const ring: Point[] = []; // your ring of public keys
const message = 'Hello World!';

const signerPrivateKey = BigInt('your private key');

// Sign
const signature: RingSignature = RingSignature.sign(
  ring,
  signerPrivateKey,
  message,
  curve,
);

// Verify
console.log(
  "Is signature verified? ", signature.verify()
);

// Export to jsonString
const jsonString = signature.toJsonString();

// Import from jsonString
const retrievedFromJson = RingSignature.fromJsonString(jsonString);

Dependents (0)

Package Sidebar

Install

npm i @cypher-laboratory/alicesring-lsag

Weekly Downloads

47

Version

0.1.0

License

MIT

Unpacked Size

416 kB

Total Files

118

Last publish

Collaborators

  • lejamon
  • elli610
  • cypherlaboratory