backup

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PadForSigning

func PadForSigning(hash common.Hash) []byte

PadForSigning wraps a hash with the Flare PMW backup signing prefix.

Types

type EncryptedShares

type EncryptedShares struct {
	Splits           []hexutil.Bytes
	OwnersPublicKeys []types.PublicKey
	Threshold        uint64
	PublicKey        hexutil.Bytes
	Weights          []uint16
}

func (*EncryptedShares) Check

func (e *EncryptedShares) Check() error

Check ensures the encrypted shares meet threshold and weighting requirements.

type KeySplit

type KeySplit struct {
	KeySplitData
	Signature []byte
}

func DecryptSplit

func DecryptSplit(encryptedShare []byte, privKeyECDSA *ecdsa.PrivateKey) (*KeySplit, error)

DecryptSplit decrypts an encrypted key split and verifies its integrity.

func (*KeySplit) VerifySignature

func (ks *KeySplit) VerifySignature() error

VerifySignature checks that the key split signature matches the owner key.

type KeySplitData

type KeySplitData struct {
	Shares []ShamirShare
	PartialWalletBackupID
	OwnerPublicKey types.PublicKey
}

func (*KeySplitData) HashForSigning

func (ksd *KeySplitData) HashForSigning() (common.Hash, error)

HashForSigning computes the hash used when signing the key split data.

func (*KeySplitData) Sign

func (ksd *KeySplitData) Sign(signer wallets.Signer) ([]byte, error)

Sign signs the key split data with the provided private key.

type PartialWalletBackupID

type PartialWalletBackupID struct {
	wallets.WalletBackupID
	PartialPubKey hexutil.Bytes
	IsAdmin       bool
}

func (*PartialWalletBackupID) Equal

type ShamirShare

type ShamirShare struct {
	X *big.Int
	Y *big.Int
}

func (*ShamirShare) ID

func (s *ShamirShare) ID() string

ID returns the string identifier for the Shamir share.

type WalletBackup

type WalletBackup struct {
	WalletBackupMetaData
	AdminEncryptedParts    *EncryptedShares
	ProviderEncryptedParts *EncryptedShares
	Signature              hexutil.Bytes
	TEESignature           hexutil.Bytes
}

func (*WalletBackup) Check

func (wb *WalletBackup) Check() error

Check validates the metadata and share alignment in the wallet backup.

func (*WalletBackup) HashForSigning

func (wb *WalletBackup) HashForSigning() (common.Hash, error)

HashForSigning produces the hash over the wallet backup content.

type WalletBackupMetaData

type WalletBackupMetaData struct {
	wallets.WalletBackupID

	AdminsPublicKeys   []types.PublicKey
	AdminsThreshold    uint64
	ProvidersThreshold uint64
	Cosigners          []common.Address
	CosignersThreshold uint64
}

Jump to

Keyboard shortcuts

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