Skip to content
Sonr Crypto
Esc
navigateopen⌘Jpreview
On this page

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

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

Where to next

Last updated on September 2, 2026

Was this page helpful?