walletutils

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor struct {
	node.WalletNode
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(walletNode node.WalletNode, policyStorage *policy.Storage, walletsStorage *walletstorage.Storage) Processor

NewProcessor constructs the wallet utility processor with the storages and TEE capabilities it relies on.

func (*Processor) KeyDataProviderRestore

func (p *Processor) KeyDataProviderRestore(
	ctx context.Context,
	submissionTag types.SubmissionTag,
	dataFixed *instruction.DataFixed,
	variableMessages []hexutil.Bytes,
	_ []common.Address,
	_ *cpolicy.SigningPolicy,
) ([]byte, []byte, error)

KeyDataProviderRestore reconstructs a wallet key from provider shares and emits a signed existence proof when successful. Shares are the restore credential: each is wallet-key signed and was ECIES-encrypted to its holder.

func (*Processor) KeyDelete

func (p *Processor) KeyDelete(
	ctx context.Context,
	submissionTag types.SubmissionTag,
	dataFixed *instruction.DataFixed,
	_ []hexutil.Bytes,
	_ []common.Address,
	_ *cpolicy.SigningPolicy,
) ([]byte, []byte, error)

KeyDelete processes key removal instructions and enforces nonce-based replay protection.

func (*Processor) KeyDirectBackup added in v0.0.21

func (p *Processor) KeyDirectBackup(
	ctx context.Context,
	submissionTag types.SubmissionTag,
	dataFixed *instruction.DataFixed,
	_ []hexutil.Bytes,
	_ []common.Address,
	_ *cpolicy.SigningPolicy,
) ([]byte, []byte, error)

KeyDirectBackup ECIES-encrypts the wallet's private key for the destination's public key, embeds the ciphertext alongside the plaintext BackupID and wallet configuration in a payload, signs the payload with this TEE's identity key, and returns the envelope. The produced blob is stateless with respect to the destination's per-key nonce.

func (*Processor) KeyDirectRestore added in v0.0.21

func (p *Processor) KeyDirectRestore(
	ctx context.Context,
	submissionTag types.SubmissionTag,
	dataFixed *instruction.DataFixed,
	_ []hexutil.Bytes,
	_ []common.Address,
	_ *cpolicy.SigningPolicy,
) ([]byte, []byte, error)

KeyDirectRestore verifies the source TEE's signature over the payload carried in dataFixed.AdditionalFixedMessage, cross-checks the payload's BackupID against the quorum-signed BackupId in the instruction, ECIES-decrypts the embedded private key, and stores the wallet locally. The request is rejected if the (source, this TEE) pair is not authorized by the current machine-path list, if the instruction's machine-path-list nonce is above the node's, or if the BackupID's reward epoch falls outside {current, current+1}.

func (*Processor) KeyGenerate

func (p *Processor) KeyGenerate(
	ctx context.Context,
	submissionTag types.SubmissionTag,
	dataFixed *instruction.DataFixed,
	_ []hexutil.Bytes,
	_ []common.Address,
	_ *cpolicy.SigningPolicy,
) ([]byte, []byte, error)

KeyGenerate handles wallet key creation instructions, persisting the new key and returning a signed existence proof.

Jump to

Keyboard shortcuts

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