Skip to content

Comments

[WIP] Batch kernel MASM implementation#2372

Draft
krushimir wants to merge 3 commits into0xMiden:nextfrom
reilabs:batch-kernel
Draft

[WIP] Batch kernel MASM implementation#2372
krushimir wants to merge 3 commits into0xMiden:nextfrom
reilabs:batch-kernel

Conversation

@krushimir
Copy link

@krushimir krushimir commented Jan 30, 2026

Summary

Initial implementation of the batch kernel in MASM for proving transaction batches.

⚠️ Draft - not ready for review yet. Opening for visibility on progress.

Required Checks

  • Transaction list not empty
  • Transaction ids are not duplicated
  • Account state correctly updated (A→B→C ordering via LinkMap)
  • Account updates do not exceed MAX_ACCOUNTS_PER_BATCH
  • All transaction expiration blocks > batch reference block
  • batch_expiration_block_num = min(transaction expiration blocks)
  • Input notes not duplicated (no duplicate nullifiers)
  • Input/output note counts do not exceed limits
  • Erase consumed unauthenticated notes (note erasure)
  • Authenticate input notes with MMR proofs
  • Transaction verification stub (tx_id as commitment)

Implementation Tasks

  • Extract LinkMap from transaction kernel to shared module
  • Add batch kernel to miden-protocol, build.rs, export BatchKernel struct
  • Add utility functions (stack inputs, advice inputs, parse outputs)
  • Prologue: "Unhash" inputs, load everything from advice
  • Verify TRANSACTIONS_COMMITMENT hash
  • Account validation: Delta merging via LinkMap
  • Note validation: BatchNoteTree (SMT), note erasure
  • Epilogue: Compute real output commitments
  • Add ExecutionProof to ProvenBatch

Closes #1122

- add expiration check: `tx_expiration` > `block_num`
- compute batch_expiration as min of all tx expirations
- add placeholder for future STARK proof verification
- add test for expired transaction rejection
- update test to verify correct `batch_expiration` value
- fix `clippy` issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement batch kernel in MASM

1 participant