arnau 40de297340 | 3 years ago | |
---|---|---|
.github/workflows | 4 years ago | |
v0 | 4 years ago | |
wasm | 4 years ago | |
.gitignore | 4 years ago | |
.golangci.yml | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
blindsecp256k1.go | 3 years ago | |
blindsecp256k1_test.go | 3 years ago | |
go.mod | 4 years ago | |
go.sum | 4 years ago | |
parsers.go | 3 years ago | |
parsers_test.go | 3 years ago |
Blind signature over secp256k1, based on "New Blind Signature Schemes Based on the (Elliptic Curve) Discrete Logarithm Problem" paper by Hamid Mala & Nafiseh Nezhadansari.
WARNING: this repo is experimental, do not use in production.
// signer: create new signer key pair
sk := NewPrivateKey()
signerPubK := sk.Public()
// signer: when user requests new R parameter to blind a new msg,
// create new signerR (public) with its secret k
k, signerR := NewRequestParameters()
// user: blinds the msg using signer's R
msg := new(big.Int).SetBytes([]byte("test"))
msgBlinded, userSecretData := Blind(msg, signerR)
// signer: signs the blinded message using its private key & secret k
sBlind := sk.BlindSign(msgBlinded, k)
// user: unblinds the blinded signature
sig := Unblind(sBlind, msg, userSecretData)
// signature can be verified with signer PublicKey
verified := Verify(msg, sig, signerPubK)
assert.True(t, verified)
WASM wrappers for browser usage can be found at the wasm directory with an example in html&js.