blindbid

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MBid

func MBid(r *rusk.Bid, f *Bid)

MBid copies the Bid structure into the Rusk equivalent.

func MBidList

func MBidList(r *rusk.BidList, f *BidList)

MBidList copies the BidList structure into the Rusk equivalent.

func MBidTransactionRequest

func MBidTransactionRequest(r *rusk.BidTransactionRequest, f *BidTransactionRequest)

MBidTransactionRequest copies the BidTransactionRequest structure into the Rusk equivalent.

func MFindBidRequest

func MFindBidRequest(r *rusk.FindBidRequest, f *FindBidRequest)

MFindBidRequest copies the FindBidRequest structure into the Rusk equivalent.

func MGenerateScoreRequest

func MGenerateScoreRequest(r *rusk.GenerateScoreRequest, f *GenerateScoreRequest)

MGenerateScoreRequest copies the GenerateScoreRequest structure into the Rusk equivalent.

func MGenerateScoreResponse

func MGenerateScoreResponse(r *rusk.GenerateScoreResponse, f *GenerateScoreResponse)

MGenerateScoreResponse copies the GenerateScoreResponse structure into the Rusk equivalent.

func MVerifyScoreRequest

func MVerifyScoreRequest(r *rusk.VerifyScoreRequest, f *VerifyScoreRequest)

MVerifyScoreRequest copies the VerifyScoreRequest structure into the Rusk equivalent.

func MVerifyScoreResponse

func MVerifyScoreResponse(r *rusk.VerifyScoreResponse, f *VerifyScoreResponse)

MVerifyScoreResponse copies the VerifyScoreResponse structure into the Rusk equivalent.

func MarshalBid

func MarshalBid(r *bytes.Buffer, f *Bid) error

MarshalBid writes the Bid struct into a bytes.Buffer.

func MarshalBidList

func MarshalBidList(r *bytes.Buffer, f *BidList) error

MarshalBidList writes the BidList struct into a bytes.Buffer.

func MarshalBidTransactionRequest

func MarshalBidTransactionRequest(r *bytes.Buffer, f *BidTransactionRequest) error

MarshalBidTransactionRequest writes the BidTransactionRequest struct into a bytes.Buffer.

func MarshalFindBidRequest

func MarshalFindBidRequest(r *bytes.Buffer, f *FindBidRequest) error

MarshalFindBidRequest writes the FindBidRequest struct into a bytes.Buffer.

func MarshalGenerateScoreRequest

func MarshalGenerateScoreRequest(r *bytes.Buffer, f *GenerateScoreRequest) error

MarshalGenerateScoreRequest writes the GenerateScoreRequest struct into a bytes.Buffer.

func MarshalGenerateScoreResponse

func MarshalGenerateScoreResponse(r *bytes.Buffer, f *GenerateScoreResponse) error

MarshalGenerateScoreResponse writes the GenerateScoreResponse struct into a bytes.Buffer.

func MarshalVerifyScoreRequest

func MarshalVerifyScoreRequest(r *bytes.Buffer, f *VerifyScoreRequest) error

MarshalVerifyScoreRequest writes the VerifyScoreRequest struct into a bytes.Buffer.

func MarshalVerifyScoreResponse

func MarshalVerifyScoreResponse(r *bytes.Buffer, f *VerifyScoreResponse) error

MarshalVerifyScoreResponse writes the VerifyScoreResponse struct into a bytes.Buffer.

func UBid

func UBid(r *rusk.Bid, f *Bid)

UBid copies the Rusk Bid structure into the native equivalent.

func UBidList

func UBidList(r *rusk.BidList, f *BidList)

UBidList copies the Rusk BidList structure into the native equivalent.

func UBidTransactionRequest

func UBidTransactionRequest(r *rusk.BidTransactionRequest, f *BidTransactionRequest)

UBidTransactionRequest copies the Rusk BidTransactionRequest structure into the native equivalent.

func UFindBidRequest

func UFindBidRequest(r *rusk.FindBidRequest, f *FindBidRequest)

UFindBidRequest copies the Rusk FindBidRequest structure into the native equivalent.

func UGenerateScoreRequest

func UGenerateScoreRequest(r *rusk.GenerateScoreRequest, f *GenerateScoreRequest)

UGenerateScoreRequest copies the Rusk GenerateScoreRequest structure into the native equivalent.

func UGenerateScoreResponse

func UGenerateScoreResponse(r *rusk.GenerateScoreResponse, f *GenerateScoreResponse)

UGenerateScoreResponse copies the Rusk GenerateScoreResponse structure into the native equivalent.

func UVerifyScoreRequest

func UVerifyScoreRequest(r *rusk.VerifyScoreRequest, f *VerifyScoreRequest)

UVerifyScoreRequest copies the Rusk VerifyScoreRequest structure into the native equivalent.

func UVerifyScoreResponse

func UVerifyScoreResponse(r *rusk.VerifyScoreResponse, f *VerifyScoreResponse)

UVerifyScoreResponse copies the Rusk VerifyScoreResponse structure into the native equivalent.

func UnmarshalBid

func UnmarshalBid(r *bytes.Buffer, f *Bid) error

UnmarshalBid reads a Bid struct from a bytes.Buffer.

func UnmarshalBidList

func UnmarshalBidList(r *bytes.Buffer, f *BidList) error

UnmarshalBidList reads a BidList struct from a bytes.Buffer.

func UnmarshalBidTransactionRequest

func UnmarshalBidTransactionRequest(r *bytes.Buffer, f *BidTransactionRequest) error

UnmarshalBidTransactionRequest reads a BidTransactionRequest struct from a bytes.Buffer.

func UnmarshalFindBidRequest

func UnmarshalFindBidRequest(r *bytes.Buffer, f *FindBidRequest) error

UnmarshalFindBidRequest reads a FindBidRequest struct from a bytes.Buffer.

func UnmarshalGenerateScoreRequest

func UnmarshalGenerateScoreRequest(r *bytes.Buffer, f *GenerateScoreRequest) error

UnmarshalGenerateScoreRequest reads a GenerateScoreRequest struct from a bytes.Buffer.

func UnmarshalGenerateScoreResponse

func UnmarshalGenerateScoreResponse(r *bytes.Buffer, f *GenerateScoreResponse) error

UnmarshalGenerateScoreResponse reads a GenerateScoreResponse struct from a bytes.Buffer.

func UnmarshalVerifyScoreRequest

func UnmarshalVerifyScoreRequest(r *bytes.Buffer, f *VerifyScoreRequest) error

UnmarshalVerifyScoreRequest reads a VerifyScoreRequest struct from a bytes.Buffer.

func UnmarshalVerifyScoreResponse

func UnmarshalVerifyScoreResponse(r *bytes.Buffer, f *VerifyScoreResponse) error

UnmarshalVerifyScoreResponse reads a VerifyScoreResponse struct from a bytes.Buffer.

Types

type Bid

type Bid struct {
	EncryptedData  []byte               `json:"encrypted_data"`
	HashedSecret   []byte               `json:"hashed_secret"`
	Nonce          []byte               `json:"nonce"`
	StealthAddress *keys.StealthAddress `json:"stealth_address"`
	Commitment     []byte               `json:"commitment"`
	Eligibility    []byte               `json:"eligibility"`
	Expiration     []byte               `json:"expiration"`
}

Bid represents a blind bid, made by a block generator.

func (*Bid) Copy

func (b *Bid) Copy() *Bid

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type BidList

type BidList struct {
	BidList     []*Bid   `json:"bid_list"`
	BidHashList [][]byte `json:"bid_hash_list"`
}

BidList is the collection of all blind bids.

func (*BidList) Copy

func (b *BidList) Copy() *BidList

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type BidTransactionRequest

type BidTransactionRequest struct {
	K                    []byte               `json:"k"`
	Value                uint64               `json:"value"`
	Secret               []byte               `json:"secret"`
	StealthAddress       *keys.StealthAddress `json:"stealth_address"`
	Seed                 []byte               `json:"seed"`
	LatestConsensusRound uint64               `json:"latest_consensus_round"`
	LatestConsensusStep  uint64               `json:"latest_consensus_step"`
	GasLimit             uint64               `json:"gas_limit"`
	GasPrice             uint64               `json:"gas_price"`
}

BidTransactionRequest is used to construct a Bid transaction.

func (*BidTransactionRequest) Copy

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type FindBidRequest

type FindBidRequest struct {
	StealthAddress *keys.StealthAddress `json:"stealth_address"`
}

FindBidRequest is used to find a specific Bid belonging to a public key.

func (*FindBidRequest) Copy

func (f *FindBidRequest) Copy() *FindBidRequest

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type GenerateScoreRequest

type GenerateScoreRequest struct {
	K              []byte `json:"k"`
	Seed           []byte `json:"seed"`
	Secret         []byte `json:"secret"`
	Round          uint32 `json:"round"`
	Step           uint32 `json:"step"`
	IndexStoredBid uint64 `json:"index_stored_bid"`
}

GenerateScoreRequest is used by block generators to generate a score and a proof of blind bid, in order to propose a block.

func NewGenerateScoreRequest

func NewGenerateScoreRequest() *GenerateScoreRequest

NewGenerateScoreRequest returns a new empty GenerateScoreRequest struct.

func (*GenerateScoreRequest) Copy

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type GenerateScoreResponse

type GenerateScoreResponse struct {
	BlindbidProof  []byte `json:"blindbid_proof"`
	Score          []byte `json:"score"`
	ProverIdentity []byte `json:"prover_identity"`
}

GenerateScoreResponse contains the resulting proof of blind bid, score, and the prover identity, to be used for proposing a block.

func NewGenerateScoreResponse

func NewGenerateScoreResponse() *GenerateScoreResponse

NewGenerateScoreResponse returns a new empty GenerateScoreResponse struct.

func (*GenerateScoreResponse) Copy

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type VerifyScoreRequest

type VerifyScoreRequest struct {
	Proof    []byte `json:"proof"`
	Score    []byte `json:"score"`
	Seed     []byte `json:"seed"`
	ProverID []byte `json:"prover_id"`
	Round    uint64 `json:"round"`
	Step     uint32 `json:"step"`
}

VerifyScoreRequest is used by provisioners to ensure that a given blind bid proof is valid.

func (*VerifyScoreRequest) Copy

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

type VerifyScoreResponse

type VerifyScoreResponse struct {
	Success bool `json:"success"`
}

VerifyScoreResponse tells a provisioner whether a supplied proof is valid or not.

func (*VerifyScoreResponse) Copy

Copy complies with message.Safe interface. It returns a deep copy of the message safe to publish to multiple subscribers.

Jump to

Keyboard shortcuts

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