nostr

package module
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: CC0-1.0 Imports: 3 Imported by: 1

README

nostr

nostr codec and protocol libraries written for performance and simplicity

codec dispenses with all strings, uses binary in fields that strictly represent binary (id, pubkey, sig, a and e tags, and likewise in the filters)

single common marshal/unmarshal interface that allows you to provide your own buffers so you can manage recycling them... unmarshalled data almost all uses the buffer fields directly from the buffers they are provided on, avoiding memory allocation

uses the bitcoin-core secp256k1 signature library for 4x improvement in signing and 2x improvement in verification

provides the fastest existing binary encoder for events for use with disk/database storage, combines with the binary data in the runtime data structures for face-melting performance

concise and clear APIs for everything including relay websockets, authentication, relay information, signing and verification and ECDH shared secret generation, and all elements of filter and events

notes about secp256k1 library

see p256k docs for building with the bitcoin-core/secp256k1 library interfaced with CGO (it is about 2x faster at verification and 4x faster at signing) but if you don't want to use CGO or can't, set the build tag btcec to disable the secp256k1 CGO binding interface. The CGO version is default because it is so much better, deal with it.

running tests and benches

use the script at scripts/runtests.sh to get a full suite of tests and benchmarks including memory utilization information

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log, Chk, Errorf = lol.Main.Log, lol.Main.Check, lol.Main.Errorf
	Equals           = bytes.Equal
	Compare          = bytes.Compare
)

Functions

This section is empty.

Types

type B

type B = []byte

func StringSliceToByteSlice added in v0.1.5

func StringSliceToByteSlice(ss []S) (bs []B)

type Ctx

type Ctx = context.T

type E

type E = error

type N

type N = int

type S

type S = string

Directories

Path Synopsis
Package codec defines interfaces for use with both pointer and reference types that allows proper integration with zero-copy and allocation pools
Package codec defines interfaces for use with both pointer and reference types that allows proper integration with zero-copy and allocation pools
tag
protocol
dns
ws

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL