Documentation
¶
Index ¶
- func Deserialize(rx io.Reader, target any) error
- func ReadVarBytes(r io.Reader) ([]byte, error)
- func Serialize(w io.Writer, source any) error
- func VariantAs[T any](p *Variant) T
- func VarintAppendUint64(buf []byte, v uint64) []byte
- func VarintPackedSize(v uint64) int
- func VarintReadUint64(r io.ByteReader) (uint64, error)
- func VarintTakeUint64(buf []byte) ([]byte, uint64, error)
- type AccountPublicAddr
- type BGEProof
- type BPPSignature
- type CLSAG_GGX_Input
- type CLSAG_Sig
- type GenContext
- type GenericDoubleSchnorrSig
- type KeyImageIndex
- type KeyPair
- type Payloaddeprecated
- type Point
- type RefById
- type Scalar
- type Tag
- type Transaction
- type TransactionPrefix
- type TransactionV3
- type TxInGen
- type TxInZcInput
- type TxOutZarcanium
- type UGAggProof
- type Value256
- func (v Value256) B32() [32]byte
- func (v Value256) Bytes() []byte
- func (v Value256) IsZero() bool
- func (v Value256) MarshalJSON() ([]byte, error)
- func (v *Value256) PB32() *[32]byte
- func (v *Value256) ReadFrom(r io.Reader) (int64, error)
- func (v Value256) String() string
- func (v *Value256) ToPoint() *edwards25519.Point
- type Variant
- type Varint
- type ZCAssetSurjectionProof
- type ZCBalanceProof
- type ZCOutsRangeProof
- type ZCSig
- type ZarcaniumTxDataV1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Deserialize implements epee deserializer (kind of)
func VarintAppendUint64 ¶
func VarintPackedSize ¶
func VarintReadUint64 ¶
func VarintReadUint64(r io.ByteReader) (uint64, error)
Types ¶
type AccountPublicAddr ¶
type BPPSignature ¶
type CLSAG_GGX_Input ¶
type CLSAG_Sig ¶
type CLSAG_Sig struct {
C *Scalar // scalar_t
Rg []*Scalar // for G-components (layers 0, 1), size = size of the ring
Rx []*Scalar // for X-component (layer 2), size = size of the ring
K1 *Point // public_key auxiliary key image for layer 1 (G)
K2 *Point // public_key auxiliary key image for layer 2 (X)
}
type GenContext ¶
type GenContext struct {
AssetIds []*Point
BlindedAssetIds []*Point
AmountCommitments []*Point
AssetIdBlindingMasks []*Scalar
Amounts []*Scalar
AmountBlindingMasks []*Scalar
PseudoOutsBlindedAssetIds []*Point
PseudoOutsPlusRealOutBlindingMasks []*Scalar
RealZcInsAssetIds []*Point
ZcInputAmounts []uint64
PseudoOutAmountCommitmentsSum *Point
PseudoOutAmountBlindingMasksSum *Scalar
RealInAssetIdBlindingMaskXAmountSum *Scalar
AmountCommitmentsSum *Point
AmountBlindingMasksSum *Scalar
AssetIdBlindingMaskXAmountSum *Scalar
AoAssetId *Point
AoAssetIdPt *Point
AoAmountCommitment *Point
AoAmountBlindingMask *Scalar
AoCommitmentInOutputs bool
TxKey *KeyPair
TxPubKeyP *Point
}
func (*GenContext) Resize ¶
func (g *GenContext) Resize(inCnt, outCnt int)
type GenericDoubleSchnorrSig ¶
type KeyImageIndex ¶
type Tag ¶
type Tag uint8
const ( TagGen Tag = 0 TagDerivationHint Tag = 11 TagPubKey Tag = 22 TagEtcTxFlags16 Tag = 23 TagDeriveXor Tag = 24 TagRefById Tag = 25 TagUint64 Tag = 26 TagUint32 Tag = 28 TagTxinZcInput Tag = 37 TagTxOutZarcanum Tag = 38 TagZarcaniumTxDataV1 Tag = 39 TagZCSig Tag = 43 TagZcAssetSurjectionProof Tag = 46 TagZcOutsRangeProof Tag = 47 TagZcBalanceProof Tag = 48 )
type Transaction ¶
type Transaction struct {
Version Varint `json:"version"` // varint, ==2
Vin []*Variant `json:"vin"` // txin_v = boost::variant<txin_gen[0], txin_to_key[1], txin_multisig[2], txin_htlc[34], txin_zc_input[37]>
Extra []*Variant `json:"extra"` // extra_v
Vout []*Variant `json:"vout"` // tx_out_v = boost::variant<tx_out_bare[36], tx_out_zarcanum[38]>
// up to here this was transaction_prefix
Attachment []*Variant `json:"attachment,omitempty"`
Signatures []*Variant `json:"signatures"` // signature_v = boost::variant<NLSAG_sig, void_sig, ZC_sig, zarcanum_sig>
Proofs []*Variant `json:"proofs"` // proof_v
}
func (*Transaction) GetFee ¶
func (tx *Transaction) GetFee() (uint64, bool)
func (*Transaction) Prefix ¶
func (tx *Transaction) Prefix() *TransactionPrefix
type TransactionPrefix ¶
type TransactionPrefix struct {
Version Varint `json:"version"` // varint, ==2
Vin []*Variant `json:"vin"` // txin_v = boost::variant<txin_gen[0], txin_to_key[1], txin_multisig[2], txin_htlc[34], txin_zc_input[37]>
Extra []*Variant `json:"extra"` // extra_v
Vout []*Variant `json:"vout"` // tx_out_v = boost::variant<tx_out_bare[36], tx_out_zarcanum[38]>
}
func (*TransactionPrefix) Hash ¶
func (txp *TransactionPrefix) Hash() ([]byte, error)
Hash of a transaction prefix. Can fail if the variants contains invalid data
type TransactionV3 ¶ added in v0.0.2
type TransactionV3 struct {
Version Varint `json:"version"` // varint, ==2
Vin []*Variant `json:"vin"` // txin_v = boost::variant<txin_gen[0], txin_to_key[1], txin_multisig[2], txin_htlc[34], txin_zc_input[37]>
Extra []*Variant `json:"extra"` // extra_v
Vout []*Variant `json:"vout"` // tx_out_v = boost::variant<tx_out_bare[36], tx_out_zarcanum[38]>
// up to here this was transaction_prefix
Attachment []*Variant `json:"attachment,omitempty"`
Signatures []*Variant `json:"signatures"` // signature_v = boost::variant<NLSAG_sig, void_sig, ZC_sig, zarcanum_sig>
Proofs []*Variant `json:"proofs"` // proof_v
HardforkId uint8 `json:"hardfork_id"` // uint8_t
}
type TxInZcInput ¶
type TxInZcInput struct {
// referring_input
KeyOffsets []*Payload `json:"key_offsets"` // std::vector<txout_ref_v>; typedef boost::variant<uint64_t, ref_by_id> txout_ref_v
// txin_zc_input
KeyImage *Point `json:"key_image"` // crypto::key_image = ec_point
EtcDetails []*Payload `json:"etc_details,omitempty"` // std::vector<txin_etc_details_v> = std::vector<boost::variant<signed_parts, extra_attachment_info>>
}
type TxOutZarcanium ¶
type TxOutZarcanium struct {
// tx_out_zarcanum
StealthAddress Value256
ConcealingPoint Value256 // group element Q, see also Zarcanum paper, premultiplied by 1/8
AmountCommitment Value256 // premultiplied by 1/8
BlindedAssetId Value256 // group element T, premultiplied by 1/8
EncryptedAmount uint64
MixAttr uint8
}
type UGAggProof ¶
type UGAggProof struct {
AmountCommitmentsForRPAgg []*Point `json:"amount_commitments_for_rp_aggregation"` // std::vector<public_key> E' = e * U + y' * G, premultiplied by 1/8
Y0s []*Scalar `json:"y0s"` // scalar_vec_t
Y1s []*Scalar `json:"y1s"` // scalar_vec_t
C *Scalar `json:"c"` // common challenge
}
type Value256 ¶
type Value256 [32]byte
func (Value256) MarshalJSON ¶
func (*Value256) ToPoint ¶
func (v *Value256) ToPoint() *edwards25519.Point
type ZCAssetSurjectionProof ¶
type ZCAssetSurjectionProof struct {
// zc_asset_surjection_proof
BGEProofs []*BGEProof // std::vector<crypto::BGE_proof_s> bge_proofs
}
type ZCBalanceProof ¶
type ZCBalanceProof struct {
// zc_balance_proof
DSS *GenericDoubleSchnorrSig // crypto::generic_double_schnorr_sig_s
}
First part of a double Schnorr proof:
- for txs without ZC inputs: proves that balance point = lin(G) (cancels out G component of outputs' amount commitments, asset tags assumed to be H (native coin) and non-blinded)
- for txs with ZC inputs: proves that balance point = lin(X) (cancels out X component of blinded asset tags within amount commitments for both outputs and inputs (pseudo outs))
Second part:
proof of knowing transaction secret key (with respect to G)
type ZCOutsRangeProof ¶
type ZCOutsRangeProof struct {
// zc_outs_range_proof
BPP *BPPSignature // for commitments in form: amount * U + mask * G
// crypto::vector_UG_aggregation_proof_serialized
AggregationProof *UGAggProof // E'_j = e_j * U + y'_j * G + vector Shnorr
}
type ZarcaniumTxDataV1 ¶
type ZarcaniumTxDataV1 struct {
Fee uint64 `json:"fee"`
}
Click to show internal directories.
Click to hide internal directories.