@cypher-laboratory/alicesring-lsag
v0.1.2
Published
A TypeScript implementation of LSAG ring signatures.
Downloads
13
Readme
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);