Skip to content

Recursive ZK proof Host #84

Description

@freesig

Host

Add a function that takes:

  • elf bytecode of the recursive proof
  • Receipts from each state proof in order
    The function should
  • Add the receipts as assumptions
  • Write the journals from each receipt as private inputs
  • Write the RecursiveArgs as a private input
  • Run the proof
  • Serialize the proof

Keep serialization custom and efficient. Don't use serde.

pub fn recursive_proof(input: Input, elf: &[u8]) {}

// Host side

pub struct Input {
	pub recursive: RecursiveArgs,
	pub receipts: Vec<Receipt>,
}

pub enum RecursiveArgs {
	Init(Init),
	Step(Receipt),
}

// Guest Side

pub enum RecursiveInput<D> {
	Init(Init),
	Step(Step<D>),
}

pub struct Init {
	pub this_image_id: [u32; 8],
}

pub struct Step<D> {
	pub previous_commit: Commit<D>,
}

pub struct Commit<D> {
	pub this_image_id: [u32; 8],
	pub state_commit: StateCommit<D>,
}

pub struct StateCommit<D> {
	pub previous_block_hash: [u8; 32]
	pub block_hash: [u8; 32]
	pub block_height: u64,
	pub previous_digest: D,
	pub new_digest: D,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions