@gandlaf21/blind-signature
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Blinded Signatures

@gandlaf21/blind-signature is a JavaScript Module implementing blind signatures using @noble/secp256k1 elliptic curve.

Usage

install:

npm i @gandlaf21/blind-signature

use:

Take a look at this example for the complete flow:

import { SigningAuthority, BlindedMessage } from "@gandlaf21/blind-signature";
//Mint(Alice)
const mint: SigningAuthority = new SigningAuthority();

//Wallet(Bob)
const message: BlindedMessage = new BlindedMessage()
const B_ = await message.createBlindedMessageFromString("secret")

//Mint
const C_ = mint.createBlindSignature(B_)

//Wallet
const {C, secret} = message.unblindSignature(C_, mint.publicKey)

//Mint
const aY  = await mint.calculateCVerify(secret)

//if C===aY, the message was signed by the mint with private key a 

In the most likely case, the Signing Authority is not running alongside the creator of the blinded messages. We can serialize and deserialize the points, to hex strings, for simplified data transfer:

import { hexToPoint, pointToHex } from "@gandlaf21/blind-signature";

//serialize
const b_ = pointToHex(B_)

//deserialize
const B_dec: = hexToPoint(b_)

Package Sidebar

Install

npm i @gandlaf21/blind-signature

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

38.8 kB

Total Files

23

Last publish

Collaborators

  • gandlaf21