service

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilRunner = errors.New("runner is required")

Functions

func AttachPreParams

func AttachPreParams(ctx context.Context, pool PreParamsPool, job *tssbnbrunner.DKGJob, shouldAttach bool) error

Types

type DKGDerivationMaterial added in v0.2.2

type DKGDerivationMaterial struct {
	ChainCode        string
	DerivationScheme string
}

type DKGInput

type DKGInput struct {
	SessionID          string
	LocalPartyID       string
	OrgID              string
	KeyID              string
	Parties            []string
	Threshold          uint32
	Curve              string
	Algorithm          string
	DerivationMaterial DKGDerivationMaterial
	Transport          coretransport.FrameTransport
	EmptyKeyErr        error
	MissingPub         error
	MissingAddr        error
}

type DKGOutput added in v0.2.0

type DKGOutput struct {
	KeyID            string
	PublicKey        string
	Address          string
	ChainCode        string
	PublicKeyFormat  string
	DerivationScheme string
}

type LifecyclePool

type LifecyclePool interface {
	PreParamsPool
	Pool
	Start(ctx context.Context) error
	Close() error
}

type Pool

type Pool interface {
	Size() int
}

type PreParamsPool

type PreParamsPool interface {
	Acquire(ctx context.Context) (*ecdsakeygen.LocalPreParams, error)
}

func ResolvePreParamsSource added in v0.2.0

func ResolvePreParamsSource(external PreParamsPool, fallback PreParamsPool) PreParamsPool

type Runner

type Runner interface {
	RunDKG(ctx context.Context, job tssbnbrunner.DKGJob, transport coretransport.FrameTransport) error
	RunSign(ctx context.Context, job tssbnbrunner.SignJob, transport coretransport.FrameTransport) error
	ExportECDSASignature(key string) (common.SignatureData, error)
	ExportTemporaryECDSADKGShare(key string) (ecdsakeygen.LocalPartySaveData, error)
	ExportECDSAKeyMaterial(key string) (coreshares.ECDSAKeyMaterial, error)
	ImportECDSAKeyMaterial(key string, material coreshares.ECDSAKeyMaterial)
	DeleteTemporaryECDSADKGShare(key string)
	ECDSAAddress(key string) (string, error)
}

type Service

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

func New

func New(r Runner, logger *slog.Logger, pool LifecyclePool, shareStore ShareStore, externalSource ...PreParamsPool) *Service

func (*Service) ECDSAAddress

func (s *Service) ECDSAAddress(key string) (string, error)

func (*Service) ExportECDSASignature

func (s *Service) ExportECDSASignature(key string) (common.SignatureData, error)

func (*Service) RunDKGSession

func (s *Service) RunDKGSession(ctx context.Context, in DKGInput) (DKGOutput, error)

func (*Service) RunSignSession

func (s *Service) RunSignSession(ctx context.Context, in SignInput) error

func (*Service) Snapshot

func (s *Service) Snapshot() Snapshot

func (*Service) StartPreParamsPool

func (s *Service) StartPreParamsPool(ctx context.Context) error

func (*Service) StopPreParamsPool

func (s *Service) StopPreParamsPool() error

type ShareStore

type ShareStore interface {
	SaveShare(ctx context.Context, keyID string, blob []byte, meta coreshares.ShareMeta) error
	LoadShare(ctx context.Context, keyID string) (*coreshares.StoredShare, error)
}

type SignInput

type SignInput struct {
	SessionID             string
	LocalPartyID          string
	OrgID                 string
	KeyID                 string
	Parties               []string
	Digest                []byte
	Algorithm             string
	Curve                 string
	Chain                 string
	DerivationContext     corederivation.Context
	DerivationContextHash string
	Transport             coretransport.FrameTransport
	EmptyKeyErr           error
	MetadataMismatch      error
}

type Snapshot

type Snapshot struct {
	PreParamsPoolSize          int
	PreParamsSyncFallbackCount uint64
	PreParamsAcquireWaitNanos  int64
}

func BuildSnapshot

func BuildSnapshot(pool Pool, provider SnapshotProvider) Snapshot

type SnapshotPool

type SnapshotPool interface {
	LifecyclePool
	SnapshotProvider
}

type SnapshotProvider

type SnapshotProvider interface {
	Snapshot() preparams.Snapshot
}

Jump to

Keyboard shortcuts

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