keysharer

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptECIES

func DecryptECIES(priv *btcec.PrivateKey, cipher string) ([]byte, error)

Decrypts a base64 or hex-encoded ECIES(sec256k1) ciphertext with the provided secp256k1 private key.

func ExtractFromShare

func ExtractFromShare(shareScalar []byte, index uint32, id []byte) ([]byte, error)

ExtractFromShare derives the per-ID extracted key bytes from the validator share (scalar bytes) and index.

func MakeVE

func MakeVE(heightFor uint64, idx uint32, extracted []byte) ([]byte, error)

Marshal VE protobuf

func SelectShare

func SelectShare(mat ShareMaterial, heightPlusOne uint64) ([]byte, uint32, error)

Choose which share to use for height h+1 (active unless we cross expiry)

Types

type Config

type Config struct {
	Enabled                    bool   `yaml:"enabled"`
	ValidatorAccount           string `yaml:"validator_account"`      // bech32 account string used in EncryptedKeyshares[].Validator
	AppSecp256k1PrivHex        string `yaml:"app_secp256k1_priv_hex"` // hex of the app key
	InvalidSharePauseThreshold uint64 `yaml:"invalid_share_pause_threshold"`
}

func LoadConfig

func LoadConfig(home string) (Config, error)

type ShareMaterial

type ShareMaterial struct {
	// decrypted validator shares for active/queued (G2 scalar)
	ActiveShare []byte
	QueuedShare []byte
	// expiries
	ActiveExpiry uint64
	QueuedExpiry uint64
	// index in DKG (1..N)
	Index uint32
}

Jump to

Keyboard shortcuts

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