Skip to content

Create an 'Initial' Private Kernel Circuit #506

@dbanks12

Description

@dbanks12

Migrated from archived circuits repo: AztecProtocol/aztec3-circuits#200

"""
Currently, there's only 1 private kernel circuit.

That means for the very first iteration, we need to generate dummy 'previous kernel data'. The way we generate this data is inefficient, and the way we generate this data is inefficient (because we're currently generating actual VKs over a mock circuit).

Todo:

  • Separate c_bind for calling the initial native previous kernel circuit
  • A new struct for InitialPrivateKernelInputs and InitialPrivateKernelPublicInputs
  • Remove code which generates a dummy previous kernel (unless needed for testing, but I don't think we'll need that)
  • Write an initial native previous kernel circuit, which skips 'previous kernel proof verification' and any 'recursive case' logic
    • Make sure to re-use common codepaths between this circuit and the existing 'recursive' private kernel circuit (refactor to put functions in common files, if needed).
    • Make sure this circuit can only be called in the 'base case' (by including appropriate assertions inside the circuit)
  • Update the existing 'recursive' private kernel circuit:
    • remove:
      • The signature verification
      • TxRequest validation (we might even be able to remove the SignedTxRequest input altogether)
      • The 'base case' logic
      • Contract deployment logic (for now)
    • keep:
      • Verification of the 'previous kernel data'
      • recursive case logic
      • etc.
    • new:
      • A check on the previous kernel data's verification key -- that it matches the hard-coded one of the initial kernel circuit, when executing private_call_count = 2. (I.e. we're enforcing that private_call_count = 1 used the 'initial' circuit).
        • Note: for subsequent iterations of the kernel circuit, we can't check the verification key within the kernel circuit, because that's cyclic! We defer such verification key checks to the base rollup circuit. (A separate issue will be opened for this).
  • Typescript:
    • Work with someone to make corresponding changes to all the typescript code (mainly in the kernel-prover package), including structs.

"""

Story subtasks:

  1. Split private_kernel__sim cbind into ...sim and ...initial_sim #502
  2. Create native_private_kernel_initial function #503
  3. Move logic between initial and inner private kernels #504
  4. Update private_kernel__initial_sim cbind to use underlying initial function #505

Metadata

Metadata

Assignees

Labels

C-protocol-circuitsComponent: Protocol circuits (kernel & rollup)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions