From f77fb5a059cae926180469b1fe4675d1a29c541e Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 5 Dec 2023 16:47:03 +0000 Subject: [PATCH 1/4] WIP --- yellow-paper/docs/logs/index.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 yellow-paper/docs/logs/index.md diff --git a/yellow-paper/docs/logs/index.md b/yellow-paper/docs/logs/index.md new file mode 100644 index 000000000000..5563b7610fe8 --- /dev/null +++ b/yellow-paper/docs/logs/index.md @@ -0,0 +1,6 @@ +--- +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. \ No newline at end of file From b3f7aeac5b281af5eef6c22f0bd790655f763dcf Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 6 Dec 2023 08:39:50 +0000 Subject: [PATCH 2/4] WIP --- yellow-paper/docs/logs/index.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/yellow-paper/docs/logs/index.md b/yellow-paper/docs/logs/index.md index 5563b7610fe8..d20ca9b98d94 100644 --- a/yellow-paper/docs/logs/index.md +++ b/yellow-paper/docs/logs/index.md @@ -3,4 +3,18 @@ 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. \ No newline at end of file +Logs are events which are emitted during contract function execution. + +There are 2 kinds of logs in Aztec protocol: unencrypted and encrypted. + +## Unencrypted logs +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 because it might allow for interesting usecases like custom encryption schemes using FHE etc. +::: + +## Encrypted logs +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. \ No newline at end of file From a79a3805c292b613bea89c494546cd4ae88073c5 Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 13 Dec 2023 11:03:52 +0000 Subject: [PATCH 3/4] WIP --- yellow-paper/docs/logs/index.md | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/yellow-paper/docs/logs/index.md b/yellow-paper/docs/logs/index.md index d20ca9b98d94..c5ed01e12a61 100644 --- a/yellow-paper/docs/logs/index.md +++ b/yellow-paper/docs/logs/index.md @@ -4,17 +4,42 @@ 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 on the chosen data availability layer, +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 logs +## 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 because it might allow for interesting usecases like custom encryption schemes using FHE etc. +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 logs +## 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. \ No newline at end of file +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? +::: \ No newline at end of file From 7c1242a272fe3de22c35d090d640d77393643dfc Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 13 Dec 2023 16:19:01 +0000 Subject: [PATCH 4/4] fix --- yellow-paper/docs/logs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yellow-paper/docs/logs/index.md b/yellow-paper/docs/logs/index.md index c5ed01e12a61..2e8f5c2731ad 100644 --- a/yellow-paper/docs/logs/index.md +++ b/yellow-paper/docs/logs/index.md @@ -5,7 +5,7 @@ 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 on the chosen data availability layer, +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).