Skip to content

Commit 8c759f6

Browse files
authored
docs: a layout of logs section of yellow paper (AztecProtocol#3582)
Partially AztecProtocol#3106 **Note**: There is not much in this PR since I don't really know how much of what [Mike](https://aztecprotocol.slack.com/team/U02B9GDJKAN) wrote [here](https://forum.aztec.network/t/issues-with-logs/2609/4?u=jan) is final (and I don't really understand what is data bus so don't really have the knowledge to finish that). I pointed out in the PR what needs to be discussed and expanded upon.
1 parent 3403877 commit 8c759f6

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

yellow-paper/docs/logs/index.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Logs
3+
---
4+
5+
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?
45+
:::

0 commit comments

Comments
 (0)