Documentation
¶
Index ¶
- Constants
- Variables
- func DerivationContextHashV1(in DerivationContext) (string, error)
- func DeriveECDSAChildPublicKey(accountPublicKey string, chainCode []byte, ctx DerivationContext) (string, error)
- func MarshalKeyMaterial(material ECDSAKeyMaterial) ([]byte, error)
- type DKGDerivationMaterial
- type DKGOutput
- type DKGSessionDescriptor
- type DKGSessionRequest
- type DerivationContext
- type ECDSAKeyMaterial
- type KeyMaterialMeta
- type PreParamsConfig
- type PreParamsSource
- type Service
- func (s *Service) ECDSAAddress(key string) (string, error)
- func (s *Service) ExportECDSASignature(key string) (common.SignatureData, error)
- func (s *Service) RunDKGSession(ctx context.Context, req DKGSessionRequest) (DKGOutput, error)
- func (s *Service) RunSignSession(ctx context.Context, req SignSessionRequest) error
- func (s *Service) Snapshot() Snapshot
- func (s *Service) StartPreParamsPool(ctx context.Context) error
- func (s *Service) StopPreParamsPool() error
- type ServiceOption
- type SessionDescriptor
- type ShareCipher
- type ShareMeta
- type ShareStore
- type SignSessionDescriptor
- type SignSessionRequest
- type Snapshot
- type StoredShare
- type Transport
Constants ¶
View Source
const ( AlgorithmECDSA = "ecdsa" AlgorithmEdDSA = "eddsa" CurveSecp256k1 = "secp256k1" CurveEd25519 = "ed25519" DerivationSchemeBIP32Secp256k1 = "bip32_secp256k1" DerivationSchemeBIP32Public = "bip32_public" DerivationSchemeSLIP10Ed25519 = "slip10_ed25519" PublicKeyFormatUncompressedHex = "uncompressed_hex" )
View Source
const ( )
Variables ¶
View Source
var ( ErrDerivationContextRequired = corederivation.ErrDerivationContextRequired ErrInvalidDerivationContext = corederivation.ErrInvalidDerivationContext ErrUnsupportedDerivationScheme = corederivation.ErrUnsupportedDerivationScheme ErrDerivationPathInvalid = corederivation.ErrDerivationPathInvalid ErrDerivationContextMismatch = corederivation.ErrDerivationContextMismatch ErrChainCodeMissing = corederivation.ErrChainCodeMissing ErrChainCodeInvalid = corederivation.ErrChainCodeInvalid ErrDerivedSigningUnsupported = corederivation.ErrDerivedSigningUnsupported ErrUnsupportedAlgorithmCurve = corederivation.ErrUnsupportedAlgorithmCurve )
View Source
var ( ErrInvalidSessionDescriptor = errors.New("invalid session descriptor") ErrLocalPartyRequired = errors.New("local party id is required") ErrTransportRequired = errors.New("transport is required") ErrKeyIDRequired = errors.New("key id is required") ErrDigestMissing = errors.New("digest is required") ErrMissingDKGPublicKey = errors.New("dkg result missing public key") ErrMissingDKGAddress = errors.New("dkg result missing address") )
View Source
var ( ErrVaultPermissionDenied = coreshares.ErrVaultPermissionDenied ErrVaultWriteFailed = coreshares.ErrVaultWriteFailed ErrVaultReadFailed = coreshares.ErrVaultReadFailed ErrMetadataMismatch = coreshares.ErrMetadataMismatch ErrUnsupportedVersion = coreshares.ErrUnsupportedVersion )
View Source
var ErrNilRunner = tssservice.ErrNilRunner
Functions ¶
func DerivationContextHashV1 ¶ added in v0.2.2
func DerivationContextHashV1(in DerivationContext) (string, error)
func DeriveECDSAChildPublicKey ¶ added in v0.2.2
func DeriveECDSAChildPublicKey(accountPublicKey string, chainCode []byte, ctx DerivationContext) (string, error)
func MarshalKeyMaterial ¶ added in v0.2.2
func MarshalKeyMaterial(material ECDSAKeyMaterial) ([]byte, error)
Types ¶
type DKGDerivationMaterial ¶ added in v0.2.2
type DKGOutput ¶ added in v0.2.0
type DKGOutput = tssservice.DKGOutput
type DKGSessionDescriptor ¶ added in v0.2.2
type DKGSessionRequest ¶
type DKGSessionRequest struct {
Session DKGSessionDescriptor
LocalPartyID string
DerivationMaterial *DKGDerivationMaterial
Transport Transport
}
func (DKGSessionRequest) Validate ¶
func (r DKGSessionRequest) Validate() error
type DerivationContext ¶ added in v0.2.2
type DerivationContext struct {
ProfileID string
ProfileTemplateID string
Chain string
Algorithm string
Curve string
Scheme string
PublicKeyFormat string
AccountPath string
ChildPath string
FullPath string
AddressEncoding string
ExpectedAddress string
DerivedPublicKey string
Descriptor string
DescriptorVersion uint32
ProfileVersion uint32
KeyVersion uint32
}
func NormalizeDerivationContext ¶ added in v0.2.2
func NormalizeDerivationContext(in DerivationContext) (DerivationContext, error)
type ECDSAKeyMaterial ¶ added in v0.2.2
type ECDSAKeyMaterial = coreshares.ECDSAKeyMaterial
func UnmarshalKeyMaterial ¶ added in v0.2.2
func UnmarshalKeyMaterial(blob []byte) (ECDSAKeyMaterial, error)
type KeyMaterialMeta ¶ added in v0.2.2
type KeyMaterialMeta = coreshares.KeyMaterialMeta
type PreParamsConfig ¶
type PreParamsConfig struct {
Enabled bool
TargetSize int
MaxConcurrency int
GenerateTimeout time.Duration
AcquireTimeout time.Duration
RetryBackoff time.Duration
SyncFallbackOnEmpty bool
FileCacheEnabled bool
FileCacheDir string
}
func DefaultPreParamsConfig ¶
func DefaultPreParamsConfig() PreParamsConfig
func LoadPreParamsConfigFromEnv ¶
func LoadPreParamsConfigFromEnv() PreParamsConfig
type PreParamsSource ¶ added in v0.2.0
type PreParamsSource interface {
Acquire(ctx context.Context) (*ecdsakeygen.LocalPreParams, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewBnbService ¶
func NewBnbService(logger *slog.Logger, opts ...ServiceOption) *Service
func (*Service) ExportECDSASignature ¶
func (s *Service) ExportECDSASignature(key string) (common.SignatureData, error)
func (*Service) RunDKGSession ¶
func (*Service) RunSignSession ¶
func (s *Service) RunSignSession(ctx context.Context, req SignSessionRequest) error
func (*Service) StartPreParamsPool ¶
func (*Service) StopPreParamsPool ¶
type ServiceOption ¶ added in v0.2.0
type ServiceOption func(*serviceOptions)
func WithMetrics ¶ added in v0.2.0
func WithMetrics(metrics bnbutils.Metrics) ServiceOption
func WithPreParamsConfig ¶ added in v0.2.0
func WithPreParamsConfig(cfg PreParamsConfig) ServiceOption
func WithPreParamsSource ¶ added in v0.2.0
func WithPreParamsSource(source PreParamsSource) ServiceOption
func WithShareStore ¶ added in v0.2.0
func WithShareStore(store ShareStore) ServiceOption
type SessionDescriptor ¶
type SessionDescriptor = DKGSessionDescriptor
type ShareCipher ¶
type ShareCipher interface {
}
type ShareMeta ¶
type ShareMeta = coreshares.ShareMeta
type ShareStore ¶
type ShareStore = coreshares.Store
type SignSessionDescriptor ¶ added in v0.2.2
type SignSessionRequest ¶
type SignSessionRequest struct {
Session SignSessionDescriptor
LocalPartyID string
Digest []byte
DerivationContext *DerivationContext
Transport Transport
}
func (SignSessionRequest) Validate ¶
func (r SignSessionRequest) Validate() error
type Snapshot ¶
type Snapshot = tssservice.Snapshot
type StoredShare ¶
type StoredShare = coreshares.StoredShare
type Transport ¶
type Transport = coretransport.FrameTransport
Source Files
¶
Click to show internal directories.
Click to hide internal directories.