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 EstimateMultiRangeProofSize(nOutput int) uint64
- func GetFirstAssetTag(coins []*coin.CoinV2) (*operation.Point, error)
- func VerifyBatch(proofs []*AggregatedRangeProof, gvalLst []*operation.Point) (bool, error)
- type AggregatedRangeProof
- func (proof AggregatedRangeProof) Bytes() []byte
- func (proof AggregatedRangeProof) GetCommitments() []*operation.Point
- func (proof AggregatedRangeProof) GetVersion() uint8
- 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) VerifyUsingBase(gval *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)
AggParam contains global Bulletproofs parameters `g, h, u, cs`
var EnableFixBulletProofv2 = false
var Logger = logger{}
Global instant to use
Functions ¶
func ConvertUint64ToBinary ¶
ConvertIntToBinary represents a integer number in binary
func EstimateMultiRangeProofSize ¶
EstimateMultiRangeProofSize returns the upper bound of Bulletproof size given the number of output coins.
func GetFirstAssetTag ¶
GetFirstAssetTag is a helper that returns the asset tag field of the first coin from the input. That will be used as g_value when proving.
func VerifyBatch ¶
func VerifyBatch(proofs []*AggregatedRangeProof, gvalLst []*operation.Point) (bool, error)
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 marshals the proof into a byte slice
func (AggregatedRangeProof) GetCommitments ¶
func (proof AggregatedRangeProof) GetCommitments() []*operation.Point
func (AggregatedRangeProof) GetVersion ¶
func (proof AggregatedRangeProof) GetVersion() uint8
func (*AggregatedRangeProof) Init ¶
func (proof *AggregatedRangeProof) Init()
Init allocates all members of an 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
SetBytes unmarshals the proof from a byte slice
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 this Bulletproof using an optimized algorithm. No view into chain data is needed.
func (AggregatedRangeProof) VerifyUsingBase ¶
func (proof AggregatedRangeProof) VerifyUsingBase(gval *operation.Point) (bool, error)
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(gval *operation.Point) (*AggregatedRangeProof, error)
ProveUsingBase runs like the Bulletproof Prove function, except it sets a Pedersen base point before proving.
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
type InnerProductWitness ¶
type InnerProductWitness struct {
// contains filtered or unexported fields
}