transaction

package
v0.0.0-...-950a2ea Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPairPlain

func NewPairPlain(sender, receiver string, amount float64, counter uint64, timestamp int64) (*Plain, *Plain)

Types

type AudOnChain

type AudOnChain struct {
	Commitment string `json:"commitment"`
	Hash       string `json:"hash"`
}

func NewAudOnChain

func NewAudOnChain(commitment, hash string) *AudOnChain

func (*AudOnChain) KeyVal

func (a *AudOnChain) KeyVal() (string, []byte, error)

func (*AudOnChain) ToPlain

func (a *AudOnChain) ToPlain() (*AudPlain, error)

type AudPlain

type AudPlain struct {
	Commitment []byte
	Hash       []byte
}

func NewAudPlain

func NewAudPlain(commitment, hash []byte) *AudPlain

func NewAudPlainFromPoint

func NewAudPlainFromPoint(commitment kyber.Point, hash []byte) (*AudPlain, error)

func (*AudPlain) ToOnChain

func (a *AudPlain) ToOnChain() *AudOnChain

type Hidden

type Hidden struct {
	Sender     []byte
	Receiver   []byte
	Commitment []byte
	Timestamp  int64
}

Hidden is the struct for hidden transaction

func NewHidden

func NewHidden(sender, receiver, commitment []byte, timestamp int64) *Hidden

type LocalCommitmentOnChain

type LocalCommitmentOnChain struct {
	Commitment string `json:"commitment"`
}

func NewLocalCommitmentOnChain

func NewLocalCommitmentOnChain(commitment string) *LocalCommitmentOnChain

func (*LocalCommitmentOnChain) KeyVal

func (l *LocalCommitmentOnChain) KeyVal() (string, []byte, error)

func (*LocalCommitmentOnChain) ToPlain

type LocalCommitmentPlain

type LocalCommitmentPlain struct {
	Commitment []byte
}

func NewLocalCommitmentPlain

func NewLocalCommitmentPlain(commitment []byte) *LocalCommitmentPlain

func (*LocalCommitmentPlain) Serialize

func (l *LocalCommitmentPlain) Serialize() ([]byte, error)

func (*LocalCommitmentPlain) ToOnChain

type LocalOnChain

type LocalOnChain struct {
	Commitment  string `json:"commitment"`
	MerkleRoot  string `json:"merkle_root"`
	MerkleProof string `json:"merkle_proof"`
}

func NewLocalOnChain

func NewLocalOnChain(commitment, merkleRoot, merkleProof string) *LocalOnChain

func (*LocalOnChain) KeyVal

func (l *LocalOnChain) KeyVal() (string, []byte, error)

func (*LocalOnChain) ToPlain

func (l *LocalOnChain) ToPlain() (*LocalPlain, error)

type LocalPlain

type LocalPlain struct {
	Commitment  []byte
	MerkleRoot  []byte
	MerkleProof []byte
}

func NewLocalPlain

func NewLocalPlain(commitment, merkleRoot, merkleProof []byte) *LocalPlain

func NewLocalPlainFromProof

func NewLocalPlainFromProof(commitment, merkleRoot []byte, merkleProof *mt.Proof) (*LocalPlain, error)

func (*LocalPlain) Serialize

func (l *LocalPlain) Serialize() ([]byte, error)

func (*LocalPlain) ToOnChain

func (l *LocalPlain) ToOnChain() *LocalOnChain

type OrgOnChain

type OrgOnChain struct {
	MerkleRoot string `json:"merkle_root"`
}

func NewOrgOnChain

func NewOrgOnChain(merkleRoot string) *OrgOnChain

func (*OrgOnChain) KeyVal

func (o *OrgOnChain) KeyVal() (string, []byte, error)

func (*OrgOnChain) ToPlain

func (o *OrgOnChain) ToPlain() (*OrgPlain, error)

type OrgPlain

type OrgPlain struct {
	MerkleRoot []byte
}

func NewOrgPlain

func NewOrgPlain(merkleRoot []byte) *OrgPlain

func (*OrgPlain) ToOnChain

func (o *OrgPlain) ToOnChain() *OrgOnChain

type Plain

type Plain struct {
	Sender    string
	Receiver  string
	Amount    int64
	Counter   uint64
	Timestamp int64
}

Plain is the struct for plaintext transaction

func NewPlain

func NewPlain(sender, receiver string, amount float64, counter uint64, timestamp int64) *Plain

NewPlain creates a new plaintext transaction

func (*Plain) Hide

func (p *Plain) Hide() (*Hidden, kyber.Point, error)

Jump to

Keyboard shortcuts

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