signer

package
v1.17.28 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

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

Signer provides BLS signing for Lux consensus. Threshold signing is coordinated through the consensus layer using github.com/luxfi/threshold protocols.

func NewSigner

func NewSigner() (*Signer, error)

NewSigner creates a signer with BLS key and threshold seed

func NewSignerWithThreshold

func NewSignerWithThreshold(keyShare threshold.KeyShare) (*Signer, error)

NewSignerWithThreshold creates a signer with a threshold key share.

func (*Signer) AggregateThresholdShares

func (s *Signer) AggregateThresholdShares(ctx context.Context, message []byte, shares []threshold.SignatureShare) (threshold.Signature, error)

AggregateThresholdShares combines signature shares into a final signature. Returns an error if no threshold key is configured.

func (*Signer) BLSSecretKey

func (s *Signer) BLSSecretKey() *bls.SecretKey

BLSSecretKey returns the underlying BLS secret key for advanced operations

func (*Signer) GetBLSPublicKey

func (s *Signer) GetBLSPublicKey() []byte

GetBLSPublicKey returns the BLS public key bytes

func (*Signer) HasThresholdKey

func (s *Signer) HasThresholdKey() bool

HasThresholdKey returns true if this signer has a threshold key share.

func (*Signer) SetThresholdKeyShare

func (s *Signer) SetThresholdKeyShare(keyShare threshold.KeyShare) error

SetThresholdKeyShare sets the threshold key share for this signer.

func (*Signer) SignBLS

func (s *Signer) SignBLS(message []byte) ([]byte, error)

SignBLS creates a BLS signature

func (*Signer) SignThresholdShare

func (s *Signer) SignThresholdShare(ctx context.Context, message []byte, signers []int) (threshold.SignatureShare, error)

SignThresholdShare creates a threshold signature share for the given message. The signers parameter contains the indices of all parties participating in this signing. Returns an error if no threshold key is configured.

func (*Signer) ThresholdGroupKey

func (s *Signer) ThresholdGroupKey() threshold.PublicKey

ThresholdGroupKey returns the threshold group public key. Returns nil if no threshold key is configured.

func (*Signer) ThresholdIndex

func (s *Signer) ThresholdIndex() int

ThresholdIndex returns this signer's index in the threshold scheme. Returns -1 if no threshold key is configured.

func (*Signer) ThresholdPublicShare

func (s *Signer) ThresholdPublicShare() []byte

ThresholdPublicShare returns this signer's public key share. Returns nil if no threshold key is configured.

func (*Signer) ThresholdSchemeID

func (s *Signer) ThresholdSchemeID() threshold.SchemeID

ThresholdSchemeID returns the threshold scheme ID if a key share is set. Returns SchemeUnknown if no threshold key is configured.

func (*Signer) ThresholdSeed

func (s *Signer) ThresholdSeed() []byte

ThresholdSeed returns the seed for threshold protocol key derivation. Use with github.com/luxfi/threshold to participate in threshold signing.

func (*Signer) VerifyBLS

func (s *Signer) VerifyBLS(message, signature []byte) bool

VerifyBLS verifies a BLS signature

func (*Signer) VerifyThreshold

func (s *Signer) VerifyThreshold(message []byte, signature threshold.Signature) bool

VerifyThreshold verifies a complete threshold signature. Returns false if no threshold key is configured.

func (*Signer) VerifyThresholdBytes

func (s *Signer) VerifyThresholdBytes(message, signature []byte) bool

VerifyThresholdBytes verifies a serialized threshold signature. Returns false if no threshold key is configured.

func (*Signer) VerifyThresholdShare

func (s *Signer) VerifyThresholdShare(message []byte, share threshold.SignatureShare, publicShare []byte) error

VerifyThresholdShare verifies a single signature share. Returns an error if no threshold key is configured or the share is invalid.

Jump to

Keyboard shortcuts

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