Skip to content

Commit

Permalink
Merge branch 'master' into tf/fixed-length-black-box-arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm authored Apr 15, 2024
2 parents 1eb0608 + 9734455 commit a202405
Show file tree
Hide file tree
Showing 329 changed files with 3,838 additions and 12,183 deletions.
110 changes: 48 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -759,35 +759,35 @@ jobs:
aztec_manifest_key: end-to-end
<<: *defaults_e2e_test

bench-publish-rollup:
steps:
- *checkout
- *setup_env
- run:
name: "Benchmark"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_publish_rollup.test.ts DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees
aztec_manifest_key: end-to-end
<<: *defaults_e2e_test

bench-process-history:
steps:
- *checkout
- *setup_env
- run:
name: "Benchmark"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_process_history.test.ts DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees
aztec_manifest_key: end-to-end
<<: *defaults_e2e_test

bench-tx-size:
steps:
- *checkout
- *setup_env
- run:
name: "Benchmark"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_tx_size_fees.test.ts ENABLE_GAS=1 DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees
aztec_manifest_key: end-to-end
<<: *defaults_e2e_test
# bench-publish-rollup:
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Benchmark"
# command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_publish_rollup.test.ts DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees
# aztec_manifest_key: end-to-end
# <<: *defaults_e2e_test

# bench-process-history:
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Benchmark"
# command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_process_history.test.ts DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees
# aztec_manifest_key: end-to-end
# <<: *defaults_e2e_test

# bench-tx-size:
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Benchmark"
# command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_tx_size_fees.test.ts ENABLE_GAS=1 DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees
# aztec_manifest_key: end-to-end
# <<: *defaults_e2e_test

build-docs:
machine:
Expand All @@ -807,18 +807,6 @@ jobs:
echo "Deploying docs"
docs/deploy_netlify.sh $BRANCH $PULL_REQUEST
yellow-paper:
machine:
image: default
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build yellow paper"
command: build yellow-paper
aztec_manifest_key: yellow-paper

e2e-join:
docker:
- image: cimg/base:2023.09
Expand All @@ -837,15 +825,15 @@ jobs:
name: "Noop"
command: echo Noop

bench-summary:
machine:
image: default
steps:
- *checkout
- *setup_env
- run:
name: "Assemble benchmark summary from uploaded logs"
command: ./scripts/ci/assemble_e2e_benchmark.sh
# bench-summary:
# machine:
# image: default
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Assemble benchmark summary from uploaded logs"
# command: ./scripts/ci/assemble_e2e_benchmark.sh

# Deploy & release jobs.
deploy-and-release:
Expand All @@ -869,6 +857,7 @@ jobs:
command: |
should_deploy || exit 0
deploy_terraform_services iac/mainnet-fork mainnet-fork mainnet-fork aws_efs_file_system.aztec_mainnet_fork_data_store
./iac/scripts/wait_for_fork
- run:
name: "Release canary to NPM: bb.js"
command: |
Expand Down Expand Up @@ -1072,8 +1061,6 @@ workflows:

- mainnet-fork: *defaults

- yellow-paper: *defaults

- noir-projects:
requires:
- avm-transpiler
Expand Down Expand Up @@ -1177,22 +1164,21 @@ workflows:
- guides-up-quick-start
- boxes-vanilla
- boxes-react
- yellow-paper
- noir-packages-tests
- yarn-project-test
- prover-client-test
<<: *defaults

# Benchmark jobs.
- bench-publish-rollup: *e2e_test
- bench-process-history: *e2e_test
- bench-tx-size: *e2e_test
- bench-summary:
requires:
- bench-publish-rollup
- bench-process-history
- bench-tx-size
<<: *defaults
# - bench-publish-rollup: *e2e_test
# - bench-process-history: *e2e_test
# - bench-tx-size: *e2e_test
# - bench-summary:
# requires:
# - bench-publish-rollup
# - bench-process-history
# - bench-tx-size
# <<: *defaults

# Production releases.
- deploy-and-release: *defaults_deploy
4 changes: 0 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Now when a new file is pasted in /yellow-paper/docs/readme.md, the image file is created at /yellow-paper/docs/images/readme/image.png.
"markdown.copyFiles.destination": {
"/yellow-paper/**/*": "images/${documentBaseName}/"
},
///////////////////////////////////////
// C++/Circuits settings
///////////////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ When opening the pull request you will be presented with a template and a series
If you're looking for a good place to start, look for issues labeled ["good first issue"](https://github.com/AztecProtocol/aztec-packages/labels/good%20first%20issue)!

## Pull request checklist:

- I've provided a paragraph or two giving a summary of the change in the description, including relevant motivation and context.
- I've enabled auto-merge if the PR is ready to merge.
- I have updated the yellow paper when making changes to associated functionality (e.g. outward-facing spec changes).
- I have updated the protocol specs in the docs (aka the yellow paper) when making changes to associated functionality (e.g. outward-facing spec changes).
- I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
- Every change is related to the PR description.
- I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist).
2 changes: 1 addition & 1 deletion avm-transpiler/src/opcodes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// All AVM opcodes
/// Keep updated with TS and yellow paper!
/// Keep updated with TS and docs protocol specs!
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum AvmOpcode {
// Compute
Expand Down
5 changes: 4 additions & 1 deletion barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ bench-binaries:

# Runs on the bench image, sent from the builder runner
bench-ultra-honk:
BUILD +wasmtime # prefetch
FROM +source
COPY --dir +bench-binaries/* .
# install SRS needed for proving
Expand All @@ -198,6 +199,7 @@ bench-ultra-honk:
RUN cd wasm && wasmtime run --env HARDWARE_CONCURRENCY=16 -Wthreads=y -Sthreads=y --dir=".." ./bin/ultra_honk_bench --benchmark_filter="construct_proof_ultrahonk_power_of_2/20$"

bench-client-ivc:
BUILD +wasmtime # prefetch
FROM +source
COPY --dir +bench-binaries/* .
# install SRS needed for proving
Expand Down Expand Up @@ -232,9 +234,10 @@ test-clang-format:
RUN ./format.sh check

test:
BUILD +test-clang-format
BUILD ./srs_db/+build # prefetch
FROM +source
COPY --dir +test-binaries/build build
BUILD +test-clang-format
FROM +preset-release-assert-test
COPY --dir ./srs_db/+build/. srs_db
RUN cd build && GTEST_COLOR=1 ctest -j$(nproc) --output-on-failure
2 changes: 1 addition & 1 deletion boxes/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ build:
ENV AZTEC_CLI=/usr/src/yarn-project/cli/aztec-cli-dest
RUN yarn && yarn build
RUN npx -y playwright@1.42 install --with-deps
ENTRYPOINT ["/bin/sh", "-c"]
ENTRYPOINT ["/bin/sh", "-c"]
5 changes: 0 additions & 5 deletions build_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,3 @@ docs:
- noir-packages
- l1-contracts
- noir-projects

yellow-paper:
buildDir: yellow-paper
rebuildPatterns:
- ^yellow-paper/
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ address_crh(
}
```

The `public_keys` array can vary depending on the format of keys used by the address, but it is suggested it includes the master keys defined in the [keys section](./keys.mdx). For example:
The `public_keys` array can vary depending on the format of keys used by the address, but it is suggested it includes the master keys defined in the [keys section](./keys.md). For example:

```rust
let public_keys_hash: Field = poseidon2(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Diversified and Stealth Accounts
---

The [keys specification](./keys.mdx) describes derivation mechanisms for diversified and stealth public keys. However, the protocol requires users to interact with addresses.
The [keys specification](./keys.md) describes derivation mechanisms for diversified and stealth public keys. However, the protocol requires users to interact with addresses.

## Computing Addresses

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<!-- @dev: if you want to import the preamble, remember to make the importing file a `.mdx` file. -->

import LatexPreamble from "../0-keys-latex-preamble.md";
<LatexPreamble />;

## Deriving diversified public keys

A diversified public key can be derived from Alice's keys, to enhance Alice's transaction privacy. If Alice's counterparties' databases are compromised, it enables Alice to retain privacy from such leakages. Diversified public keys are used for generating diversified addresses.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<!-- @dev: if you want to import the preamble, remember to make the importing file a `.mdx` file. -->

import LatexPreamble from "../0-keys-latex-preamble.md";
<LatexPreamble />;

## Encrypt and tag an incoming message

Bob wants to send Alice a private message, e.g. the contents of a note, which we'll refer to as the $\plaintext$. Bob and Alice are using a "tag hopping" scheme to help with note discovery. Let's assume they've already handshaked to establish a shared secret $\sharedsecret_{m,tagging}^{Bob \rightarrow Alice}$, from which a sequence of tags $\tagg_{m,i}^{Bob \rightarrow Alice}$ can be derived.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<!-- @dev: if you want to import the preamble, remember to make the importing file a `.mdx` file. -->

import LatexPreamble from "../0-keys-latex-preamble.md";
<LatexPreamble />;

## Deriving a nullifier within an app contract

Let's assume a developer wants a nullifier of a note to be derived as:
Expand All @@ -17,14 +12,14 @@ Here's example for how an app circuit _could_ constrain the nullifier key to be

It's easiest to take a look at this first:

![Alt text](../images/addresses-and-keys/image.png)
![Alt text](/img/protocol-specs/addresses-and-keys/image.png)

### Within the app circuit

Within the app, we can prove links between:

- the user's [$\nskapp$](../keys.mdx#app-siloed-nullifier-secret-key) and their [$\Nkapp$](../keys.mdx#app-siloed-nullifier-key); and between
- the user's [$\Npkm$](../keys.mdx#master-nullifier-public-key) and their [$\address$](../address.md).
- the user's [$\nskapp$](../keys.md#app-siloed-nullifier-secret-key) and their [$\Nkapp$](../keys.md#app-siloed-nullifier-key); and between
- the user's [$\Npkm$](../keys.md#master-nullifier-public-key) and their [$\address$](../address.md).

The link that's missing is to prove that $\Npkm$ relates to $\nskapp$. To compute this missing link requires the $\nskm$, which MUST NOT be passed into an app circuit, and may only be passed into a kernel circuit. See the next ['Within the kernel circuit'](#within-the-kernel-circuit) section for details of this logic.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<!-- @dev: if you want to import the preamble, remember to make this importing file a `.mdx` file. -->

import LatexPreamble from "../0-keys-latex-preamble.md";
<LatexPreamble />;

# Handshaking for tag-hopping

Deriving a sequence of tags for tag-hopping.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Keys in Aztec are used both for authorization and privacy. Authorization keys ar

Privacy keys are used for note encryption, tagging, and nullifying. These are also not enforced by the protocol. However, for facilitating composability, the protocol enshrines a set of enshrined encryption and tagging mechanisms, that can be leveraged by applications as they interact with accounts.

The [requirements](./keys-requirements.md) section outlines the features that were sought when designing Aztec's addresses and keys. We then specify how [addresses](./address.md) are derived, as well as the default way in which [keys](./keys.mdx) will be derived. The [precompiles](./precompiles.md) section describes enshrined contract addresses, with implementations defined by the protocol, used for note encryption and tagging.
The [requirements](./keys-requirements.md) section outlines the features that were sought when designing Aztec's addresses and keys. We then specify how [addresses](./address.md) are derived, as well as the default way in which [keys](./keys.md) will be derived. The [precompiles](./precompiles.md) section describes enshrined contract addresses, with implementations defined by the protocol, used for note encryption and tagging.

Last, the [diversified and stealth accounts](./diversified-and-stealth.md) sections describe application-level recommendations for diversified and stealth accounts.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ description: Specification for default privacy keys format and derivation, and n

<!-- @dev: if you want to import the preamble, remember to make the importing file a `.mdx` file. -->

import LatexPreamble from "./0-keys-latex-preamble.md";
<LatexPreamble />;

## Cheat Sheet

The protocol does not enforce the usage of any of the following keys, and does not enforce the keys to conform to a particular length or algorithm. Users are expected to pick a set of keys valid for the encryption and tagging precompile they choose for their account.
Expand Down Expand Up @@ -51,7 +48,7 @@ The protocol does not enforce the usage of any of the following keys, and does n
Diagram is out of date vs the content on this page
:::

![Alt text](images/addresses-and-keys/image-5.png)
<Image img={require("/img/protocol-specs/addresses-and-keys/image-5.png")} />

The red boxes are uncertainties, which are explained later in this doc.

Expand Down
Loading

0 comments on commit a202405

Please sign in to comment.