AztecProtocol / aztec-packages

Apache License 2.0
190 stars 192 forks source link

Emit offchain data via oracle. #801

Open LeilaWang opened 1 year ago

LeilaWang commented 1 year ago

An app can emit "offchain" data via oracle, whenever it sees fit.

// oracle.nr
fn emit_offchain_data<MAX_LEN>(storage_slot: Field, data: [Field, MAX_LEN]);

The user should be able to find the offchain data in simulation result. They can either share it with relevant parties offline, or call PXE.addNote to store it for use in future transactions.

benesjan commented 1 year ago

@LeilaWang this has most likely been sufficiently addressed with my and Spyros's work on logs. There are now 2 oracles available for emitting encrypted or unencrypted logs.

The only thing which seems to be different is the data delivery because all the logs are pushed onchain as a part of the encoded block. But that is not so important, right?

iAmMichaelConnor commented 1 year ago

Interesting concept!

I suppose as a cost-saving measure there are two ways to emit data more cheaply than L1 (but without data availability guarantees):

Cool.