transaction

package
v5.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceableRingSignatures = ProofType(iota)

	// AggregateMLSAGBorromean One MLSAG for multiple inputs and Borromean range proofs.
	//
	// This aligns with RCTTypeFull.
	AggregateMLSAGBorromean

	// MLSAGBorromean One MLSAG for each input and a Borromean range proof.
	//
	// This aligns with RCTTypeSimple.
	MLSAGBorromean

	// MLSAGBulletproof One MLSAG for each input and a Bulletproof.
	//
	// This aligns with RCTTypeBulletproof.
	MLSAGBulletproof

	// MLSAGBulletproofCompactAmount One MLSAG for each input and a Bulletproof, yet using EncryptedAmount::Compact.
	//
	// This aligns with RCTTypeBulletproof2.
	MLSAGBulletproofCompactAmount

	// CLSAGBulletproof One CLSAG for each input and a Bulletproof.
	//
	// This aligns with RCTTypeCLSAG.
	CLSAGBulletproof

	// CLSAGBulletproofPlus One CLSAG for each input and a Bulletproof+.
	//
	// This aligns with RCTTypeBulletproofPlus.
	CLSAGBulletproofPlus

	// FCMPPlusPlus One FCMP for each input and a Bulletproof+.
	//
	// This aligns with RCTTypeFcmpPlusPlus.
	FCMPPlusPlus
)
View Source
const TxExtraNonceEncryptedPaymentId = 0x01
View Source
const TxExtraNonceMaxCount = 255
View Source
const TxExtraNoncePaymentId = 0x00
View Source
const TxExtraPaddingMaxCount = 255
View Source
const TxExtraTagAdditionalPubKeys = 0x04
View Source
const TxExtraTagMergeMining = 0x03
View Source
const TxExtraTagMergeMiningMaxCount = types.HashSize + 9
View Source
const TxExtraTagMysteriousMinergate = 0xde
View Source
const TxExtraTagNonce = 0x02
View Source
const TxExtraTagPadding = 0x00
View Source
const TxExtraTagPubKey = 0x01
View Source
const TxExtraTemplateNonceSize = 4
View Source
const TxInGen = 0xff
View Source
const TxInToKey = 0x2
View Source
const TxOutToCarrotV1 = 0
View Source
const TxOutToKey = 2
View Source
const TxOutToTaggedKey = 3

Variables

View Source
var ErrAmountOverflow = errors.New("amount overflow")
View Source
var ErrExtraTagNoMoreTags = errors.New("no more tags")
View Source
var ErrInvalidBorromeanProof = errors.New("invalid Borromean proof")
View Source
var ErrInvalidRangeProof = errors.New("invalid range proof")
View Source
var ErrInvalidRingSignature = errors.New("invalid ring signature")
View Source
var ErrInvalidTransactionExtra = errors.New("invalid transaction extra")
View Source
var ErrUnbalancedAmounts = errors.New("unbalanced amounts")

Functions

Types

type Base

type Base struct {
	ProofType        ProofType                   `json:"type"`
	Fee              uint64                      `json:"txnFee"`
	PseudoOuts       []curve25519.PublicKeyBytes `json:"pseudoOuts,omitempty"`
	EncryptedAmounts []ringct.EncryptedAmount    `json:"ecdhInfo"`
	Commitments      []curve25519.PublicKeyBytes `json:"outPk"`
}

func (*Base) AppendBinary

func (b *Base) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*Base) BufferLength

func (b *Base) BufferLength() int

func (*Base) FromReader

func (b *Base) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs) (err error)

func (*Base) Hash

func (b *Base) Hash() types.Hash

type CoinbaseTransactionAuxiliaryData

type CoinbaseTransactionAuxiliaryData struct {
	// OutputsBlobSize length of serialized Outputs. Used by p2pool serialized pruned blocks, filled regardless
	OutputsBlobSize uint64 `json:"outputs_blob_size"`
	// TotalReward amount of reward existing Outputs. Used by p2pool serialized pruned blocks, filled regardless
	TotalReward uint64 `json:"total_reward"`
	// TemplateId Required by sidechain.GetOutputs to speed up repeated broadcasts from different peers
	// This must be filled when preprocessing
	TemplateId types.Hash `json:"template_id,omitzero"`
}

type CoinbaseV2 added in v5.0.1

type CoinbaseV2 struct {
	// MinerUnlockTime would be here
	InputCount uint8 `json:"input_count"`
	InputType  uint8 `json:"input_type"`
	// MinerUnlockTime re-arranged here to improve memory layout space
	MinerUnlockTime uint64  `json:"unlock_time"`
	GenHeight       uint64  `json:"gen_height"`
	MinerOutputs    Outputs `json:"outputs"`

	Extra ExtraTags `json:"extra"`

	ExtraBaseRCT uint8 `json:"extra_base_rct"`

	// AuxiliaryData Used by p2pool serialized pruned blocks
	AuxiliaryData CoinbaseTransactionAuxiliaryData `json:"auxiliary_data"`
}

func (*CoinbaseV2) AppendBinary added in v5.0.1

func (c *CoinbaseV2) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*CoinbaseV2) AppendBinaryFlags added in v5.0.1

func (c *CoinbaseV2) AppendBinaryFlags(preAllocatedBuf []byte, pruned, containsAuxiliaryTemplateId bool) ([]byte, error)

func (*CoinbaseV2) AppendPrunedBinary added in v5.0.1

func (c *CoinbaseV2) AppendPrunedBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*CoinbaseV2) BufferLength added in v5.0.1

func (c *CoinbaseV2) BufferLength() int

func (*CoinbaseV2) ExtraData added in v5.0.3

func (c *CoinbaseV2) ExtraData() []byte

func (*CoinbaseV2) ExtraTags added in v5.0.1

func (c *CoinbaseV2) ExtraTags() ExtraTags

func (*CoinbaseV2) Fee added in v5.0.1

func (c *CoinbaseV2) Fee() uint64

func (*CoinbaseV2) FromReader added in v5.0.1

func (c *CoinbaseV2) FromReader(reader utils.ReaderAndByteReader, canBePruned, containsAuxiliaryTemplateId bool) (err error)

func (*CoinbaseV2) FromVersionReader added in v5.0.1

func (c *CoinbaseV2) FromVersionReader(reader utils.ReaderAndByteReader, canBePruned, containsAuxiliaryTemplateId bool) (err error)

FromVersionReader Internal version to skip version check

func (*CoinbaseV2) Hash added in v5.0.1

func (c *CoinbaseV2) Hash() (hash types.Hash)

func (*CoinbaseV2) Inputs added in v5.0.1

func (c *CoinbaseV2) Inputs() Inputs

func (*CoinbaseV2) MarshalBinary added in v5.0.1

func (c *CoinbaseV2) MarshalBinary() ([]byte, error)

func (*CoinbaseV2) MarshalBinaryFlags added in v5.0.1

func (c *CoinbaseV2) MarshalBinaryFlags(pruned, containsAuxiliaryTemplateId bool) ([]byte, error)

func (*CoinbaseV2) Outputs added in v5.0.1

func (c *CoinbaseV2) Outputs() Outputs

func (*CoinbaseV2) OutputsBlob added in v5.0.1

func (c *CoinbaseV2) OutputsBlob() ([]byte, error)

func (*CoinbaseV2) PrefixHash added in v5.0.1

func (c *CoinbaseV2) PrefixHash() types.Hash

func (*CoinbaseV2) Proofs added in v5.0.1

func (c *CoinbaseV2) Proofs() Proofs

func (*CoinbaseV2) PrunedBufferLength added in v5.0.1

func (c *CoinbaseV2) PrunedBufferLength() int

func (*CoinbaseV2) SideChainHashingBlob added in v5.0.1

func (c *CoinbaseV2) SideChainHashingBlob(preAllocatedBuf []byte, majorVersion uint8, zeroTemplateId bool) ([]byte, error)

func (*CoinbaseV2) SignatureHash added in v5.0.1

func (c *CoinbaseV2) SignatureHash() types.Hash

func (*CoinbaseV2) UnlockTime added in v5.0.1

func (c *CoinbaseV2) UnlockTime() uint64

func (*CoinbaseV2) UnmarshalBinary added in v5.0.1

func (c *CoinbaseV2) UnmarshalBinary(data []byte, canBePruned, containsAuxiliaryTemplateId bool) error

func (*CoinbaseV2) Version added in v5.0.1

func (c *CoinbaseV2) Version() uint8

func (*CoinbaseV2) Weight added in v5.0.1

func (c *CoinbaseV2) Weight() int

type ExtraTag

type ExtraTag struct {
	// VarInt has different meanings. In TxExtraTagMergeMining it is depth, while in others it is length
	VarInt    uint64      `json:"var_int"`
	Tag       uint8       `json:"tag"`
	HasVarInt bool        `json:"has_var_int"`
	Data      types.Bytes `json:"data"`
}

func (*ExtraTag) AppendBinary

func (t *ExtraTag) AppendBinary(preAllocatedBuf []byte) ([]byte, error)

func (*ExtraTag) BufferLength

func (t *ExtraTag) BufferLength() int

func (*ExtraTag) FromReader

func (t *ExtraTag) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*ExtraTag) MarshalBinary

func (t *ExtraTag) MarshalBinary() ([]byte, error)

func (*ExtraTag) SideChainHashingBlob

func (t *ExtraTag) SideChainHashingBlob(preAllocatedBuf []byte, majorVersion uint8, zeroTemplateId bool) ([]byte, error)

func (*ExtraTag) UnmarshalBinary

func (t *ExtraTag) UnmarshalBinary(data []byte) error

type ExtraTags

type ExtraTags []ExtraTag

func (*ExtraTags) AppendBinary

func (t *ExtraTags) AppendBinary(preAllocatedBuf []byte) (buf []byte, err error)

func (*ExtraTags) BufferLength

func (t *ExtraTags) BufferLength() (length int)

func (*ExtraTags) FromReader

func (t *ExtraTags) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*ExtraTags) GetTag

func (t *ExtraTags) GetTag(tag uint8) *ExtraTag

func (*ExtraTags) MarshalBinary

func (t *ExtraTags) MarshalBinary() ([]byte, error)

func (*ExtraTags) SideChainHashingBlob

func (t *ExtraTags) SideChainHashingBlob(preAllocatedBuf []byte, majorVersion uint8, zeroTemplateId bool) (buf []byte, err error)

func (*ExtraTags) UnmarshalBinary

func (t *ExtraTags) UnmarshalBinary(data []byte) (err error)

type GenericCoinbase added in v5.0.3

type GenericCoinbase struct {

	// MinerUnlockTime would be here
	InputCount uint8 `json:"input_count"`
	InputType  uint8 `json:"input_type"`
	// MinerUnlockTime re-arranged here to improve memory layout space
	MinerUnlockTime uint64  `json:"unlock_time"`
	GenHeight       uint64  `json:"gen_height"`
	MinerOutputs    Outputs `json:"vout"`

	Extra types.Bytes `json:"extra"`

	ExtraBaseRCT uint8 `json:"extra_base_rct,omitzero"`
	// contains filtered or unexported fields
}

func (*GenericCoinbase) AppendBinary added in v5.0.3

func (c *GenericCoinbase) AppendBinary(preAllocatedBuf []byte) ([]byte, error)

func (*GenericCoinbase) AppendPrunedBinary added in v5.0.3

func (c *GenericCoinbase) AppendPrunedBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*GenericCoinbase) BufferLength added in v5.0.3

func (c *GenericCoinbase) BufferLength() int

func (*GenericCoinbase) ExtraData added in v5.0.3

func (c *GenericCoinbase) ExtraData() []byte

func (*GenericCoinbase) ExtraTags added in v5.0.3

func (c *GenericCoinbase) ExtraTags() ExtraTags

ExtraTags Returns a transaction extra decoded. This can err on corrupt blocks

func (*GenericCoinbase) Fee added in v5.0.3

func (c *GenericCoinbase) Fee() uint64

func (*GenericCoinbase) FromReader added in v5.0.3

func (c *GenericCoinbase) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*GenericCoinbase) Hash added in v5.0.3

func (c *GenericCoinbase) Hash() (hash types.Hash)

func (*GenericCoinbase) Inputs added in v5.0.3

func (c *GenericCoinbase) Inputs() Inputs

func (*GenericCoinbase) MarshalBinary added in v5.0.3

func (c *GenericCoinbase) MarshalBinary() ([]byte, error)

func (*GenericCoinbase) Outputs added in v5.0.3

func (c *GenericCoinbase) Outputs() Outputs

func (*GenericCoinbase) OutputsBlob added in v5.0.3

func (c *GenericCoinbase) OutputsBlob() ([]byte, error)

func (*GenericCoinbase) PrefixHash added in v5.0.3

func (c *GenericCoinbase) PrefixHash() types.Hash

func (*GenericCoinbase) Proofs added in v5.0.3

func (c *GenericCoinbase) Proofs() Proofs

func (*GenericCoinbase) PrunedBufferLength added in v5.0.3

func (c *GenericCoinbase) PrunedBufferLength() int

func (*GenericCoinbase) SignatureHash added in v5.0.3

func (c *GenericCoinbase) SignatureHash() types.Hash

func (*GenericCoinbase) TotalReward added in v5.0.3

func (c *GenericCoinbase) TotalReward() (reward uint64)

func (*GenericCoinbase) UnlockTime added in v5.0.3

func (c *GenericCoinbase) UnlockTime() uint64

func (*GenericCoinbase) UnmarshalBinary added in v5.0.3

func (c *GenericCoinbase) UnmarshalBinary(data []byte) error

func (*GenericCoinbase) Version added in v5.0.3

func (c *GenericCoinbase) Version() uint8

func (*GenericCoinbase) Weight added in v5.0.3

func (c *GenericCoinbase) Weight() int

type InputToKey

type InputToKey struct {
	Amount   uint64                    `json:"amount"`
	Offsets  []uint64                  `json:"key_offsets"`
	KeyImage curve25519.PublicKeyBytes `json:"k_image"`
}

func (*InputToKey) BufferLength

func (i *InputToKey) BufferLength() int

func (*InputToKey) MarshalJSON

func (i *InputToKey) MarshalJSON() ([]byte, error)

func (*InputToKey) UnmarshalJSON

func (i *InputToKey) UnmarshalJSON(b []byte) error

type Inputs

type Inputs []InputToKey

func (*Inputs) AppendBinary

func (i *Inputs) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*Inputs) BufferLength

func (i *Inputs) BufferLength() (n int)

func (*Inputs) FromReader

func (i *Inputs) FromReader(reader utils.ReaderAndByteReader) (err error)

type Output

type Output struct {
	Index uint64 `json:"index"`
	// Amount index of Monero rewarded on this output, 0 for RingCT
	// Consensus: p2pool limits this field to 56 bits max
	// https://github.com/SChernykh/p2pool/blob/10d583adb67d0566af6c36a6c97fed69545421a2/src/pool_block.h#L104-L106
	Amount uint64 `json:"amount"`
	// Type would be here
	EphemeralPublicKey   curve25519.PublicKeyBytes                       `json:"ephemeral_public_key"`
	EncryptedJanusAnchor types.FixedBytes[[monero.JanusAnchorSize]uint8] `json:"encrypted_janus_anchor"`

	// Type re-arranged here to improve memory layout space
	Type uint8 `json:"type"`
	// ViewTag Reused for carrot/non-carrot outputs
	ViewTag types.FixedBytes[[monero.CarrotViewTagSize]byte] `json:"view_tag"`
}

func (Output) BufferLength

func (o Output) BufferLength() (n int)

type Outputs

type Outputs []Output

func (*Outputs) AppendBinary

func (s *Outputs) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*Outputs) BufferLength

func (s *Outputs) BufferLength() (n int)

func (*Outputs) FromReader

func (s *Outputs) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*Outputs) MarshalBinary

func (s *Outputs) MarshalBinary() (data []byte, err error)

type Prefix

type Prefix struct {
	UnlockTime uint64           `json:"unlock_time"`
	Inputs     Inputs           `json:"vin"`
	Outputs    Outputs          `json:"vout"`
	Extra      types.SliceBytes `json:"extra"`
}

func (*Prefix) AppendBinary

func (p *Prefix) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*Prefix) BufferLength

func (p *Prefix) BufferLength() int

func (*Prefix) ExtraTags

func (p *Prefix) ExtraTags() ExtraTags

func (*Prefix) FromReader

func (p *Prefix) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*Prefix) Hash

func (p *Prefix) Hash(version uint8) types.Hash

Hash Equivalent to get_transaction_prefix_hash

type ProofType

type ProofType uint8

func (ProofType) Bulletproof

func (p ProofType) Bulletproof() bool

func (ProofType) BulletproofPlus

func (p ProofType) BulletproofPlus() bool

func (ProofType) CompactAmount

func (p ProofType) CompactAmount() bool

func (ProofType) FCMP

func (p ProofType) FCMP() bool

type Proofs

type Proofs interface {
	Verify(prefixHash types.Hash, rings []ringct.CommitmentRing[curve25519.VarTimeOperations], images []curve25519.VarTimePublicKey) error
	ProofType() ProofType
}

type Prunable

type Prunable interface {
	SignatureHash() types.Hash
	Hash(signature bool) types.Hash
	Verify(prefixHash types.Hash, base *Base, rings []ringct.CommitmentRing[curve25519.VarTimeOperations], images []curve25519.VarTimePublicKey) error
	BufferLength(signature bool) int
	AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)
	// FromReader TODO: support signature arg
	FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)
}

type PrunableAggregateMLSAGBorromean

type PrunableAggregateMLSAGBorromean struct {
	MLSAG     [1]mlsag.Signature[curve25519.VarTimeOperations] `json:"MGs"`
	Borromean []borromean.Range[curve25519.VarTimeOperations]  `json:"rangeSigs"`
}

func (*PrunableAggregateMLSAGBorromean) AppendBinary

func (p *PrunableAggregateMLSAGBorromean) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableAggregateMLSAGBorromean) BufferLength

func (p *PrunableAggregateMLSAGBorromean) BufferLength(signature bool) (n int)

func (*PrunableAggregateMLSAGBorromean) FromReader

func (p *PrunableAggregateMLSAGBorromean) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableAggregateMLSAGBorromean) Hash

func (p *PrunableAggregateMLSAGBorromean) Hash(signature bool) types.Hash

func (*PrunableAggregateMLSAGBorromean) SignatureHash

func (p *PrunableAggregateMLSAGBorromean) SignatureHash() types.Hash

func (*PrunableAggregateMLSAGBorromean) Verify

type PrunableCLSAGBulletproofs

type PrunableCLSAGBulletproofs struct {
	CLSAG []clsag.Signature[curve25519.VarTimeOperations]
	// PseudoOuts The re-blinded commitments for the outputs being spent.
	PseudoOuts  []curve25519.VarTimePublicKey
	Bulletproof bp.AggregateRangeProof[curve25519.VarTimeOperations]
}

func (*PrunableCLSAGBulletproofs) AppendBinary

func (p *PrunableCLSAGBulletproofs) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableCLSAGBulletproofs) BufferLength

func (p *PrunableCLSAGBulletproofs) BufferLength(signature bool) (n int)

func (*PrunableCLSAGBulletproofs) FromReader

func (p *PrunableCLSAGBulletproofs) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableCLSAGBulletproofs) Hash

func (p *PrunableCLSAGBulletproofs) Hash(signature bool) types.Hash

func (*PrunableCLSAGBulletproofs) SignatureHash

func (p *PrunableCLSAGBulletproofs) SignatureHash() types.Hash

func (*PrunableCLSAGBulletproofs) Verify

type PrunableCLSAGBulletproofsPlus

type PrunableCLSAGBulletproofsPlus struct {
	CLSAG []clsag.Signature[curve25519.VarTimeOperations]
	// PseudoOuts The re-blinded commitments for the outputs being spent.
	PseudoOuts  []curve25519.VarTimePublicKey
	Bulletproof bpp.AggregateRangeProof[curve25519.VarTimeOperations]
}

func (*PrunableCLSAGBulletproofsPlus) AppendBinary

func (p *PrunableCLSAGBulletproofsPlus) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableCLSAGBulletproofsPlus) BufferLength

func (p *PrunableCLSAGBulletproofsPlus) BufferLength(signature bool) (n int)

func (*PrunableCLSAGBulletproofsPlus) FromReader

func (p *PrunableCLSAGBulletproofsPlus) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableCLSAGBulletproofsPlus) Hash

func (p *PrunableCLSAGBulletproofsPlus) Hash(signature bool) types.Hash

func (*PrunableCLSAGBulletproofsPlus) SignatureHash

func (p *PrunableCLSAGBulletproofsPlus) SignatureHash() types.Hash

func (*PrunableCLSAGBulletproofsPlus) Verify

type PrunableFCMPPlusPlus

type PrunableFCMPPlusPlus struct {
	// ReferenceBlock used to get the tree root as of when this reference block index enters the chain
	ReferenceBlock uint64
	// NTreeLayers number of layers in the tree as of the block when the reference block index enters the chain
	NTreeLayers uint8
	// FCMP_PP FCMP++ SAL and membership proof
	FCMP_PP []byte
	// PseudoOuts The re-blinded commitments for the outputs being spent.
	PseudoOuts  []curve25519.VarTimePublicKey
	Bulletproof bpp.AggregateRangeProof[curve25519.VarTimeOperations]
}

func (*PrunableFCMPPlusPlus) AppendBinary

func (p *PrunableFCMPPlusPlus) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableFCMPPlusPlus) BufferLength

func (p *PrunableFCMPPlusPlus) BufferLength(signature bool) (n int)

func (*PrunableFCMPPlusPlus) FromReader

func (p *PrunableFCMPPlusPlus) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableFCMPPlusPlus) Hash

func (p *PrunableFCMPPlusPlus) Hash(signature bool) types.Hash

func (*PrunableFCMPPlusPlus) SignatureHash

func (p *PrunableFCMPPlusPlus) SignatureHash() types.Hash

func (*PrunableFCMPPlusPlus) Verify

func (p *PrunableFCMPPlusPlus) Verify(prefixHash types.Hash, base *Base, rings []ringct.CommitmentRing[curve25519.VarTimeOperations], images []curve25519.VarTimePublicKey) (err error)

type PrunableMLSAGBorromean

type PrunableMLSAGBorromean struct {
	MLSAG     []mlsag.Signature[curve25519.VarTimeOperations] `json:"MGs"`
	Borromean []borromean.Range[curve25519.VarTimeOperations] `json:"rangeSigs"`
}

func (*PrunableMLSAGBorromean) AppendBinary

func (p *PrunableMLSAGBorromean) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableMLSAGBorromean) BufferLength

func (p *PrunableMLSAGBorromean) BufferLength(signature bool) (n int)

func (*PrunableMLSAGBorromean) FromReader

func (p *PrunableMLSAGBorromean) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableMLSAGBorromean) Hash

func (p *PrunableMLSAGBorromean) Hash(signature bool) types.Hash

func (*PrunableMLSAGBorromean) SignatureHash

func (p *PrunableMLSAGBorromean) SignatureHash() types.Hash

func (*PrunableMLSAGBorromean) Verify

type PrunableMLSAGBulletproofs

type PrunableMLSAGBulletproofs struct {
	MLSAG []mlsag.Signature[curve25519.VarTimeOperations]
	// PseudoOuts The re-blinded commitments for the outputs being spent.
	PseudoOuts  []curve25519.VarTimePublicKey
	Bulletproof bp.AggregateRangeProof[curve25519.VarTimeOperations]
}

func (*PrunableMLSAGBulletproofs) AppendBinary

func (p *PrunableMLSAGBulletproofs) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableMLSAGBulletproofs) BufferLength

func (p *PrunableMLSAGBulletproofs) BufferLength(signature bool) (n int)

func (*PrunableMLSAGBulletproofs) FromReader

func (p *PrunableMLSAGBulletproofs) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableMLSAGBulletproofs) Hash

func (p *PrunableMLSAGBulletproofs) Hash(signature bool) types.Hash

func (*PrunableMLSAGBulletproofs) SignatureHash

func (p *PrunableMLSAGBulletproofs) SignatureHash() types.Hash

func (*PrunableMLSAGBulletproofs) Verify

type PrunableMLSAGBulletproofsCompactAmount

type PrunableMLSAGBulletproofsCompactAmount struct {
	MLSAG []mlsag.Signature[curve25519.VarTimeOperations]
	// PseudoOuts The re-blinded commitments for the outputs being spent.
	PseudoOuts  []curve25519.VarTimePublicKey
	Bulletproof bp.AggregateRangeProof[curve25519.VarTimeOperations]
}

func (*PrunableMLSAGBulletproofsCompactAmount) AppendBinary

func (p *PrunableMLSAGBulletproofsCompactAmount) AppendBinary(preAllocatedBuf []byte, signature bool) (data []byte, err error)

func (*PrunableMLSAGBulletproofsCompactAmount) BufferLength

func (p *PrunableMLSAGBulletproofsCompactAmount) BufferLength(signature bool) (n int)

func (*PrunableMLSAGBulletproofsCompactAmount) FromReader

func (p *PrunableMLSAGBulletproofsCompactAmount) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs, signature bool) (err error)

func (*PrunableMLSAGBulletproofsCompactAmount) Hash

func (*PrunableMLSAGBulletproofsCompactAmount) SignatureHash

func (*PrunableMLSAGBulletproofsCompactAmount) Verify

type PrunableTransaction

type PrunableTransaction interface {
	PrunedTransaction
	Weight() int
	Hash() types.Hash
	SignatureHash() types.Hash
	BufferLength() int
	AppendBinary(preAllocatedBuf []byte) (data []byte, err error)
}

type PrunedTransaction added in v5.0.1

type PrunedTransaction interface {
	Version() uint8
	PrefixHash() types.Hash
	UnlockTime() uint64
	Fee() uint64
	Inputs() Inputs
	Outputs() Outputs
	Proofs() Proofs
	ExtraData() []byte
	ExtraTags() ExtraTags
	PrunedBufferLength() int
	AppendPrunedBinary(preAllocatedBuf []byte) (data []byte, err error)
}

func NewPrunedTransactionFromBytes added in v5.0.1

func NewPrunedTransactionFromBytes(buf []byte) (tx PrunedTransaction, err error)

func NewPrunedTransactionFromReader added in v5.0.1

func NewPrunedTransactionFromReader(reader utils.ReaderAndByteReader) (tx PrunedTransaction, err error)

type RingSignatures

func (*RingSignatures) AppendBinary

func (rs *RingSignatures) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*RingSignatures) BufferLength

func (rs *RingSignatures) BufferLength() int

func (*RingSignatures) FromReader

func (rs *RingSignatures) FromReader(reader utils.ReaderAndByteReader, inputs Inputs, outputs Outputs) (err error)

func (*RingSignatures) ProofType

func (rs *RingSignatures) ProofType() ProofType

func (*RingSignatures) Verify

type Transaction

type Transaction interface {
	PrunableTransaction
}

func NewTransactionFromBytes added in v5.0.1

func NewTransactionFromBytes(buf []byte) (tx Transaction, err error)

func NewTransactionFromReader

func NewTransactionFromReader(reader utils.ReaderAndByteReader) (tx Transaction, err error)

type TransactionV1

type TransactionV1 struct {
	Prefix `json:",inline"`

	Signatures RingSignatures `json:"signatures"`
	// contains filtered or unexported fields
}

func (*TransactionV1) AppendBinary

func (tx *TransactionV1) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*TransactionV1) AppendPrunedBinary added in v5.0.1

func (tx *TransactionV1) AppendPrunedBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*TransactionV1) BufferLength

func (tx *TransactionV1) BufferLength() int

func (*TransactionV1) ExtraData added in v5.0.3

func (tx *TransactionV1) ExtraData() []byte

func (*TransactionV1) ExtraTags

func (tx *TransactionV1) ExtraTags() ExtraTags

func (*TransactionV1) Fee

func (tx *TransactionV1) Fee() uint64

func (*TransactionV1) FromPrunedReader added in v5.0.1

func (tx *TransactionV1) FromPrunedReader(reader utils.ReaderAndByteReader) (err error)

func (*TransactionV1) FromReader

func (tx *TransactionV1) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*TransactionV1) Hash

func (tx *TransactionV1) Hash() types.Hash

func (*TransactionV1) Inputs

func (tx *TransactionV1) Inputs() Inputs

func (*TransactionV1) Outputs

func (tx *TransactionV1) Outputs() Outputs

func (*TransactionV1) PrefixHash

func (tx *TransactionV1) PrefixHash() types.Hash

func (*TransactionV1) Proofs

func (tx *TransactionV1) Proofs() Proofs

func (*TransactionV1) PrunedBufferLength added in v5.0.1

func (tx *TransactionV1) PrunedBufferLength() int

func (*TransactionV1) SignatureHash

func (tx *TransactionV1) SignatureHash() (out types.Hash)

func (*TransactionV1) UnlockTime added in v5.0.3

func (tx *TransactionV1) UnlockTime() uint64

func (*TransactionV1) Version

func (tx *TransactionV1) Version() uint8

func (*TransactionV1) Weight

func (tx *TransactionV1) Weight() int

type TransactionV2

type TransactionV2 struct {
	Prefix   `json:",inline"`
	Base     `json:"rct_signatures"`
	Prunable `json:"rctsig_prunable"`
}

func (*TransactionV2) AppendBinary

func (tx *TransactionV2) AppendBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*TransactionV2) AppendPrunedBinary added in v5.0.1

func (tx *TransactionV2) AppendPrunedBinary(preAllocatedBuf []byte) (data []byte, err error)

func (*TransactionV2) BufferLength

func (tx *TransactionV2) BufferLength() int

func (*TransactionV2) ExtraData added in v5.0.3

func (tx *TransactionV2) ExtraData() []byte

func (*TransactionV2) ExtraTags

func (tx *TransactionV2) ExtraTags() ExtraTags

func (*TransactionV2) Fee

func (tx *TransactionV2) Fee() uint64

func (*TransactionV2) FromPrunedReader added in v5.0.1

func (tx *TransactionV2) FromPrunedReader(reader utils.ReaderAndByteReader) (err error)

func (*TransactionV2) FromReader

func (tx *TransactionV2) FromReader(reader utils.ReaderAndByteReader) (err error)

func (*TransactionV2) Hash

func (tx *TransactionV2) Hash() (out types.Hash)

func (*TransactionV2) Inputs

func (tx *TransactionV2) Inputs() Inputs

func (*TransactionV2) Outputs

func (tx *TransactionV2) Outputs() Outputs

func (*TransactionV2) PrefixHash

func (tx *TransactionV2) PrefixHash() types.Hash

func (*TransactionV2) Proofs

func (tx *TransactionV2) Proofs() Proofs

func (*TransactionV2) PrunedBufferLength added in v5.0.1

func (tx *TransactionV2) PrunedBufferLength() int

func (*TransactionV2) SignatureHash

func (tx *TransactionV2) SignatureHash() (out types.Hash)

func (*TransactionV2) UnlockTime added in v5.0.3

func (tx *TransactionV2) UnlockTime() uint64

func (*TransactionV2) Version

func (tx *TransactionV2) Version() uint8

func (*TransactionV2) Weight

func (tx *TransactionV2) Weight() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL