pegout

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PegoutAmountMinimum int64 = 100000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pegout

type Pegout interface {
	// CreateOnlinePrivateKey This function generate random private key for online key.
	CreateOnlinePrivateKey() (privkey *types.Privkey, err error)
	// CreatePakEntry This function create the PAK-Entry.
	CreatePakEntry(
		accountExtPubkey *types.ExtPubkey,
		onlinePrivkey *types.Privkey,
	) (pakEntry *types.ByteData, err error)
	// CreatePegoutAddress This function create the pegout address for bitcoin network.
	CreatePegoutAddress(
		addressType types.AddressType,
		accountExtPubkey *types.ExtPubkey,
		addressIndex uint32,
	) (pegoutAddress *types.Address, baseDescriptor *types.Descriptor, err error)
	// CreatePegoutTransaction This function create the pegout transaction.
	CreatePegoutTransaction(
		utxoList []*types.ElementsUtxoData,
		pegoutData types.InputConfidentialTxOut,
		sendList *[]types.InputConfidentialTxOut,
		changeAddress *string,
		option *types.PegoutTxOption,
	) (
		tx *types.ConfidentialTx,
		pegoutAddress *types.Address,
		unblindTx *types.ConfidentialTx,
		err error,
	)
	// VerifyPubkeySignature This function validate the signature by pubkey.
	VerifyPubkeySignature(
		proposalTx *types.ConfidentialTx,
		utxoData *types.ElementsUtxoData,
		signature *types.ByteData,
	) (isVerify bool, err error)
	// ContainsPakEntry checks if a pakEntry is included in the whitelist.
	ContainsPakEntry(pakEntry *types.ByteData, whitelist string) (exist bool, err error)
}

Pegout This interface defines the API used by the pegout function.

type PegoutService

type PegoutService struct {
	cfdErrors.HasInitializeError
	// contains filtered or unexported fields
}

PegoutService This struct is implements pegout api.

func NewPegoutService

func NewPegoutService(options ...config.CfdConfigOption) *PegoutService

NewPegoutService returns an object that defines the API for Pegout.

func (*PegoutService) ContainsPakEntry

func (p *PegoutService) ContainsPakEntry(pakEntry *types.ByteData, whitelist string) (exist bool, err error)

func (*PegoutService) CreateOnlinePrivateKey

func (p *PegoutService) CreateOnlinePrivateKey() (privkey *types.Privkey, err error)

CreateOnlinePrivateKey This function generate random private key for online key.

func (*PegoutService) CreatePakEntry

func (p *PegoutService) CreatePakEntry(
	accountExtPubkey *types.ExtPubkey,
	onlinePrivkey *types.Privkey,
) (pakEntry *types.ByteData, err error)

CreatePakEntry This function create the PAK-Entry.

func (*PegoutService) CreatePegoutAddress

func (p *PegoutService) CreatePegoutAddress(
	addressType types.AddressType,
	accountExtPubkey *types.ExtPubkey,
	addressIndex uint32,
) (pegoutAddress *types.Address, baseDescriptor *types.Descriptor, err error)

CreatePegoutAddress This function create the pegout address for bitcoin network.

func (*PegoutService) CreatePegoutTransaction

func (p *PegoutService) CreatePegoutTransaction(
	utxoList []*types.ElementsUtxoData,
	pegoutData types.InputConfidentialTxOut,
	sendList *[]types.InputConfidentialTxOut,
	changeAddress *string,
	option *types.PegoutTxOption,
) (tx *types.ConfidentialTx, pegoutAddress *types.Address, unblindTx *types.ConfidentialTx, err error)

CreatePegoutTransaction This function create the pegout transaction.

func (*PegoutService) IsNeedDummyBlind

func (p *PegoutService) IsNeedDummyBlind(
	utxoList []*types.ElementsUtxoData,
	txinList []types.ConfidentialTxIn,
	txoutList []types.ConfidentialTxOut,
) bool

func (*PegoutService) VerifyPubkeySignature

func (p *PegoutService) VerifyPubkeySignature(
	proposalTx *types.ConfidentialTx,
	utxoData *types.ElementsUtxoData,
	signature *types.ByteData,
) (isVerify bool, err error)

VerifyPubkeySignature This function validate the signature by pubkey.

func (*PegoutService) WithBitcoinAddressApi

func (p *PegoutService) WithBitcoinAddressApi(addressApi address.AddressApi) *PegoutService

WithBitcoinAddressApi This function set a bitcoin address api.

func (*PegoutService) WithConfidentialTxApi

func (p *PegoutService) WithConfidentialTxApi(confidentialTxApi transaction.ConfidentialTxApi) *PegoutService

WithConfidentialTxApi This function set a confidential transaction api.

func (*PegoutService) WithElementsDescriptorApi

func (p *PegoutService) WithElementsDescriptorApi(descriptorApi descriptor.DescriptorApi) *PegoutService

WithElementsDescriptorApi This function set a elements descriptor api.

func (*PegoutService) WithPubkeyApi

func (p *PegoutService) WithPubkeyApi(pubkeyApi key.PubkeyApi) *PegoutService

WithPubkeyApi This function set a pubkey api.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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