/bip340

naïve BIP340 signatures

Primary LanguageGoMIT LicenseMIT

GoDoc Build Status Go Report Card License Latest tag

bip340

This is a simple and naïve Go implementation of the standard 64-byte Schnorr signature scheme over the elliptic curve secp256k1 defined by BIP340. It only implements simple signing and verifying.

The current version passes all test vectors provided with the BIP (but the author does not give any guarantees that the algorithm is implemented correctly or safely).

Usage

Install using:

go get -u github.com/fiatjaf/bip340

In your code:

import "github.com/fiatjaf/bip340"

signature, err := bip340.Sign(privateKey, message)
result, err := bip340.Verify(publicKey, message, signature)

Credits