Sonr Crypto
A Go cryptography library for threshold signatures, multi-party computation, zero-knowledge proofs, and decentralized identity — built on a single pluggable elliptic-curve abstraction.
github.com/sonr-io/crypto is the cryptographic foundation of Sonr. It bundles roughly 60 Go packages
spanning elliptic-curve arithmetic, secret sharing, distributed key generation, threshold ECDSA and
Ed25519, BLS and BBS+ signatures, range proofs, accumulators, homomorphic encryption, and the
identity layer that turns a threshold key into a did:key identifier issuing UCAN capability tokens.
Almost everything is generic over one abstraction — the Curve / Point / Scalar triple in
core/curves. Learn that first and the rest of the library reads consistently.
Install
go get github.com/sonr-io/crypto
The module requires Go 1.24.7 or newer and is licensed Apache 2.0.
A first example
Threshold ECDSA is the library’s headline capability. The mpc package wraps
the DKLs18 two-party protocol into a single value you can create, sign with, verify, and rotate:
package main
import (
"fmt"
"log"
"github.com/sonr-io/crypto/mpc"
)
func main() {
// Runs both sides of the 2-of-2 distributed key generation.
enclave, err := mpc.NewEnclave()
if err != nil {
log.Fatal(err)
}
sig, err := enclave.Sign([]byte("transfer 100 to bob"))
if err != nil {
log.Fatal(err)
}
ok, err := enclave.Verify([]byte("transfer 100 to bob"), sig)
if err != nil {
log.Fatal(err)
}
fmt.Println("public key:", enclave.PubKeyHex(), "valid:", ok)
}
The layers
Foundations
The curve abstraction, modular arithmetic, hash-to-field, commitments, and the round-driving protocol iterator every multi-party package uses.
Symmetric & Secrets
AES-GCM and deterministic AES-SIV, Argon2id key derivation, HKDF and X25519, plus the salt, password, and memory-hygiene helpers.
Signatures
BLS aggregation and threshold keygen, BBS+ selective disclosure, ECDSA canonicalization and RFC 6979 signing, VRFs, and chain-specific Schnorr schemes.
Threshold & MPC
Shamir, Feldman, and Pedersen sharing; FROST and Gennaro DKG; two-party threshold ECDSA; threshold Ed25519; and the oblivious transfer beneath them.
Zero-Knowledge
Schnorr proofs of knowledge, pairing-based accumulators for set membership, Bulletproofs range proofs, and Paillier homomorphic encryption.
Identity & Authorization
did:key encoding, the MPC enclave, UCAN capability tokens, ECIES payload
encryption, and WebAssembly module signing.
Choosing a primitive
| Goal | Reach for |
|---|---|
| Sign with a key that never exists in one place | Threshold ECDSA or the MPC enclave |
| Produce a standard Ed25519 signature from shares | Threshold Ed25519 |
| Aggregate many signatures into one | BLS |
| Prove attributes without revealing them | BBS+ |
| Prove a hidden value lies in a range | Bulletproofs |
| Prove set membership with a constant-size witness | Accumulator |
| Add ciphertexts without decrypting | Paillier |
| Split an existing secret among holders | Secret sharing |
| Derive a key from a password | Argon2id |
| Encrypt a payload to a public key | ECIES |
| Delegate scoped authority to another party | UCAN |