confidential

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 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 ElementsToSatoshiValue

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

ElementsToSatoshiValue method converts Elements value to Satoshi value

func FinalValueBlindingFactor

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

FinalValueBlindingFactor method generates blind sum

func NonceHash

func NonceHash(ctx *secp256k1.Context, pubKey, privKey []byte) (
	result [32]byte,
	err error,
)

NonceHash method generates hashed secret based on ecdh

func RangeProof

func RangeProof(input RangeProofInput) ([]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 SurjectionProofInput) ([]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 FinalValueBlindingFactorInput

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

type RangeProofInput

type RangeProofInput struct {
	Value               uint64
	BlindingPubkey      []byte
	EphemeralPrivkey    []byte
	Asset               []byte
	AssetBlindingFactor []byte
	ValueBlindFactor    [32]byte
	ValueCommit         []byte
	ScriptPubkey        []byte
	MinValue            uint64
	Exp                 int
	MinBits             int
}

type SurjectionProofInput

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

type UnblindInput

type UnblindInput struct {
	EphemeralPubkey []byte
	BlindingPrivkey []byte
	Rangeproof      []byte
	ValueCommit     secp256k1.Commitment
	Asset           []byte
	ScriptPubkey    []byte
}

type UnblindOutputResult

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

func UnblindOutput

func UnblindOutput(input UnblindInput) (*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