pkarr

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 6 Imported by: 0

README

go-pkarr

Go implementation of Public-Key Addressable Resource Records.

The simplest possible streamlined integration between the Domain Name System and peer-to-peer overlay networks, enabling self-issued public keys to function as sovereign, publicly addressable, censorship-resistant top-level domains. This system would be accessible to anyone capable of maintaining a private key.

Documentation

Overview

Public-Key Addressable Resource Records

Index

Constants

View Source
const (
	// Maximum allowed length of an encoded DNS packet.
	MaxPacketLength = 1000

	// Maximum allowed length of an encoded payload.
	MaxPayloadLength = MaxPacketLength + payloadHeaderLength
)

Variables

View Source
var (
	// Error that is returned when length of encoded packet is too large.
	ErrPacketTooLarge = errors.New("pkarr: packet is too large")

	// Error that is returned when parsing a malformed Pkarr record.
	ErrInvalidPayload = errors.New("pkarr: invalid payload")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record represents a signed DNS record.

func FromPayload

func FromPayload(pub ed25519.PublicKey, payload []byte) (Record, error)

FromPayload parses a Record in a wire format. Returns ErrPacketTooLarge if the payload is too large and ErrInvalidPayload otherwise.

func New

New encodes and signs DNS record m. If length of the encoded record is larger than MaxPacketLength, ErrPacketTooLarge is returned.

func (Record) Message

func (sp Record) Message() dnsmessage.Message

Message returns the underlying DNS record.

func (Record) Payload

func (sp Record) Payload() []byte

Payload returns an encoded version of Record that is sent over the HTTP relay.

func (Record) PublicKey

func (sp Record) PublicKey() ed25519.PublicKey

PublicKey returns the public key this record belongs to.

func (Record) Time

func (sp Record) Time() time.Time

Time returns the timestamp that was used to sign this record.

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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