proofs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TestMode configures the SectorBuilder to be used with large sectors, in tests.
	TestMode = Mode(iota)
	// LiveMode configures the SectorBuilder to be used by someone operating a real
	// Filecoin node.
	LiveMode
)
View Source
const CommitmentBytesLen uint = 32

CommitmentBytesLen is the number of bytes in a CommR, CommD, and CommRStar.

View Source
const PoStBytesLen uint = 192

PoStBytesLen is the length of the Proof of SpaceTime proof.

View Source
const PoStChallengeSeedBytesLen uint = 32

PoStChallengeSeedBytesLen is the number of bytes in the Proof of SpaceTime challenge seed.

View Source
const SealBytesLen uint = 384

SealBytesLen is the length of the proof of Seal Proof of Replication.

Variables

This section is empty.

Functions

func CProofsMode

func CProofsMode(cfg Mode) (*C.ConfiguredStore, error)

CProofsMode marshals from Mode to the FFI type *C.ConfiguredStore.

Types

type CommD

type CommD [CommitmentBytesLen]byte

CommD is the merkle root of the original user data. It is an output of the sector sealing (PoRep) process.

type CommR

type CommR [CommitmentBytesLen]byte

CommR is the merkle root of the replicated data. It is an output of the sector sealing (PoRep) process.

type CommRStar

type CommRStar [CommitmentBytesLen]byte

CommRStar is a hash of intermediate layers. It is an output of the sector sealing (PoRep) process.

type FakeVerifier

type FakeVerifier struct {
	// contains filtered or unexported fields
}

FakeVerifier is a simple mock Verifier for testing

func NewFakeVerifier

func NewFakeVerifier(isValid bool, err error) FakeVerifier

NewFakeVerifier creates a new FakeVerifier struct

func (FakeVerifier) VerifyPoST

VerifyPoST returns the valid of verifyPostValid and verifyPostError. It fulfils a requirement for the Verifier interface

func (FakeVerifier) VerifySeal

VerifySeal panics. It fulfils a requirement for the Verifier interface

type Mode

type Mode int

Mode configures sealing, sector packing, PoSt generation and other behaviors of libfilecoin_proofs. Use Test mode to seal and generate PoSts quickly over tiny sectors. Use Live when operating a real Filecoin node.

type PoStChallengeSeed

type PoStChallengeSeed [PoStChallengeSeedBytesLen]byte

PoStChallengeSeed is an input to the proof-of-spacetime generation and verification methods.

type PoStProof

type PoStProof [PoStBytesLen]byte

PoStProof is the byte representation of the Proof of SpaceTime proof

type RustVerifier

type RustVerifier struct{}

RustVerifier provides proof-verification methods.

func (*RustVerifier) VerifyPoST

func (rp *RustVerifier) VerifyPoST(req VerifyPoSTRequest) (VerifyPoSTResponse, error)

VerifyPoST verifies that a proof-of-spacetime is valid.

func (*RustVerifier) VerifySeal

func (rp *RustVerifier) VerifySeal(req VerifySealRequest) (VerifySealResponse, error)

VerifySeal returns nil if the Seal operation from which its inputs were derived was valid, and an error if not.

type SealProof

type SealProof [SealBytesLen]byte

SealProof is the byte representation of the Seal Proof of Replication

type Verifier

type Verifier interface {
	VerifyPoST(VerifyPoSTRequest) (VerifyPoSTResponse, error)
	VerifySeal(VerifySealRequest) (VerifySealResponse, error)
}

Verifier provides an interface to the proving subsystem.

type VerifyPoSTRequest

type VerifyPoSTRequest struct {
	ChallengeSeed PoStChallengeSeed
	CommRs        []CommR
	Faults        []uint64
	Proofs        []PoStProof
	ProofsMode    Mode // used to control sealing/verification performance
}

VerifyPoSTRequest represents a request to generate verify a proof-of-spacetime.

type VerifyPoSTResponse

type VerifyPoSTResponse struct {
	IsValid bool
}

VerifyPoSTResponse communicates the validity of a provided proof-of-spacetime.

type VerifySealRequest

type VerifySealRequest struct {
	CommD      CommD     // returned from seal
	CommR      CommR     // returned from seal
	CommRStar  CommRStar // returned from seal
	Proof      SealProof // returned from Seal
	ProverID   [31]byte  // uniquely identifies miner
	SectorID   [31]byte  // uniquely identifies sector
	ProofsMode Mode      // used to control sealing/verification performance
}

VerifySealRequest represents a request to verify the output of a Seal() operation.

type VerifySealResponse

type VerifySealResponse struct {
	IsValid bool
}

VerifySealResponse communicates the validity of a provided proof-of-replication.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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