proofs

package
v5.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SpendProofPrefix = "SpendProof"

Variables

View Source
var TxProofV2DomainSeparatorHash = crypto.Keccak256([]byte("TXPROOF_V2")) // HASH_KEY_TXPROOF_V2

Functions

func GenerateTxProof

func GenerateTxProof[T curve25519.PointOperations](prefixHash types.Hash, R, A, B, D *curve25519.PublicKey[T], r *curve25519.Scalar, version uint8) (signature crypto.Signature[T])

func TxPrefixHash

func TxPrefixHash(txId types.Hash, message string) types.Hash

func VerifyTxProof

func VerifyTxProof[T curve25519.PointOperations](prefixHash types.Hash, R, A, B, D *curve25519.PublicKey[T], sig crypto.Signature[T], version uint8) (ok bool)

Types

type SignatureComm_2

type SignatureComm_2[T curve25519.PointOperations] struct {
	Message types.Hash
	// D Key Derivation
	D curve25519.PublicKey[T]
	// X Random Public Key
	X curve25519.PublicKey[T]
	// Y Random Public Derivation
	Y curve25519.PublicKey[T]

	// Separator Domain Separation
	Separator types.Hash
	// R Input public key
	R curve25519.PublicKey[T]
	A curve25519.PublicKey[T]
	B *curve25519.PublicKey[T]
}

SignatureComm_2 Used in v1/v2 tx proofs

func (*SignatureComm_2[T]) Bytes

func (s *SignatureComm_2[T]) Bytes(version uint8) []byte

type SpendProof

type SpendProof[T curve25519.PointOperations] struct {
	Version uint8

	Signatures []crypto.Signature[T]
}

func GetSpendProof

func GetSpendProof[T curve25519.PointOperations](txId types.Hash, message string, version uint8, ephemeralKeyPairs []*crypto.KeyPair[T], rings []ringct.Ring[T], randomReader io.Reader) (SpendProof[T], error)

func NewSpendProofFromSignatures

func NewSpendProofFromSignatures[T curve25519.PointOperations](version uint8, signatures []crypto.Signature[T]) SpendProof[T]

func NewSpendProofFromString

func NewSpendProofFromString[T curve25519.PointOperations](str string) (SpendProof[T], error)

func (SpendProof[T]) String

func (p SpendProof[T]) String() string

func (SpendProof[T]) Verify

func (p SpendProof[T]) Verify(prefixHash types.Hash, keyImages []curve25519.PublicKey[T], rings []ringct.Ring[T]) bool

type TxProof

type TxProof[T curve25519.PointOperations] struct {
	Type    TxProofType
	Version uint8

	Claims []TxProofClaim[T]
}

func NewTxProofFromSharedSecretBytesSignaturePairs added in v5.0.5

func NewTxProofFromSharedSecretBytesSignaturePairs[T curve25519.PointOperations](t TxProofType, version uint8, sharedSecrets []curve25519.PublicKeyBytes, signatures []crypto.Signature[T]) TxProof[T]

func NewTxProofFromSharedSecretSignaturePairs

func NewTxProofFromSharedSecretSignaturePairs[T curve25519.PointOperations](t TxProofType, version uint8, sharedSecrets []curve25519.PublicKey[T], signatures []crypto.Signature[T]) TxProof[T]

func NewTxProofFromString

func NewTxProofFromString[T curve25519.PointOperations](str string) (TxProof[T], error)

func (TxProof[T]) String

func (p TxProof[T]) String() string

func (TxProof[T]) Verify

func (p TxProof[T]) Verify(prefixHash types.Hash, viewPub, spendPub *curve25519.PublicKey[T], txPubs ...curve25519.PublicKey[T]) (index int, ok bool)

func (TxProof[T]) VerifyCarrot added in v5.0.5

func (p TxProof[T]) VerifyCarrot(prefixHash types.Hash, viewPub, spendPub *curve25519.PublicKey[T], txPubs ...curve25519.MontgomeryPoint) (index int, ok bool)

type TxProofClaim

type TxProofClaim[T curve25519.PointOperations] struct {
	// SharedSecret ECDH result, curve25519.PublicKey for legacy, curve25519.MontgomeryPoint in Carrot
	SharedSecret curve25519.PublicKeyBytes
	Signature    crypto.Signature[T]
}

type TxProofType

type TxProofType string
const (
	OutProof TxProofType = "OutProof"
	InProof  TxProofType = "InProof"
)

Jump to

Keyboard shortcuts

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