Documentation ¶
Index ¶
- Constants
- Variables
- func GetFixedRandomnessShardID() operation.Scalar
- func InitCheckpoint(bcHeightNewZKP uint64) error
- func IsNewOneOfManyProof(lockTime int64) bool
- func IsNewZKP(bcHeight uint64) bool
- type PaymentProof
- func (proof PaymentProof) Bytes() []byte
- func (proof *PaymentProof) CheckCommitmentWithStateDB(commitmentsList [][]byte, db *statedb.StateDB, tokenID *common.Hash, ...) error
- func (proof PaymentProof) GetAggregatedRangeProof() agg_interface.AggregatedRangeProof
- func (proof PaymentProof) GetCommitmentIndices() []uint64
- func (proof PaymentProof) GetCommitmentInputSND() []*operation.Point
- func (proof PaymentProof) GetCommitmentInputSecretKey() *operation.Point
- func (proof PaymentProof) GetCommitmentInputShardID() *operation.Point
- func (proof PaymentProof) GetCommitmentInputValue() []*operation.Point
- func (proof PaymentProof) GetCommitmentOutputSND() []*operation.Point
- func (proof PaymentProof) GetCommitmentOutputShardID() []*operation.Point
- func (proof PaymentProof) GetCommitmentOutputValue() []*operation.Point
- func (proof PaymentProof) GetInputCoins() []coin.PlainCoin
- func (proof PaymentProof) GetOneOfManyProof() []*oneoutofmany.OneOutOfManyProof
- func (proof PaymentProof) GetOutputCoins() []coin.Coin
- func (proof PaymentProof) GetSerialNumberNoPrivacyProof() []*serialnumbernoprivacy.SNNoPrivacyProof
- func (proof PaymentProof) GetSerialNumberProof() []*serialnumberprivacy.SNPrivacyProof
- func (proof *PaymentProof) GetVersion() uint8
- func (proof *PaymentProof) Init()
- func (proof *PaymentProof) IsPrivacy() bool
- func (proof *PaymentProof) LoadCommitmentFromStateDB(db *statedb.StateDB, tokenID *common.Hash, shardID byte) error
- func (proof *PaymentProof) LoadDataFromStateDB(db *statedb.StateDB, tokenID *common.Hash, shardID byte) ([][]byte, error)
- func (proof PaymentProof) MarshalJSON() ([]byte, error)
- func (proof *PaymentProof) SetAggregatedRangeProof(aggregatedRangeProof *aggregatedrange.AggregatedRangeProof)
- func (proof *PaymentProof) SetBytes(proofbytes []byte) *errhandler.PrivacyError
- func (proof *PaymentProof) SetCommitment(commitmentsList [][]byte, tokenID *common.Hash, shardID byte) error
- func (proof *PaymentProof) SetCommitmentInputSND(commitmentInputSND []*operation.Point)
- func (proof *PaymentProof) SetCommitmentInputValue(commitmentInputValue []*operation.Point)
- func (proof *PaymentProof) SetCommitmentShardID(commitmentShardID *operation.Point)
- func (proof *PaymentProof) SetInputCoins(v []coin.PlainCoin) error
- func (proof *PaymentProof) SetOneOfManyProof(oneOfManyProof []*oneoutofmany.OneOutOfManyProof)
- func (proof *PaymentProof) SetOutputCoins(v []coin.Coin) error
- func (proof *PaymentProof) SetSerialNumberNoPrivacyProof(serialNumberNoPrivacyProof []*serialnumbernoprivacy.SNNoPrivacyProof)
- func (proof *PaymentProof) SetSerialNumberProof(serialNumberProof []*serialnumberprivacy.SNPrivacyProof)
- func (proof *PaymentProof) UnmarshalJSON(data []byte) error
- func (proof PaymentProof) ValidateSanity(vEnv env.ValidationEnviroment) (bool, error)
- func (proof PaymentProof) Verify(boolParams map[string]bool, pubKey key.PublicKey, fee uint64, shardID byte, ...) (bool, error)
- func (proof PaymentProof) VerifySanityData(vEnv env.ValidationEnviroment) (bool, error)
- func (proof PaymentProof) VerifyV2(vEnv env.ValidationEnviroment, fee uint64) (bool, error)
- type PaymentV1Logger
- type PaymentWitness
- type PaymentWitnessParam
Constants ¶
View Source
const FixedRandomnessString = "fixedrandomness"
Variables ¶
View Source
var FixedRandomnessShardID = new(operation.Scalar).FromBytesS([]byte{0x60, 0xa2, 0xab, 0x35, 0x26, 0x9, 0x97, 0x7c, 0x6b, 0xe1, 0xba, 0xec, 0xbf, 0x64, 0x27, 0x2, 0x6a, 0x9c, 0xe8, 0x10, 0x9e, 0x93, 0x4a, 0x0, 0x47, 0x83, 0x15, 0x48, 0x63, 0xeb, 0xda, 0x6})
FixedRandomnessShardID is fixed randomness for shardID commitment from param.BCHeightBreakPointFixRandShardCM is result from HashToScalar([]byte(privacy.FixedRandomnessString))
View Source
var Logger = PaymentV1Logger{}
Global instant to use
Functions ¶
func InitCheckpoint ¶
func IsNewOneOfManyProof ¶
Types ¶
type PaymentProof ¶
type PaymentProof struct {
// contains filtered or unexported fields
}
PaymentProof contains all of PoK for spending coin
func (PaymentProof) Bytes ¶
func (proof PaymentProof) Bytes() []byte
func (*PaymentProof) CheckCommitmentWithStateDB ¶
func (PaymentProof) GetAggregatedRangeProof ¶
func (proof PaymentProof) GetAggregatedRangeProof() agg_interface.AggregatedRangeProof
func (PaymentProof) GetCommitmentIndices ¶
func (proof PaymentProof) GetCommitmentIndices() []uint64
func (PaymentProof) GetCommitmentInputSND ¶
func (proof PaymentProof) GetCommitmentInputSND() []*operation.Point
func (PaymentProof) GetCommitmentInputSecretKey ¶
func (proof PaymentProof) GetCommitmentInputSecretKey() *operation.Point
func (PaymentProof) GetCommitmentInputShardID ¶
func (proof PaymentProof) GetCommitmentInputShardID() *operation.Point
func (PaymentProof) GetCommitmentInputValue ¶
func (proof PaymentProof) GetCommitmentInputValue() []*operation.Point
func (PaymentProof) GetCommitmentOutputSND ¶
func (proof PaymentProof) GetCommitmentOutputSND() []*operation.Point
func (PaymentProof) GetCommitmentOutputShardID ¶
func (proof PaymentProof) GetCommitmentOutputShardID() []*operation.Point
func (PaymentProof) GetCommitmentOutputValue ¶
func (proof PaymentProof) GetCommitmentOutputValue() []*operation.Point
func (PaymentProof) GetInputCoins ¶
func (proof PaymentProof) GetInputCoins() []coin.PlainCoin
func (PaymentProof) GetOneOfManyProof ¶
func (proof PaymentProof) GetOneOfManyProof() []*oneoutofmany.OneOutOfManyProof
GET/SET function
func (PaymentProof) GetOutputCoins ¶
func (proof PaymentProof) GetOutputCoins() []coin.Coin
func (PaymentProof) GetSerialNumberNoPrivacyProof ¶
func (proof PaymentProof) GetSerialNumberNoPrivacyProof() []*serialnumbernoprivacy.SNNoPrivacyProof
func (PaymentProof) GetSerialNumberProof ¶
func (proof PaymentProof) GetSerialNumberProof() []*serialnumberprivacy.SNPrivacyProof
func (*PaymentProof) GetVersion ¶
func (proof *PaymentProof) GetVersion() uint8
func (*PaymentProof) IsPrivacy ¶
func (proof *PaymentProof) IsPrivacy() bool
func (*PaymentProof) LoadCommitmentFromStateDB ¶
func (*PaymentProof) LoadDataFromStateDB ¶
func (PaymentProof) MarshalJSON ¶
func (proof PaymentProof) MarshalJSON() ([]byte, error)
func (*PaymentProof) SetAggregatedRangeProof ¶
func (proof *PaymentProof) SetAggregatedRangeProof(aggregatedRangeProof *aggregatedrange.AggregatedRangeProof)
func (*PaymentProof) SetBytes ¶
func (proof *PaymentProof) SetBytes(proofbytes []byte) *errhandler.PrivacyError
func (*PaymentProof) SetCommitment ¶
func (*PaymentProof) SetCommitmentInputSND ¶
func (proof *PaymentProof) SetCommitmentInputSND(commitmentInputSND []*operation.Point)
func (*PaymentProof) SetCommitmentInputValue ¶
func (proof *PaymentProof) SetCommitmentInputValue(commitmentInputValue []*operation.Point)
func (*PaymentProof) SetCommitmentShardID ¶
func (proof *PaymentProof) SetCommitmentShardID(commitmentShardID *operation.Point)
func (*PaymentProof) SetInputCoins ¶
func (proof *PaymentProof) SetInputCoins(v []coin.PlainCoin) error
func (*PaymentProof) SetOneOfManyProof ¶
func (proof *PaymentProof) SetOneOfManyProof(oneOfManyProof []*oneoutofmany.OneOutOfManyProof)
func (*PaymentProof) SetOutputCoins ¶
func (proof *PaymentProof) SetOutputCoins(v []coin.Coin) error
SetOutputCoins's input should be all coinv1
func (*PaymentProof) SetSerialNumberNoPrivacyProof ¶
func (proof *PaymentProof) SetSerialNumberNoPrivacyProof(serialNumberNoPrivacyProof []*serialnumbernoprivacy.SNNoPrivacyProof)
func (*PaymentProof) SetSerialNumberProof ¶
func (proof *PaymentProof) SetSerialNumberProof(serialNumberProof []*serialnumberprivacy.SNPrivacyProof)
func (*PaymentProof) UnmarshalJSON ¶
func (proof *PaymentProof) UnmarshalJSON(data []byte) error
func (PaymentProof) ValidateSanity ¶
func (proof PaymentProof) ValidateSanity(vEnv env.ValidationEnviroment) (bool, error)
func (PaymentProof) VerifySanityData ¶
func (proof PaymentProof) VerifySanityData( vEnv env.ValidationEnviroment, ) ( bool, error, )
Validate all of conditions
func (PaymentProof) VerifyV2 ¶
func (proof PaymentProof) VerifyV2( vEnv env.ValidationEnviroment, fee uint64, ) ( bool, error, )
type PaymentV1Logger ¶
func (*PaymentV1Logger) Init ¶
func (logger *PaymentV1Logger) Init(inst common.Logger)
type PaymentWitness ¶
type PaymentWitness struct {
// contains filtered or unexported fields
}
PaymentWitness contains all of witness for proving when spending coins
func (PaymentWitness) GetRandSecretKey ¶
func (paymentWitness PaymentWitness) GetRandSecretKey() *operation.Scalar
func (*PaymentWitness) Init ¶
func (wit *PaymentWitness) Init(PaymentWitnessParam PaymentWitnessParam) *errhandler.PrivacyError
Build prepares witnesses for all protocol need to be proved when create tx if hashPrivacy = false, witness includes spending key, input coins, output coins otherwise, witness includes all attributes in PaymentWitness struct
func (*PaymentWitness) Prove ¶
func (wit *PaymentWitness) Prove(hasPrivacy bool, paymentInfo []*key.PaymentInfo) (*PaymentProof, *errhandler.PrivacyError)
Prove creates big proof
Source Files ¶
Click to show internal directories.
Click to hide internal directories.