arnaucube c7b358b28c | 3 years ago | |
---|---|---|
.github/workflows | 3 years ago | |
.golangci.yml | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
blindsecp256k1.go | 3 years ago | |
blindsecp256k1_test.go | 3 years ago | |
go.mod | 3 years ago | |
go.sum | 3 years ago |
Blind signature over secp256k1, based on "An Efficient Blind Signature Scheme Based on the Elliptic Curve Discrete Logarithm Problem" paper.
WARNING: this repo is experimental, do not use in production.
// message to be signed
msg := new(big.Int).SetBytes([]byte("test"))
// create new signer
signerPrivateData := blindsecp256k1.NewSigner()
signerPublicData := signerPrivateData.PublicData()
// user blinds the msg
msgBlinded, user := blindsecp256k1.Blind(msg, signerPublicData)
// signer signs the blinded message
sBlind := signerPrivateData.BlindSign(msgBlinded)
// user unblinds the blinded signature
sig := blindsecp256k1.Unblind(sBlind, msg, user)
// signature can be verified with signer PublicKey
verified := blindsecp256k1.Verify(msg, sig, signerPublicData.Q)
assert.True(t, verified)