1.0.7 • Published 2 years ago

@gandlaf21/blind-signature v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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_)
1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago