partial

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetHashToBytes

func AssetHashToBytes(hash string, blinded bool) ([]byte, error)

AssetHashToBytes reverse decode from hex string and reverse it adding a 0x01 byte for ublinded asset

Types

type ConfidentialWitnessUtxo

type ConfidentialWitnessUtxo struct {
	AssetCommitment string
	ValueCommitment string
	Script          []byte
	Nonce           []byte
	RangeProof      []byte
	SurjectionProof []byte
}

ConfidentialWitnessUtxo defines a confidential witness utxo

type Partial

type Partial struct {
	Data    *pset.Pset
	Network *network.Network
}

Partial defines a Partial Signed Elements Transaction

func NewPartial

func NewPartial(net *network.Network) *Partial

NewPartial returns a Partial instance with an empty pset in Partial.Data and the selected Network

func (*Partial) AddBlindedInput

func (p *Partial) AddBlindedInput(hash string, index uint32, witnessUtxo *ConfidentialWitnessUtxo, nonWitnessUtxo []byte) error

AddBlindedInput adds an utxo to a Partial Signed Elements Transaction

func (*Partial) AddInput

func (p *Partial) AddInput(hash string, index uint32, witnessUtxo *WitnessUtxo, nonWitnessUtxo []byte) error

AddInput adds an utxo to a Partial Signed Elements Transaction

func (*Partial) AddOutput

func (p *Partial) AddOutput(asset string, value uint64, script []byte, blinded bool) error

AddOutput adds an output to a Partial Signed Elements Transaction

func (*Partial) BlindWithKeys

func (p *Partial) BlindWithKeys(blindingPrivateKeys [][]byte, blindingPublicKeys [][]byte) error

BlindWithKeys unblinds all the inputs and blinds all the outputs with the provided arrays of keys

func (*Partial) SignWithPrivateKey

func (p *Partial) SignWithPrivateKey(index int, keyPair *keypair.KeyPair) error

SignWithPrivateKey signs a witness input with a provided EC private key

type WitnessUtxo

type WitnessUtxo struct {
	Asset  string
	Value  uint64
	Script []byte
}

WitnessUtxo defines a witness utxo

Jump to

Keyboard shortcuts

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