snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

[Feature] Add `Events` to finalize-scope in programs

Open raychu86 opened this issue 1 month ago • 0 comments

🚀 Feature

Events similar to Event types could be useful for developers to signal specific on-chain activity.

Motivation

Events would be nice for application developers to easily track on-chain activity that they are interested in. The current model would require each application developer to encode events via 2+ mappings:

  • 1 mapping for the number of total events that an application would query to see if there have been updates.
  • 1+ mappings for storing the events themselves.

A more direct approach would be to provide an Event emitter opcode to the finalize-scope that stores the designated objects directly to a DataMap in the node DB. This would be inline with a lot of developer expectations, especially those coming from Ethereum or other chains.

raychu86 avatar Nov 14 '25 23:11 raychu86