-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: a layout of logs section of yellow paper (#3582)
Partially #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.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Logs | ||
--- | ||
|
||
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. | ||
Logs are events which are emitted during contract function execution. | ||
Aztec protocol gives users the following assurances: | ||
1. The logs get published, | ||
2. log integrity (the logs are not modified once emitted), | ||
3. address of the source contract is verified to be correct (a contract can't impersonate another one). | ||
|
||
:::warning Expand on how this is ensured in circuits once [this discussion](https://forum.aztec.network/t/issues-with-logs/2609/) is wrapped up. | ||
::: | ||
|
||
# Types | ||
There are 2 kinds of logs in Aztec protocol: unencrypted and encrypted. | ||
|
||
## Unencrypted | ||
Unencrypted logs are used to communicate public information out of smart contracts. | ||
Unencrypted logs can be emitted from both public and private functions. | ||
|
||
:::info | ||
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. | ||
::: | ||
|
||
## Encrypted | ||
Encrypted logs can be emitted only from private functions. | ||
This is because to encrypt the log we need to get a secret and it's impossible to privately manage secrets in public domain. | ||
|
||
:::info | ||
An important usecase of encrypted logs is delivery of notes (note commitment/hash preimage) to recipients. | ||
::: | ||
|
||
### Log encryption | ||
|
||
:::warning | ||
Expand here how exactly the logs are encrypted. | ||
I (benesjan) am not up-to-date on what is the encryption end-game. | ||
::: | ||
|
||
# Encoding | ||
Just like on Ethereum, logs are ABI encoded. | ||
|
||
:::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? | ||
::: |