wirewallet

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package wirewallet reaches a BRC-100 wallet over the wallet wire, the binary substrate both SDKs implement, and answers the one question an application asks a wallet before anything else: whose identity is this.

The wire is the only remote substrate here. The SDK's JSON substrate serialises the derivation arguments wrongly (a value receiver meets a pointer MarshalJSON) and drops action options, and both failures are silent; the wire is one serializer on both ends.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotLoopback = errors.New("wirewallet: the wallet URL must be loopback; tunnel a remote wallet rather than exposing it")

ErrNotLoopback refuses a wallet that is not on this machine. The wire carries no authentication and no confidentiality, so a wallet reachable over a network is a key-use oracle for anyone who can reach it.

Functions

func CheckURL

func CheckURL(raw string) error

CheckURL accepts an http URL whose host is a loopback address or "localhost". Anything else is ErrNotLoopback.

func Dial

func Dial(originator, base string, timeout time.Duration) (wallet.Interface, error)

Dial returns a wallet.Interface that speaks to the wallet at base over the wire, presenting originator on every call. It makes no request itself.

func IdentityKeyOf

func IdentityKeyOf(ctx context.Context, w wallet.Interface, originator string) (*ec.PublicKey, error)

IdentityKeyOf asks the wallet for its identity key: the root every record derivation hangs from, and the key a reader resolves a name to.

func Serve

func Serve(w wallet.Interface) http.Handler

Serve is the other end of the wire: an HTTP handler that routes the SDK client's calls to w. It exists so that any wallet.Interface, an embedded one included, can be served as a wallet an application drives over the wire, which is how the transport is tested without a third party.

Types

This section is empty.

Jump to

Keyboard shortcuts

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