crypto

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package crypto provides the cryptographic primitives used by the Pocket Network. This includes the RingClient used to build and cache rings used for signing relays, and may expand to include other cryptographic primitives in the future.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubKeyClient

type PubKeyClient interface {
	// GetPubKeyFromAddress returns the public key of the given account address
	// if it exists.
	GetPubKeyFromAddress(ctx context.Context, address string) (cryptotypes.PubKey, error)
}

PubKeyClient is used to get the public key given an address. Onchain and offchain implementations should take care of retrieving the address' account and returning its public key.

type RingClient

type RingClient interface {
	// GetRingForAddressAtHeight returns the ring for the given application address
	// and blockHeight if it exists.
	GetRingForAddressAtHeight(
		ctx context.Context,
		appAddress string,
		blockHeight int64,
	) (*ring.Ring, error)

	// VerifyRelayRequestSignature verifies the relay request signature against
	// the ring for the application address in the relay request.
	VerifyRelayRequestSignature(ctx context.Context, relayRequest *types.RelayRequest) error
}

RingClient is used to construct rings by querying the application module for the addresses of the gateways the application delegated to, and converting them into their corresponding public key points on the secp256k1 curve.

Directories

Path Synopsis
Package rings provides the RingClient interface that is used to build rings for applications by either the application itself or a gateway.
Package rings provides the RingClient interface that is used to build rings for applications by either the application itself or a gateway.

Jump to

Keyboard shortcuts

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