Documentation ¶
Index ¶
- Constants
- func ComputeAssetTagBlinder(sharedSecret *operation.Point) (*operation.Scalar, error)
- func ComputeCommitmentCA(assetTag *operation.Point, r, v *operation.Scalar) (*operation.Point, error)
- func CreatePaymentInfosFromPlainCoinsAndAddress(c []PlainCoin, paymentAddress key.PaymentAddress, message []byte) []*key.PaymentInfo
- func DeriveShardInfoFromCoin(coinPubKey []byte) (int, int, int, error)
- func ParseOTAInfoToString(pubKey *operation.Point, txRandom *TxRandom) (string, string)
- type Coin
- type CoinObject
- type CoinParams
- type CoinV1
- func (c *CoinV1) Bytes() []byte
- func (c *CoinV1) CheckCoinValid(paymentAdd key.PaymentAddress, sharedRandom []byte, amount uint64) bool
- func (c CoinV1) Decrypt(keySet *incognitokey.KeySet) (PlainCoin, error)
- func (c *CoinV1) DoesCoinBelongToKeySet(keySet *incognitokey.KeySet) (bool, *operation.Point)
- func (c *CoinV1) Encrypt(recipientTK key.TransmissionKey) *errhandler.PrivacyError
- func (c CoinV1) GetAssetTag() *operation.Point
- func (c CoinV1) GetCoinDetailEncrypted() []byte
- func (c *CoinV1) GetCoinID() [operation.Ed25519KeySize]byte
- func (c CoinV1) GetCommitment() *operation.Point
- func (c CoinV1) GetInfo() []byte
- func (c CoinV1) GetKeyImage() *operation.Point
- func (c CoinV1) GetPublicKey() *operation.Point
- func (c CoinV1) GetRandomness() *operation.Scalar
- func (c CoinV1) GetSNDerivator() *operation.Scalar
- func (c CoinV1) GetShardID() (uint8, error)
- func (c CoinV1) GetSharedConcealRandom() *operation.Scalar
- func (c CoinV1) GetSharedRandom() *operation.Scalar
- func (c CoinV1) GetTxRandom() *TxRandom
- func (c CoinV1) GetValue() uint64
- func (c CoinV1) GetVersion() uint8
- func (c *CoinV1) Init() *CoinV1
- func (c CoinV1) IsEncrypted() bool
- func (c *CoinV1) SetBytes(bytes []byte) error
- type CoinV2
- func NewCoinCA(p *CoinParams, tokenID *common.Hash) (*CoinV2, *operation.Point, error)
- func NewCoinFromAmountAndReceiver(amount uint64, receiver key.PaymentAddress) (*CoinV2, error)
- func NewCoinFromAmountAndTxRandomBytes(amount uint64, publicKey *operation.Point, txRandom *TxRandom, info []byte) *CoinV2
- func NewCoinFromPaymentInfo(p *CoinParams) (*CoinV2, error)
- func (c CoinV2) Bytes() []byte
- func (c *CoinV2) CheckCoinValid(paymentAdd key.PaymentAddress, sharedRandom []byte, amount uint64) bool
- func (coin *CoinV2) ComputeCommitmentCA() (*operation.Point, error)
- func (c *CoinV2) ConcealInputCoin()
- func (c *CoinV2) ConcealOutputCoin(additionalData *operation.Point) error
- func (c *CoinV2) Decrypt(keySet *incognitokey.KeySet) (PlainCoin, error)
- func (c *CoinV2) DoesCoinBelongToKeySet(keySet *incognitokey.KeySet) (bool, *operation.Point)
- func (c CoinV2) GetAmount() *operation.Scalar
- func (c CoinV2) GetAssetTag() *operation.Point
- func (c CoinV2) GetCoinDetailEncrypted() []byte
- func (c *CoinV2) GetCoinID() [operation.Ed25519KeySize]byte
- func (c CoinV2) GetCommitment() *operation.Point
- func (c CoinV2) GetInfo() []byte
- func (c CoinV2) GetKeyImage() *operation.Point
- func (c CoinV2) GetPublicKey() *operation.Point
- func (c CoinV2) GetRandomness() *operation.Scalar
- func (c CoinV2) GetSNDerivator() *operation.Scalar
- func (c CoinV2) GetShardID() (uint8, error)
- func (c CoinV2) GetSharedConcealRandom() *operation.Scalar
- func (c CoinV2) GetSharedRandom() *operation.Scalar
- func (c *CoinV2) GetTokenId(keySet *incognitokey.KeySet, rawAssetTags map[string]*common.Hash) (*common.Hash, error)
- func (c CoinV2) GetTxRandom() *TxRandom
- func (c CoinV2) GetTxRandomDetail() (*operation.Point, *operation.Point, uint32, error)
- func (c CoinV2) GetValue() uint64
- func (c CoinV2) GetVersion() uint8
- func (c *CoinV2) HashH() *common.Hash
- func (c *CoinV2) Init() *CoinV2
- func (c CoinV2) IsEncrypted() bool
- func (c CoinV2) MarshalJSON() ([]byte, error)
- func (c CoinV2) ParseKeyImageWithPrivateKey(privKey key.PrivateKey) (*operation.Point, error)
- func (c CoinV2) ParsePrivateKeyOfCoin(privKey key.PrivateKey) (*operation.Scalar, error)
- func (coin *CoinV2) RecomputeSharedSecret(privateKey []byte) (*operation.Point, error)
- func (c *CoinV2) SetAmount(amount *operation.Scalar)
- func (c *CoinV2) SetAssetTag(at *operation.Point)
- func (c *CoinV2) SetBytes(coinBytes []byte) error
- func (c *CoinV2) SetCommitment(commitment *operation.Point)
- func (c *CoinV2) SetInfo(b []byte)
- func (c *CoinV2) SetKeyImage(keyImage *operation.Point)
- func (coin *CoinV2) SetPlainTokenID(tokenID *common.Hash) error
- func (c *CoinV2) SetPublicKey(publicKey *operation.Point)
- func (c *CoinV2) SetRandomness(mask *operation.Scalar)
- func (c *CoinV2) SetSharedConcealRandom(sharedConcealRandom *operation.Scalar)
- func (c *CoinV2) SetSharedRandom(sharedRandom *operation.Scalar)
- func (c *CoinV2) SetTxRandom(txRandom *TxRandom)
- func (c *CoinV2) SetTxRandomDetail(txConcealRandomPoint, txRandomPoint *operation.Point, index uint32)
- func (c *CoinV2) SetValue(value uint64)
- func (c *CoinV2) SetVersion(uint8)
- func (c *CoinV2) UnmarshalJSON(data []byte) error
- func (coin *CoinV2) ValidateAssetTag(sharedSecret *operation.Point, tokenID *common.Hash) (bool, error)
- type OTAReceiver
- func (recv OTAReceiver) Bytes() ([]byte, error)
- func (recv *OTAReceiver) FromAddress(addr key.PaymentAddress) error
- func (recv *OTAReceiver) FromString(data string) error
- func (recv OTAReceiver) GetShardID() byte
- func (recv OTAReceiver) IsValid() bool
- func (recv OTAReceiver) MarshalJSON() ([]byte, error)
- func (recv *OTAReceiver) SetBytes(b []byte) error
- func (recv OTAReceiver) String() (string, error)
- func (recv *OTAReceiver) UnmarshalJSON(raw []byte) error
- type PlainCoin
- type PlainCoinV1
- func (pc *PlainCoinV1) Bytes() []byte
- func (pc *PlainCoinV1) CommitAll() error
- func (pc *PlainCoinV1) ConcealOutputCoin(additionalData *operation.Point) error
- func (pc PlainCoinV1) GetAssetTag() *operation.Point
- func (pc PlainCoinV1) GetCoinDetailEncrypted() []byte
- func (pc PlainCoinV1) GetCommitment() *operation.Point
- func (pc PlainCoinV1) GetInfo() []byte
- func (pc PlainCoinV1) GetKeyImage() *operation.Point
- func (pc PlainCoinV1) GetPublicKey() *operation.Point
- func (pc PlainCoinV1) GetRandomness() *operation.Scalar
- func (pc PlainCoinV1) GetSNDerivator() *operation.Scalar
- func (pc *PlainCoinV1) GetShardID() (uint8, error)
- func (pc PlainCoinV1) GetSharedConcealRandom() *operation.Scalar
- func (pc PlainCoinV1) GetSharedRandom() *operation.Scalar
- func (pc PlainCoinV1) GetTxRandom() *TxRandom
- func (pc PlainCoinV1) GetValue() uint64
- func (*PlainCoinV1) GetVersion() uint8
- func (pc *PlainCoinV1) HashH() *common.Hash
- func (pc *PlainCoinV1) Init() *PlainCoinV1
- func (pc PlainCoinV1) IsEncrypted() bool
- func (pc PlainCoinV1) MarshalJSON() ([]byte, error)
- func (pc *PlainCoinV1) ParseCoinObjectToInputCoin(coinObj CoinObject) error
- func (pc PlainCoinV1) ParseKeyImageWithPrivateKey(privKey key.PrivateKey) (*operation.Point, error)
- func (pc PlainCoinV1) ParsePrivateKeyOfCoin(privKey key.PrivateKey) (*operation.Scalar, error)
- func (pc *PlainCoinV1) SetBytes(coinBytes []byte) error
- func (pc *PlainCoinV1) SetCommitment(v *operation.Point)
- func (pc *PlainCoinV1) SetInfo(v []byte)
- func (pc *PlainCoinV1) SetKeyImage(v *operation.Point)
- func (pc *PlainCoinV1) SetPublicKey(v *operation.Point)
- func (pc *PlainCoinV1) SetRandomness(v *operation.Scalar)
- func (pc *PlainCoinV1) SetSNDerivator(v *operation.Scalar)
- func (pc *PlainCoinV1) SetValue(v uint64)
- func (pc *PlainCoinV1) UnmarshalJSON(data []byte) error
- type TxRandom
- func (t TxRandom) Bytes() []byte
- func (t TxRandom) GetIndex() (uint32, error)
- func (t TxRandom) GetTxConcealRandomPoint() (*operation.Point, error)
- func (t TxRandom) GetTxOTARandomPoint() (*operation.Point, error)
- func (t *TxRandom) SetBytes(b []byte) error
- func (t *TxRandom) SetIndex(index uint32)
- func (t *TxRandom) SetTxConcealRandomPoint(txConcealRandom *operation.Point)
- func (t *TxRandom) SetTxOTARandomPoint(txRandom *operation.Point)
Constants ¶
const ( MaxSizeInfoCoin = 255 JsonMarshalFlag = 34 //nolint:revive CoinVersion1 = 1 CoinVersion2 = 2 TxRandomGroupSize = 68 )
const ( PedersenPrivateKeyIndex = operation.PedersenPrivateKeyIndex PedersenValueIndex = operation.PedersenValueIndex PedersenSndIndex = operation.PedersenSndIndex PedersenShardIDIndex = operation.PedersenShardIDIndex PedersenRandomnessIndex = operation.PedersenRandomnessIndex )
const ( PrivacyTypeTransfer = iota PrivacyTypeMint )
const MaxAttempts int = 50000
Variables ¶
This section is empty.
Functions ¶
func ComputeAssetTagBlinder ¶
func ComputeCommitmentCA ¶
func CreatePaymentInfosFromPlainCoinsAndAddress ¶
func CreatePaymentInfosFromPlainCoinsAndAddress(c []PlainCoin, paymentAddress key.PaymentAddress, message []byte) []*key.PaymentInfo
func DeriveShardInfoFromCoin ¶
DeriveShardInfoFromCoin returns the sender origin & receiver shard of a coin based on the PublicKey on that coin (encoded inside its last byte). Does not support MaxShardNumber > 8
Types ¶
type Coin ¶
type Coin interface { GetVersion() uint8 GetCommitment() *operation.Point GetInfo() []byte GetPublicKey() *operation.Point GetKeyImage() *operation.Point GetValue() uint64 GetRandomness() *operation.Scalar GetShardID() (uint8, error) GetSNDerivator() *operation.Scalar GetCoinDetailEncrypted() []byte IsEncrypted() bool GetTxRandom() *TxRandom GetAssetTag() *operation.Point GetCoinID() [operation.Ed25519KeySize]byte // DecryptOutputCoinByKey process outputcoin to get outputcoin data which relate to keyset // Param keyset: (private key, payment address, read only key) // in case private key: return unspent outputcoin tx // in case read only key: return all outputcoin tx with amount value // in case payment address: return all outputcoin tx with no amount value Decrypt(*incognitokey.KeySet) (PlainCoin, error) Bytes() []byte SetBytes([]byte) error CheckCoinValid(key.PaymentAddress, []byte, uint64) bool DoesCoinBelongToKeySet(keySet *incognitokey.KeySet) (bool, *operation.Point) }
func ArrayCoinV1ToCoin ¶
func NewCoinFromByte ¶
First byte should determine the version or json marshal "34"
func ParseCoinsFromBytes ¶
func ParseCoinsFromBytes(data []json.RawMessage) ([]Coin, error)
type CoinObject ¶
type CoinParams ¶
type CoinParams struct { key.PaymentInfo SenderShardID int CoinPrivacyType int }
CoinParams contains the necessary data to create a new coin
func (*CoinParams) From ¶
func (p *CoinParams) From(inf *key.PaymentInfo, sid, cptype int) *CoinParams
From initializes the CoinParam using input data (PaymentInfo must not be nil)
func (*CoinParams) FromPaymentInfo ¶
func (p *CoinParams) FromPaymentInfo(inf *key.PaymentInfo) *CoinParams
FromPaymentInfo initializes the CoinParam using a PaymentInfo (must not be nil); others are set to default
type CoinV1 ¶
type CoinV1 struct { CoinDetails *PlainCoinV1 CoinDetailsEncrypted *henc.HybridCipherText }
OutputCoin represents a output coin of transaction It contains CoinDetails and CoinDetailsEncrypted (encrypted value and randomness) CoinDetailsEncrypted is nil when you send tx without privacy
func ArrayCoinToCoinV1 ¶
func (*CoinV1) Bytes ¶
Bytes (OutputCoin) converts a output coin's details to a bytes array Each fields in coin is saved in len - body format
func (*CoinV1) CheckCoinValid ¶
func (*CoinV1) DoesCoinBelongToKeySet ¶
Check whether the utxo is from this address
func (*CoinV1) Encrypt ¶
func (c *CoinV1) Encrypt(recipientTK key.TransmissionKey) *errhandler.PrivacyError
Encrypt returns a ciphertext encrypting for a coin using a hybrid cryptosystem, in which AES encryption scheme is used as a data encapsulation scheme, and ElGamal cryptosystem is used as a key encapsulation scheme.
func (CoinV1) GetAssetTag ¶
func (CoinV1) GetCoinDetailEncrypted ¶
func (CoinV1) GetCommitment ¶
func (CoinV1) GetKeyImage ¶
func (CoinV1) GetPublicKey ¶
func (CoinV1) GetRandomness ¶
func (CoinV1) GetSNDerivator ¶
func (CoinV1) GetShardID ¶
func (CoinV1) GetSharedConcealRandom ¶
func (CoinV1) GetSharedRandom ¶
func (CoinV1) GetTxRandom ¶
func (CoinV1) GetVersion ¶
CoinV1 does not have index so return 0
func (CoinV1) IsEncrypted ¶
type CoinV2 ¶
type CoinV2 struct {
// contains filtered or unexported fields
}
CoinV2 is the struct that will be stored to db If not privacy, mask and amount will be the original randomness and value If has privacy, mask and amount will be as paper monero
func NewCoinFromAmountAndReceiver ¶
func NewCoinFromAmountAndReceiver(amount uint64, receiver key.PaymentAddress) (*CoinV2, error)
func NewCoinFromPaymentInfo ¶
func NewCoinFromPaymentInfo(p *CoinParams) (*CoinV2, error)
func (*CoinV2) CheckCoinValid ¶
func (*CoinV2) ComputeCommitmentCA ¶
func (*CoinV2) ConcealInputCoin ¶
func (c *CoinV2) ConcealInputCoin()
Conceal the input coin of a transaction: keep only the keyImage
func (*CoinV2) ConcealOutputCoin ¶
Conceal the amount of coin using the publicView of the receiver
- AdditionalData: must be the publicView of the receiver
func (*CoinV2) Decrypt ¶
func (c *CoinV2) Decrypt(keySet *incognitokey.KeySet) (PlainCoin, error)
Decrypt a coin using the corresponding KeySet
func (*CoinV2) DoesCoinBelongToKeySet ¶
Check whether the utxo is from this keyset
func (CoinV2) GetAssetTag ¶
func (CoinV2) GetCoinDetailEncrypted ¶
func (CoinV2) GetCommitment ¶
func (CoinV2) GetKeyImage ¶
func (CoinV2) GetPublicKey ¶
func (CoinV2) GetRandomness ¶
func (CoinV2) GetSNDerivator ¶
Get SND will be nil for ver 2
func (CoinV2) GetShardID ¶
func (CoinV2) GetSharedConcealRandom ¶
func (CoinV2) GetSharedRandom ¶
func (*CoinV2) GetTokenId ¶
func (c *CoinV2) GetTokenId(keySet *incognitokey.KeySet, rawAssetTags map[string]*common.Hash) (*common.Hash, error)
GetTokenId attempts to retrieve the asset a CoinV2. Parameters:
- keySet: the key set of the user, must contain an OTAKey
- rawAssetTags: a pre-computed mapping from a raw assetTag to the tokenId (e.g, HashToPoint(PRV) => PRV).
func (CoinV2) GetTxRandom ¶
func (CoinV2) GetTxRandomDetail ¶
func (CoinV2) GetVersion ¶
func (CoinV2) IsEncrypted ¶
func (CoinV2) MarshalJSON ¶
func (CoinV2) ParseKeyImageWithPrivateKey ¶
ParseKeyImageWithPrivateKey retrieves the keyImage of coin from the Master PrivateKey
func (CoinV2) ParsePrivateKeyOfCoin ¶
ParsePrivateKeyOfCoin retrieves the private OTA key of coin from the Master PrivateKey
func (*CoinV2) RecomputeSharedSecret ¶
this should be an input coin
func (*CoinV2) SetAssetTag ¶
func (*CoinV2) SetCommitment ¶
func (*CoinV2) SetKeyImage ¶
func (*CoinV2) SetPublicKey ¶
func (*CoinV2) SetRandomness ¶
func (*CoinV2) SetSharedConcealRandom ¶
func (*CoinV2) SetSharedRandom ¶
func (*CoinV2) SetTxRandom ¶
func (*CoinV2) SetTxRandomDetail ¶
func (*CoinV2) SetVersion ¶
func (*CoinV2) UnmarshalJSON ¶
type OTAReceiver ¶
OTAReceiver holds the data necessary to send a coin to your receiver with privacy. It is somewhat equivalent in usage with PaymentAddress
func (OTAReceiver) Bytes ¶
func (recv OTAReceiver) Bytes() ([]byte, error)
func (*OTAReceiver) FromAddress ¶
func (recv *OTAReceiver) FromAddress(addr key.PaymentAddress) error
func (*OTAReceiver) FromString ¶
func (recv *OTAReceiver) FromString(data string) error
FromString() returns a new OTAReceiver parsed from the input string, or error on failure
func (OTAReceiver) GetShardID ¶
func (recv OTAReceiver) GetShardID() byte
func (OTAReceiver) IsValid ¶
func (recv OTAReceiver) IsValid() bool
IsValid() checks the validity of this OTAReceiver (all referenced Points must be valid). Note that some sanity checks are already done when unmarshalling
func (OTAReceiver) MarshalJSON ¶
func (recv OTAReceiver) MarshalJSON() ([]byte, error)
func (*OTAReceiver) SetBytes ¶
func (recv *OTAReceiver) SetBytes(b []byte) error
func (OTAReceiver) String ¶
func (recv OTAReceiver) String() (string, error)
String() marshals the OTAReceiver, then encodes it with base58
func (*OTAReceiver) UnmarshalJSON ¶
func (recv *OTAReceiver) UnmarshalJSON(raw []byte) error
type PlainCoin ¶
type PlainCoin interface { // Overide MarshalJSON() ([]byte, error) UnmarshalJSON(data []byte) error GetVersion() uint8 GetCommitment() *operation.Point GetInfo() []byte GetPublicKey() *operation.Point GetValue() uint64 GetKeyImage() *operation.Point GetRandomness() *operation.Scalar GetShardID() (uint8, error) GetSNDerivator() *operation.Scalar GetCoinDetailEncrypted() []byte IsEncrypted() bool GetTxRandom() *TxRandom GetAssetTag() *operation.Point SetKeyImage(*operation.Point) SetPublicKey(*operation.Point) SetCommitment(*operation.Point) SetInfo([]byte) SetValue(uint64) SetRandomness(*operation.Scalar) // ParseKeyImage as Mlsag specification ParseKeyImageWithPrivateKey(key.PrivateKey) (*operation.Point, error) ParsePrivateKeyOfCoin(key.PrivateKey) (*operation.Scalar, error) ConcealOutputCoin(additionalData *operation.Point) error Bytes() []byte SetBytes([]byte) error }
func NewPlainCoinFromByte ¶
type PlainCoinV1 ¶
type PlainCoinV1 struct {
// contains filtered or unexported fields
}
Coin represents a coin
func ArrayPlainCoinToPlainCoinV1 ¶
func ArrayPlainCoinToPlainCoinV1(inputCoins []PlainCoin) []*PlainCoinV1
func (*PlainCoinV1) Bytes ¶
func (pc *PlainCoinV1) Bytes() []byte
Bytes converts a coin's details to a bytes array Each fields in coin is saved in len - body format
func (*PlainCoinV1) CommitAll ¶
func (pc *PlainCoinV1) CommitAll() error
CommitAll commits a coin with 5 attributes include: public key, value, serial number derivator, shardID form last byte public key, randomness
func (*PlainCoinV1) ConcealOutputCoin ¶
func (pc *PlainCoinV1) ConcealOutputCoin(additionalData *operation.Point) error
Conceal data leaving serialnumber
func (PlainCoinV1) GetAssetTag ¶
func (pc PlainCoinV1) GetAssetTag() *operation.Point
func (PlainCoinV1) GetCoinDetailEncrypted ¶
func (pc PlainCoinV1) GetCoinDetailEncrypted() []byte
func (PlainCoinV1) GetCommitment ¶
func (pc PlainCoinV1) GetCommitment() *operation.Point
ver1 does not need to care for index
func (PlainCoinV1) GetInfo ¶
func (pc PlainCoinV1) GetInfo() []byte
func (PlainCoinV1) GetKeyImage ¶
func (pc PlainCoinV1) GetKeyImage() *operation.Point
func (PlainCoinV1) GetPublicKey ¶
func (pc PlainCoinV1) GetPublicKey() *operation.Point
func (PlainCoinV1) GetRandomness ¶
func (pc PlainCoinV1) GetRandomness() *operation.Scalar
func (PlainCoinV1) GetSNDerivator ¶
func (pc PlainCoinV1) GetSNDerivator() *operation.Scalar
func (*PlainCoinV1) GetShardID ¶
func (pc *PlainCoinV1) GetShardID() (uint8, error)
func (PlainCoinV1) GetSharedConcealRandom ¶
func (pc PlainCoinV1) GetSharedConcealRandom() *operation.Scalar
func (PlainCoinV1) GetSharedRandom ¶
func (pc PlainCoinV1) GetSharedRandom() *operation.Scalar
func (PlainCoinV1) GetTxRandom ¶
func (pc PlainCoinV1) GetTxRandom() *TxRandom
func (PlainCoinV1) GetValue ¶
func (pc PlainCoinV1) GetValue() uint64
func (*PlainCoinV1) GetVersion ¶
func (*PlainCoinV1) GetVersion() uint8
func (*PlainCoinV1) HashH ¶
func (pc *PlainCoinV1) HashH() *common.Hash
HashH returns the SHA3-256 hashing of coin bytes array
func (*PlainCoinV1) Init ¶
func (pc *PlainCoinV1) Init() *PlainCoinV1
Init (Coin) initializes a coin
func (PlainCoinV1) IsEncrypted ¶
func (pc PlainCoinV1) IsEncrypted() bool
func (PlainCoinV1) MarshalJSON ¶
func (pc PlainCoinV1) MarshalJSON() ([]byte, error)
MarshalJSON (CoinV1) converts coin to bytes array, base58 check encode that bytes array into string json.Marshal the string
func (*PlainCoinV1) ParseCoinObjectToInputCoin ¶
func (pc *PlainCoinV1) ParseCoinObjectToInputCoin(coinObj CoinObject) error
SetBytes (InputCoin) receives a coinBytes (in bytes array), and reverts coinBytes to a InputCoin object
func (PlainCoinV1) ParseKeyImageWithPrivateKey ¶
func (pc PlainCoinV1) ParseKeyImageWithPrivateKey(privKey key.PrivateKey) (*operation.Point, error)
func (PlainCoinV1) ParsePrivateKeyOfCoin ¶
func (pc PlainCoinV1) ParsePrivateKeyOfCoin(privKey key.PrivateKey) (*operation.Scalar, error)
For ver1, privateKey of coin is privateKey of user
func (*PlainCoinV1) SetBytes ¶
func (pc *PlainCoinV1) SetBytes(coinBytes []byte) error
SetBytes receives a coinBytes (in bytes array), and reverts coinBytes to a Coin object
func (*PlainCoinV1) SetCommitment ¶
func (pc *PlainCoinV1) SetCommitment(v *operation.Point)
func (*PlainCoinV1) SetInfo ¶
func (pc *PlainCoinV1) SetInfo(v []byte)
func (*PlainCoinV1) SetKeyImage ¶
func (pc *PlainCoinV1) SetKeyImage(v *operation.Point)
func (*PlainCoinV1) SetPublicKey ¶
func (pc *PlainCoinV1) SetPublicKey(v *operation.Point)
func (*PlainCoinV1) SetRandomness ¶
func (pc *PlainCoinV1) SetRandomness(v *operation.Scalar)
func (*PlainCoinV1) SetSNDerivator ¶
func (pc *PlainCoinV1) SetSNDerivator(v *operation.Scalar)
func (*PlainCoinV1) SetValue ¶
func (pc *PlainCoinV1) SetValue(v uint64)
func (*PlainCoinV1) UnmarshalJSON ¶
func (pc *PlainCoinV1) UnmarshalJSON(data []byte) error
UnmarshalJSON (Coin) receives bytes array of coin (it was be MarshalJSON before), json.Unmarshal the bytes array to string base58 check decode that string to bytes array and set bytes array to coin
type TxRandom ¶
type TxRandom [TxRandomGroupSize]byte
func NewOTAFromReceiver ¶
func NewTxRandom ¶
func NewTxRandom() *TxRandom