Documentation ¶
Overview ¶
Package bulletproofs manages the creation, proving & verification of Bulletproofs. This is a class of compact-sized range proof that require no trusted setup.
to match names in the crypto protocol
Index ¶
- Variables
- func ConvertUint64ToBinary(number uint64, n int) []*operation.Scalar
- func CopyPedersenCommitmentScheme(sch operation.PedersenCommitment) operation.PedersenCommitment
- func EstimateMultiRangeProofSize(nOutput int) uint64
- func VerifyBatch(proofs []*AggregatedRangeProof) (bool, error, int)
- type AggregatedRangeProof
- func (proof AggregatedRangeProof) Bytes() []byte
- func (proof AggregatedRangeProof) GetCommitments() []*operation.Point
- func (proof *AggregatedRangeProof) Init()
- func (proof AggregatedRangeProof) IsNil() bool
- func (proof *AggregatedRangeProof) SetBytes(bytes []byte) error
- func (proof *AggregatedRangeProof) SetCommitments(cmsValue []*operation.Point)
- func (proof AggregatedRangeProof) ValidateSanity() bool
- func (proof AggregatedRangeProof) Verify() (bool, error)
- func (proof AggregatedRangeProof) VerifyFaster() (bool, error)
- func (proof AggregatedRangeProof) VerifyFasterUsingBase(anAssetTag *operation.Point) (bool, error)
- func (proof AggregatedRangeProof) VerifyUsingBase(anAssetTag *operation.Point) (bool, error)
- type AggregatedRangeWitness
- type InnerProductProof
- func (proof InnerProductProof) Bytes() []byte
- func (proof *InnerProductProof) Init() *InnerProductProof
- func (proof *InnerProductProof) SetBytes(bytes []byte) error
- func (proof InnerProductProof) ValidateSanity() bool
- func (proof InnerProductProof) Verify(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, ...) bool
- func (proof InnerProductProof) VerifyFaster(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, ...) bool
- type InnerProductWitness
Constants ¶
This section is empty.
Variables ¶
var AggParam = newBulletproofParams(privacy_util.MaxOutputCoin)
var Logger = logger{}
Global instant to use
Functions ¶
func ConvertUint64ToBinary ¶
ConvertIntToBinary represents a integer number in binary
func CopyPedersenCommitmentScheme ¶
func CopyPedersenCommitmentScheme(sch operation.PedersenCommitment) operation.PedersenCommitment
CopyPedersenCommitmentScheme is called upon package initialization to make a clone of generators.
func EstimateMultiRangeProofSize ¶
EstimateMultiRangeProofSize returns the upper bound of Bulletproof size given the number of output coins.
func VerifyBatch ¶
func VerifyBatch(proofs []*AggregatedRangeProof) (bool, error, int)
VerifyBatch verifies a list of Bulletproofs in batched fashion. It saves time by using a multi-exponent operation.
Types ¶
type AggregatedRangeProof ¶
type AggregatedRangeProof struct {
// contains filtered or unexported fields
}
AggregatedRangeProof is the struct for Bulletproof. The statement being proven is that output coins' values are in the uint64 range.
func (AggregatedRangeProof) Bytes ¶
func (proof AggregatedRangeProof) Bytes() []byte
Bytes does byte-marshalling
func (AggregatedRangeProof) GetCommitments ¶
func (proof AggregatedRangeProof) GetCommitments() []*operation.Point
GetCommitments is the getter for cmsValueGetCommitments() []*operation.Point
func (*AggregatedRangeProof) Init ¶
func (proof *AggregatedRangeProof) Init()
Init creates an allocated, blank AggregatedRangeProof object
func (AggregatedRangeProof) IsNil ¶
func (proof AggregatedRangeProof) IsNil() bool
IsNil returns true if any field in this proof is nil
func (*AggregatedRangeProof) SetBytes ¶
func (proof *AggregatedRangeProof) SetBytes(bytes []byte) error
func (*AggregatedRangeProof) SetCommitments ¶
func (proof *AggregatedRangeProof) SetCommitments(cmsValue []*operation.Point)
func (AggregatedRangeProof) ValidateSanity ¶
func (proof AggregatedRangeProof) ValidateSanity() bool
ValidateSanity performs sanity checks for this proof.
func (AggregatedRangeProof) Verify ¶
func (proof AggregatedRangeProof) Verify() (bool, error)
Verify does verification for this Bulletproof. No view into chain data is needed.
func (AggregatedRangeProof) VerifyFaster ¶
func (proof AggregatedRangeProof) VerifyFaster() (bool, error)
func (AggregatedRangeProof) VerifyFasterUsingBase ¶
func (proof AggregatedRangeProof) VerifyFasterUsingBase(anAssetTag *operation.Point) (bool, error)
func (AggregatedRangeProof) VerifyUsingBase ¶
func (proof AggregatedRangeProof) VerifyUsingBase(anAssetTag *operation.Point) (bool, error)
VerifyUsingBase runs like the Bulletproof Verify function, except it sets a Pederson base point before verifying.
type AggregatedRangeWitness ¶
type AggregatedRangeWitness struct {
// contains filtered or unexported fields
}
AggregatedRangeWitness contains the prover's secret data (the actual values to be proven & the generated random blinders) needed for creating a range proof.
func TransformWitnessToCAWitness ¶
func TransformWitnessToCAWitness(wit *AggregatedRangeWitness, assetTagBlinders []*operation.Scalar) (*AggregatedRangeWitness, error)
TransformWitnessToCAWitness does base transformation. Our Bulletproof(G_r) scheme is parameterized by a base G_r. PRV transfers' Bulletproofs use a fixed N.U.M.S point for G_r.
Confidential Asset transfers use G_r = G_at, which is a blinded asset tag. This function will return a suitable witness for Bulletproof(G_at).
func (AggregatedRangeWitness) Prove ¶
func (wit AggregatedRangeWitness) Prove() (*AggregatedRangeProof, error)
func (AggregatedRangeWitness) ProveUsingBase ¶
func (wit AggregatedRangeWitness) ProveUsingBase(anAssetTag *operation.Point) (*AggregatedRangeProof, error)
ProveUsingBase runs like the Bulletproof Prove function, except it sets a Pederson base point before proving.
func (*AggregatedRangeWitness) Set ¶
func (wit *AggregatedRangeWitness) Set(values []uint64, rands []*operation.Scalar)
type InnerProductProof ¶
type InnerProductProof struct {
// contains filtered or unexported fields
}
func (InnerProductProof) Bytes ¶
func (proof InnerProductProof) Bytes() []byte
func (*InnerProductProof) Init ¶
func (proof *InnerProductProof) Init() *InnerProductProof
func (*InnerProductProof) SetBytes ¶
func (proof *InnerProductProof) SetBytes(bytes []byte) error
func (InnerProductProof) ValidateSanity ¶
func (proof InnerProductProof) ValidateSanity() bool
func (InnerProductProof) Verify ¶
func (proof InnerProductProof) Verify(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, hashCache []byte) bool
func (InnerProductProof) VerifyFaster ¶
func (proof InnerProductProof) VerifyFaster(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, hashCache []byte) bool
type InnerProductWitness ¶
type InnerProductWitness struct {
// contains filtered or unexported fields
}
func (InnerProductWitness) Prove ¶
func (wit InnerProductWitness) Prove(GParam []*operation.Point, HParam []*operation.Point, uParam *operation.Point, hashCache []byte) (*InnerProductProof, error)