confidential

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 6 Imported by: 9

Documentation

Index

Constants

View Source
const (
	ElementsUnconfidentialValueLength = 9
)

Variables

This section is empty.

Functions

func AssetCommitment

func AssetCommitment(asset []byte, factor []byte) (result [33]byte, err error)

AssetCommitment method generates asset commitment

func CommitmentFromBytes added in v0.0.3

func CommitmentFromBytes(commit []byte) (*secp256k1.Commitment, error)

CommitmentFromBytes parses a raw commitment. This should be moved into go-secp256k1-zkp library, check out https://github.com/vulpemventures/go-elements/pull/79#discussion_r435315406

func ElementsToSatoshiValue

func ElementsToSatoshiValue(val [ElementsUnconfidentialValueLength]byte) (
	result uint64,
	err error,
)

ElementsToSatoshiValue method converts Elements value to Satoshi value

func FinalValueBlindingFactor

func FinalValueBlindingFactor(input FinalValueBlindingFactorArg) (
	[32]byte,
	error,
)

FinalValueBlindingFactor method generates blind sum

func NonceHash

func NonceHash(pubKey, privKey []byte) (
	result [32]byte,
	err error,
)

NonceHash method generates hashed secret based on ecdh

func RangeProof

func RangeProof(input RangeProofArg) ([]byte, error)

RangeProof method calculates range proof

func SatoshiToElementsValue

func SatoshiToElementsValue(val uint64) (
	result [ElementsUnconfidentialValueLength]byte,
	err error,
)

SatoshiToElementsValue method converts Satoshi value to Elements value

func SurjectionProof

func SurjectionProof(input SurjectionProofArg) ([]byte, error)

SurjectionProof method generates surjection proof

func ValueCommitment

func ValueCommitment(value uint64, generator []byte, factor []byte) (
	result [33]byte,
	err error,
)

ValueCommitment method generates value commitment

Types

type FinalValueBlindingFactorArg added in v0.0.3

type FinalValueBlindingFactorArg struct {
	InValues      []uint64
	OutValues     []uint64
	InGenerators  [][]byte
	OutGenerators [][]byte
	InFactors     [][]byte
	OutFactors    [][]byte
}

type RangeProofArg added in v0.0.3

type RangeProofArg struct {
	Value               uint64
	Nonce               [32]byte
	Asset               []byte
	AssetBlindingFactor []byte
	ValueBlindFactor    [32]byte
	ValueCommit         []byte
	ScriptPubkey        []byte
	MinValue            uint64
	Exp                 int
	MinBits             int
}

type SurjectionProofArg added in v0.0.3

type SurjectionProofArg struct {
	OutputAsset               []byte
	OutputAssetBlindingFactor []byte
	InputAssets               [][]byte
	InputAssetBlindingFactors [][]byte
	Seed                      []byte
}

type UnblindOutputArg added in v0.0.3

type UnblindOutputArg struct {
	Nonce           [32]byte
	Rangeproof      []byte
	ValueCommitment []byte
	AssetCommitment []byte
	ScriptPubkey    []byte
}

type UnblindOutputResult

type UnblindOutputResult struct {
	Value               uint64
	Asset               []byte
	ValueBlindingFactor []byte
	AssetBlindingFactor []byte
}

func UnblindOutput

func UnblindOutput(input UnblindOutputArg) (*UnblindOutputResult, error)

UnblindOutput method unblinds confidential transaction output

Jump to

Keyboard shortcuts

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