risc0

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateClaimDigest

func CalculateClaimDigest(imageID [32]byte, journalDigest [32]byte) [32]byte

func GetVerifierParameters

func GetVerifierParameters() map[string]VerifierParameters

Types

type ExitCode

type ExitCode struct {
	System SystemExitCode
	User   uint8
}

ExitCode is the exit condition indicated by the zkVM at the end of the guest execution

type Output

type Output struct {
	JournalDigest     [32]byte
	AssumptionsDigest [32]byte
}

Output field in the `ReceiptClaim`, committing to a claimed journal and assumptions list.

func (Output) Digest

func (o Output) Digest() [32]byte

type ReceiptClaim

type ReceiptClaim struct {
	PreStateDigest  [32]byte
	PostStateDigest [32]byte
	ExitCode        ExitCode
	Input           [32]byte
	Output          [32]byte
}

Public claims about a zkVM guest execution, such as the journal committed to by the guest.

func GetOKReceiptClaim

func GetOKReceiptClaim(systemStateZeroDigest, imageId, journalDigest [32]byte) ReceiptClaim

func (ReceiptClaim) Digest

func (rc ReceiptClaim) Digest() [32]byte

type SystemExitCode

type SystemExitCode uint8

Exit condition indicated by the zkVM at the end of the execution covered by this proof.

const (
	// `Halted` indicates normal termination of a program with an interior exit code returned from the
	// guest program. A halted program cannot be resumed.
	Halted SystemExitCode = iota
	// `Paused` indicates the execution ended in a paused state with an interior exit code set by the
	// guest program. A paused program can be resumed such that execution picks up where it left
	// of, with the same memory state.
	Paused
	// `SystemSplit` indicates the execution ended on a host-initiated system split. System split is
	// mechanism by which the host can temporarily stop execution of the execution ended in a system
	// split has no output and no conclusions can be drawn about whether the program will eventually
	// halt. System split is used in continuations to split execution into individually provable segments.
	SystemSplit
)

type VerifierParameters

type VerifierParameters struct {
	ControlRoot    [32]byte
	BN254ControlID [32]byte
}

func FindVerifierParameters

func FindVerifierParameters(version string) (VerifierParameters, bool)

Jump to

Keyboard shortcuts

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