You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logs on Aztec are similar to logs on Ethereum and their goal is to allow smart contracts to communicate arbitrary data to the outside world.
6
+
Logs are events which are emitted during contract function execution.
7
+
Aztec protocol gives users the following assurances:
8
+
1. The logs get published,
9
+
2. log integrity (the logs are not modified once emitted),
10
+
3. address of the source contract is verified to be correct (a contract can't impersonate another one).
11
+
12
+
:::warning Expand on how this is ensured in circuits once [this discussion](https://forum.aztec.network/t/issues-with-logs/2609/) is wrapped up.
13
+
:::
14
+
15
+
# Types
16
+
There are 2 kinds of logs in Aztec protocol: unencrypted and encrypted.
17
+
18
+
## Unencrypted
19
+
Unencrypted logs are used to communicate public information out of smart contracts.
20
+
Unencrypted logs can be emitted from both public and private functions.
21
+
22
+
:::info
23
+
Emitting unencrypted logs from private functions can be a privacy leak but we decided to not forbid it in-protocol because it might allow for interesting usecases like custom encryption schemes using FHE etc.
24
+
:::
25
+
26
+
## Encrypted
27
+
Encrypted logs can be emitted only from private functions.
28
+
This is because to encrypt the log we need to get a secret and it's impossible to privately manage secrets in public domain.
29
+
30
+
:::info
31
+
An important usecase of encrypted logs is delivery of notes (note commitment/hash preimage) to recipients.
32
+
:::
33
+
34
+
### Log encryption
35
+
36
+
:::warning
37
+
Expand here how exactly the logs are encrypted.
38
+
I (benesjan) am not up-to-date on what is the encryption end-game.
39
+
:::
40
+
41
+
# Encoding
42
+
Just like on Ethereum, logs are ABI encoded.
43
+
44
+
:::warning As far as I know the encoding will be happening in app circuit and won't be enforced by protocol. Should this section not be here for this reason?
0 commit comments