Skip to content

Commit 76a1caf

Browse files
authored
feat: merge-train/fairies (#24951)
BEGIN_COMMIT_OVERRIDE chore(port): forward-port remaining v5-next fairies backlog to next (#24949) chore: remove unused l1-contracts repo mirror from release flow (#24929) chore: merge next into merge-train/fairies (resolve conflicts, unblock #24951) (#24965) chore: merge next into merge-train/fairies (resolve conflicts, unblock #24951) (#24967) END_COMMIT_OVERRIDE
2 parents e34759f + ec8d2e4 commit 76a1caf

75 files changed

Lines changed: 1412 additions & 838 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bootstrap.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -660,12 +660,10 @@ function private_release {
660660
fi
661661

662662
# Publish @aztec/l1-artifacts to the internal registry. 13 yarn-project packages depend on it at the
663-
# release version, so it must exist before yarn-project's release smoke-test installs them. We call
664-
# only the npm publish, not l1-contracts' full `release` — that also git-mirrors tags to the public
665-
# AztecProtocol/l1-contracts repo, which the private flow must not do. amd64 only (npm packages are
666-
# platform-independent; mirrors the publish guard below).
663+
# release version, so it must exist before yarn-project's release smoke-test installs them. amd64
664+
# only (npm packages are platform-independent; mirrors the publish guard below).
667665
if [ $(arch) != arm64 ]; then
668-
l1-contracts/bootstrap.sh release_l1_artifacts_npm
666+
l1-contracts/bootstrap.sh release
669667
fi
670668

671669
# Publish for real, in dependency order: bb.js, the noir packages, ipc-runtime, and wsdb must be on

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ services:
7272
environment:
7373
AZTEC_NODE_URL: http://node:8080
7474
NODE_NO_WARNINGS: 1
75-
SECRET_KEY:
75+
SIGNING_KEY:
7676
ETHEREUM_HOSTS:
7777
profiles:
7878
- cli

docs/docs-developers/docs/aztec-js/how_to_create_account.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ yarn add @aztec/aztec.js@#include_version_without_prefix @aztec/wallets@#include
2020

2121
## Create a new account
2222

23-
Using the [`wallet` from the connection guide](./how_to_connect_to_local_network.md), call `createSchnorrAccount` to create a new account with a random secret and salt:
23+
Using the [`wallet` from the connection guide](./how_to_connect_to_local_network.md), call `createSchnorrAccount` to create a new account with a random secret, salt, and signing key:
2424

2525
#include_code create_account /docs/examples/ts/aztecjs_connection/index.ts typescript
2626

27-
The secret is used to derive the account's encryption keys, and the salt ensures address uniqueness. The signing key is automatically derived from the secret.
27+
The secret derives the account's encryption keys, the signing key authenticates its transactions, and the salt ensures address uniqueness. The signing key is provided independently and is not derived from the secret: it is an ownership key, so keep it separate from the encryption secret that your PXE holds.
2828

29-
:::warning Store your secret and salt
30-
Save the `secret` and `salt` values securely. You need both to recover access to your account. If you lose them, you will permanently lose access to the account and any assets it holds.
29+
:::warning Store your secret, salt, and signing key
30+
Save the `secret`, `salt`, and `signingKey` values securely. You need all three to recover access to your account. If you lose them, you will permanently lose access to the account and any assets it holds.
3131
:::
3232

3333
## Deploy the account

docs/docs-developers/docs/foundational-topics/ethereum-aztec-messaging/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,29 @@ The following diagram shows the overall architecture, combining the earlier sect
118118

119119
<Image img={require("@site/static/img/com-abs-7.png")} />
120120

121+
## Using the L1 contract interfaces in your own project
122+
123+
Portal contracts import Aztec's L1 interfaces (`IRegistry`, `IInbox`, `IOutbox`, `IRollup`, and supporting libraries). These ship in the [`@aztec/l1-artifacts`](https://www.npmjs.com/package/@aztec/l1-artifacts) npm package as a self-contained Foundry project under `l1-contracts/`, versioned to match each Aztec release:
124+
125+
```bash
126+
npm install @aztec/l1-artifacts@<aztec-version>
127+
```
128+
129+
In a Foundry project, add remappings so `@aztec/*` imports (and the bundled OpenZeppelin copy) resolve into the package:
130+
131+
```toml
132+
# foundry.toml
133+
remappings = [
134+
"@aztec/=node_modules/@aztec/l1-artifacts/l1-contracts/src/",
135+
"@oz/=node_modules/@aztec/l1-artifacts/l1-contracts/lib/openzeppelin-contracts/contracts/",
136+
"@aztec-blob-lib/=node_modules/@aztec/l1-artifacts/l1-contracts/src/core/libraries/rollup/"
137+
]
138+
```
139+
140+
Then import interfaces as `@aztec/core/interfaces/IRollup.sol`, `@aztec/governance/interfaces/IRegistry.sol`, and so on. Note that `forge install` cannot fetch the package: it only clones whole git repositories, and the L1 contract sources include generated files that exist only in built distributions, so npm is the supported channel.
141+
142+
In a Hardhat project, import with full package paths (`@aztec/l1-artifacts/l1-contracts/src/core/interfaces/IRollup.sol`), or configure equivalent aliases pointing at `node_modules/@aztec/l1-artifacts/l1-contracts/src`.
143+
121144
## See also
122145

123146
- [Communicating Cross-Chain](../../aztec-nr/framework-description/ethereum_aztec_messaging.md) - Practical guide with code examples for L1-L2 messaging

docs/docs-developers/docs/tutorials/js_tutorials/aave_bridge.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ Start with the Hardhat + Aztec template. This provides a pre-configured Hardhat
110110

111111
This template is a community-maintained starter. If the repository is unavailable, you can set up a Hardhat project manually and add the `@aztec/*` Solidity remappings from the [cross-chain messaging docs](../../foundational-topics/ethereum-aztec-messaging/index.md).
112112

113-
You may need to update the `@aztec/l1-contracts` tag in the template's `package.json` to match your Aztec version, e.g.:
113+
You may need to replace the `@aztec/l1-contracts` dependency in `package.json` with the `@aztec/l1-artifacts` npm package at the version matching your Aztec version, e.g.:
114114

115115
```json
116-
"@aztec/l1-contracts": "git+https://github.com/AztecProtocol/l1-contracts.git#v5.0.1"
116+
"@aztec/l1-artifacts": "5.0.1"
117117
```
118118

119+
The package ships the L1 contract sources under `@aztec/l1-artifacts/l1-contracts/src`; update any `@aztec/*` Solidity remappings or aliases in the project to point at `node_modules/@aztec/l1-artifacts/l1-contracts/src`.
120+
119121
:::
120122

121123
```bash
@@ -312,13 +314,13 @@ The portal is where the magic happens. It bridges Aztec's cross-chain messages w
312314
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
313315
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
314316
315-
import {IRegistry} from "@aztec/l1-contracts/src/governance/interfaces/IRegistry.sol";
316-
import {IInbox} from "@aztec/l1-contracts/src/core/interfaces/messagebridge/IInbox.sol";
317-
import {IOutbox} from "@aztec/l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol";
318-
import {IRollup} from "@aztec/l1-contracts/src/core/interfaces/IRollup.sol";
319-
import {DataStructures} from "@aztec/l1-contracts/src/core/libraries/DataStructures.sol";
320-
import {Hash} from "@aztec/l1-contracts/src/core/libraries/crypto/Hash.sol";
321-
import {Epoch} from "@aztec/l1-contracts/src/core/libraries/TimeLib.sol";
317+
import {IRegistry} from "@aztec/l1-artifacts/l1-contracts/src/governance/interfaces/IRegistry.sol";
318+
import {IInbox} from "@aztec/l1-artifacts/l1-contracts/src/core/interfaces/messagebridge/IInbox.sol";
319+
import {IOutbox} from "@aztec/l1-artifacts/l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol";
320+
import {IRollup} from "@aztec/l1-artifacts/l1-contracts/src/core/interfaces/IRollup.sol";
321+
import {DataStructures} from "@aztec/l1-artifacts/l1-contracts/src/core/libraries/DataStructures.sol";
322+
import {Hash} from "@aztec/l1-artifacts/l1-contracts/src/core/libraries/crypto/Hash.sol";
323+
import {Epoch} from "@aztec/l1-artifacts/l1-contracts/src/core/libraries/TimeLib.sol";
322324
323325
#include_code portal_setup /docs/examples/solidity/aave_bridge/AavePortal.sol raw
324326
}

docs/docs-developers/docs/tutorials/js_tutorials/token_bridge.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ cd hardhat-aztec-example
3939
yarn add @aztec/aztec.js@#include_version_without_prefix @aztec/accounts@#include_version_without_prefix @aztec/stdlib@#include_version_without_prefix @aztec/wallets@#include_version_without_prefix @aztec/viem@2.38.2 tsx
4040
```
4141

42-
:::note Match the `@aztec/l1-contracts` version
43-
The starter repo pins its `@aztec/l1-contracts` dependency to an older release. In `package.json`, update the tag to match the network version used in this tutorial, then run `yarn install` again:
42+
:::note Use `@aztec/l1-artifacts` for the L1 interfaces
43+
The starter repo may still pin `@aztec/l1-contracts` as a git dependency; that repository is no longer updated. In `package.json`, replace it with the `@aztec/l1-artifacts` npm package at the version used in this tutorial, then run `yarn install` again:
4444

4545
```json
46-
"@aztec/l1-contracts": "git+https://github.com/AztecProtocol/l1-contracts.git##include_aztec_version"
46+
"@aztec/l1-artifacts": "#include_version_without_prefix"
4747
```
4848

49-
The L1 interfaces the portal imports later in this tutorial must match the contracts deployed by your running network.
49+
The package ships the L1 contract sources under `@aztec/l1-artifacts/l1-contracts/src`. If the project resolves `@aztec/*` Solidity imports through remappings or aliases, point them at `node_modules/@aztec/l1-artifacts/l1-contracts/src`. The interfaces the portal imports later in this tutorial must match the contracts deployed by your running network.
5050
:::
5151

5252
Now start the local network in another terminal:

docs/docs-developers/docs/tutorials/js_tutorials/wallet-extension/04-accounts.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,27 @@ An Aztec account has:
2424

2525
## Key Derivation
2626

27-
The wallet uses the standard derivation from `@aztec/stdlib/keys`:
27+
The wallet generates a random signing key as the account's root and derives the privacy secret from it:
2828

2929
```typescript
30-
import { deriveSigningKey } from '@aztec/stdlib/keys';
30+
import { GrumpkinScalar } from '@aztec/aztec.js/fields';
31+
import { deriveSecretKeyFromSigningKey } from '@aztec/accounts/utils';
3132

32-
// Generate a random secret
33-
const secret = Fr.random();
34-
35-
// Derive the signing key
36-
const signingKey = deriveSigningKey(secret);
33+
// The signing key is the account's root; the privacy secret is derived from it
34+
const signingKey = GrumpkinScalar.random();
35+
const secret = await deriveSecretKeyFromSigningKey(signingKey);
3736
```
3837

39-
The derivation uses SHA-512 with domain separators to derive different keys:
38+
The nullifier, viewing, and tagging keys are then derived from that secret with SHA-512 and domain separators, while the signing key is supplied to the account contract directly:
4039

4140
```typescript
4241
// From stdlib/src/keys/derivation.ts
43-
export function deriveSigningKey(secretKey: Fr): GrumpkinScalar {
44-
return sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
42+
export function deriveMasterIncomingViewingSecretKey(secretKey: Fr): GrumpkinScalar {
43+
return sha512ToGrumpkinScalar([secretKey, DomainSeparator.IVSK_M]);
4544
}
4645

4746
export function deriveMasterNullifierHidingSecretKey(secretKey: Fr): GrumpkinScalar {
48-
return sha512ToGrumpkinScalar([secretKey, GeneratorIndex.NHK_M]);
47+
return sha512ToGrumpkinScalar([secretKey, DomainSeparator.NHK_M]);
4948
}
5049
```
5150

docs/docs-developers/docs/tutorials/testing_governance_rollup_upgrade.md

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,40 +50,22 @@ Note the `registryAddress` from the output.
5050

5151
---
5252

53-
## Step 2: Clone and Set Up l1-contracts
53+
## Step 2: Download the l1-contracts bundle
5454

55-
Clone the l1-contracts repo and checkout the version matching your Aztec installation. Run `aztec --version` to find your version:
55+
The [`@aztec/l1-artifacts`](https://www.npmjs.com/package/@aztec/l1-artifacts) npm package bundles a self-contained Foundry project with the L1 contract sources, prebuilt artifacts, deploy scripts, and governance payload contracts. Download the version matching your Aztec installation (run `aztec --version` to find it):
5656

5757
```bash
58-
git clone https://github.com/AztecProtocol/l1-contracts.git
58+
npm pack @aztec/l1-artifacts@#release_version
59+
mkdir l1-contracts
60+
tar xzf aztec-l1-artifacts-#release_version.tgz --strip-components=2 -C l1-contracts package/l1-contracts
5961
cd l1-contracts
60-
git checkout #release_version
6162
```
6263

63-
Install dependencies and set up the build environment:
64+
No further setup is needed: the bundle includes the library dependencies and the generated verifier, and forge downloads the matching solc version automatically on first use.
6465

65-
```bash
66-
# Install forge dependencies
67-
mkdir -p lib
68-
cd lib
69-
git clone --depth 1 https://github.com/foundry-rs/forge-std forge-std
70-
git clone --depth 1 https://github.com/OpenZeppelin/openzeppelin-contracts openzeppelin-contracts
71-
cd ..
72-
73-
# Install solc (uses forge's built-in svm). The Aztec installer ships
74-
# Foundry as `aztec-forge`/`aztec-cast`/`aztec-anvil` -- substitute your
75-
# own `forge` install if you have one.
76-
aztec-forge build --use 0.8.30 src/core/libraries/ConstantsGen.sol
77-
cp ~/.svm/0.8.30/solc-0.8.30 ./solc-0.8.30
78-
79-
# Copy the HonkVerifier to the generated directory (required for build)
80-
mkdir -p generated
81-
cp src/HonkVerifier.sol generated/HonkVerifier.sol
82-
83-
# Remove zkpassport-dependent files (not needed for rollup deployment)
84-
rm -f src/mock/StakingAssetHandler.sol
85-
rm -rf src/mock/staking_asset_handler/
86-
```
66+
:::note
67+
The Aztec installer ships Foundry as `aztec-forge`, `aztec-cast`, and `aztec-anvil`. Substitute your own `forge` and `cast` installs in the commands below if you have them.
68+
:::
8769

8870
---
8971

@@ -119,7 +101,7 @@ export AZTEC_SLASHING_VETOER=0x0000000000000000000000000000000000000000
119101
export AZTEC_SLASHING_DISABLE_DURATION=0
120102
export AZTEC_MANA_TARGET=100000000
121103
export AZTEC_EXIT_DELAY_SECONDS=0
122-
export AZTEC_PROVING_COST_PER_MANA=0
104+
export AZTEC_PROVING_COST_PER_MANA=100
123105
export AZTEC_SLASH_AMOUNT_SMALL=0
124106
export AZTEC_SLASH_AMOUNT_MEDIUM=0
125107
export AZTEC_SLASH_AMOUNT_LARGE=0
@@ -147,6 +129,10 @@ export NEW_ROLLUP_ADDRESS=0x...
147129

148130
## Step 5: Deploy Governance Payload
149131

132+
:::tip
133+
The deploy script in Step 4 also deploys this payload and prints it as `payloadAddress` in its JSON output. You can export that address as `PAYLOAD_ADDRESS` and skip this step.
134+
:::
135+
150136
**Important:** Place flags before the contract path to avoid argument parsing issues.
151137

152138
```bash
@@ -156,7 +142,7 @@ aztec-forge create \
156142
--rpc-url $L1_RPC_URL \
157143
--private-key $PRIVATE_KEY \
158144
--broadcast \
159-
test/governance/scenario/RegisterNewRollupVersionPayload.sol:RegisterNewRollupVersionPayload \
145+
src/periphery/RegisterNewRollupVersionPayload.sol:RegisterNewRollupVersionPayload \
160146
--constructor-args $REGISTRY_ADDRESS $NEW_ROLLUP_ADDRESS
161147
```
162148

docs/examples/ts/aztecjs_connection/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ console.log(`Alice's fee juice balance: ${aliceBalance}`);
4545
// docs:end:check_fee_juice
4646

4747
// docs:start:create_account
48-
import { Fr } from "@aztec/aztec.js/fields";
48+
import { Fr, GrumpkinScalar } from "@aztec/aztec.js/fields";
4949

5050
const secret = Fr.random();
5151
const salt = Fr.random();
52-
const newAccount = await wallet.createSchnorrAccount(secret, salt);
52+
const signingKey = GrumpkinScalar.random();
53+
const newAccount = await wallet.createSchnorrAccount(secret, salt, signingKey);
5354
console.log("New account address:", newAccount.address.toString());
5455
// docs:end:create_account
5556

@@ -87,9 +88,11 @@ await deployMethod.send({
8788
// can coexist in one example; in your own code, pick whichever name fits.
8889
const feeJuiceSecret = Fr.random();
8990
const feeJuiceSalt = Fr.random();
91+
const feeJuiceSigningKey = GrumpkinScalar.random();
9092
const feeJuiceAccount = await wallet.createSchnorrAccount(
9193
feeJuiceSecret,
9294
feeJuiceSalt,
95+
feeJuiceSigningKey,
9396
);
9497
// docs:end:create_fee_juice_account
9598

docs/examples/ts/aztecjs_getting_started/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@ const nodeUrl = process.env.AZTEC_NODE_URL ?? "http://localhost:8080";
66
const wallet = await EmbeddedWallet.create(nodeUrl, { ephemeral: true });
77

88
const [alice, bob] = await getInitialTestAccountsData();
9-
await wallet.createSchnorrInitializerlessAccount(alice.secret, alice.salt);
10-
await wallet.createSchnorrInitializerlessAccount(bob.secret, bob.salt);
9+
await wallet.createSchnorrInitializerlessAccount(
10+
alice.secret,
11+
alice.salt,
12+
alice.signingKey,
13+
);
14+
await wallet.createSchnorrInitializerlessAccount(
15+
bob.secret,
16+
bob.salt,
17+
bob.signingKey,
18+
);
1119
// docs:end:setup
1220

1321
// docs:start:deploy

0 commit comments

Comments
 (0)