Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noot/ring-go
đź’Ťimplementation of linkable ring signatures in go
https://github.com/noot/ring-go
cryptography proof-of-membership ring-signatures zk
Last synced: about 1 hour ago
JSON representation
đź’Ťimplementation of linkable ring signatures in go
- Host: GitHub
- URL: https://github.com/noot/ring-go
- Owner: noot
- License: lgpl-3.0
- Created: 2018-07-07T22:05:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T22:13:37.000Z (4 months ago)
- Last Synced: 2024-11-07T18:54:41.440Z (8 days ago)
- Topics: cryptography, proof-of-membership, ring-signatures, zk
- Language: Go
- Homepage:
- Size: 8.5 MB
- Stars: 53
- Watchers: 6
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ring-go
Implementation of linkable ring signatures using elliptic curve crypto in pure Go. It supports ring signatures over both ed25519 and secp256k1.### requirements
go 1.19### get
`go get github.com/noot/ring-go`### references
This implementation is based off of [Ring Confidential Transactions](https://eprint.iacr.org/2015/1098.pdf), in particular section 2, which defines MLSAG (Multilayered Linkable Spontaneous Anonymous Group signatures).### usage
See `examples/main.go`.
```go
package mainimport (
"fmt"ring "github.com/noot/ring-go"
"golang.org/x/crypto/sha3"
)func signAndVerify(curve ring.Curve) {
privkey := curve.NewRandomScalar()
msgHash := sha3.Sum256([]byte("helloworld"))// size of the public key ring (anonymity set)
const size = 16// our key's secret index within the set
const idx = 7
keyring, err := ring.NewKeyRing(curve, size, privkey, idx)
if err != nil {
panic(err)
}sig, err := keyring.Sign(msgHash, privkey)
if err != nil {
panic(err)
}ok := sig.Verify(msgHash)
if !ok {
fmt.Println("failed to verify :(")
return
}fmt.Println("verified signature!")
}func main() {
fmt.Println("using secp256k1...")
signAndVerify(ring.Secp256k1())
fmt.Println("using ed25519...")
signAndVerify(ring.Ed25519())
}
```