Skip to content

Commit 77c609d

Browse files
authored
Merge pull request #610 from AztecProtocol/cb/merge-public-next-raw
chore: merge public-next into next (raw, conflict markers)
2 parents 2a7b181 + eacd149 commit 77c609d

1,558 files changed

Lines changed: 21499 additions & 6853 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.

docs/developer_version_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"mainnet": "v4.3.1",
3-
"testnet": "v5.0.0-rc.2"
3+
"testnet": "v5.0.0"
44
}

docs/developer_versioned_docs/version-v5.0.0-rc.2/docs/aztec-nr/framework-description/calling_contracts.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

docs/developer_versioned_docs/version-v5.0.0-rc.2/ai_tooling.md renamed to docs/developer_versioned_docs/version-v5.0.0/ai_tooling.md

File renamed without changes.

docs/developer_versioned_docs/version-v5.0.0-rc.2/docs/aztec-js/_category_.json renamed to docs/developer_versioned_docs/version-v5.0.0/docs/aztec-js/_category_.json

File renamed without changes.

docs/developer_versioned_docs/version-v5.0.0-rc.2/docs/aztec-js/aztec_js_reference.md renamed to docs/developer_versioned_docs/version-v5.0.0/docs/aztec-js/aztec_js_reference.md

File renamed without changes.

docs/developer_versioned_docs/version-v5.0.0-rc.2/docs/aztec-js/how_to_connect_to_local_network.md renamed to docs/developer_versioned_docs/version-v5.0.0/docs/aztec-js/how_to_connect_to_local_network.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This guide shows you how to connect your application to the Aztec local network
1616
## Install dependencies
1717

1818
```bash
19-
yarn add @aztec/aztec.js@5.0.0-rc.2 @aztec/wallets@5.0.0-rc.2
19+
yarn add @aztec/aztec.js@5.0.0 @aztec/wallets@5.0.0
2020
```
2121

2222
## Connect to the network
@@ -37,7 +37,7 @@ await waitForNode(node);
3737
// Create an EmbeddedWallet connected to the node
3838
const wallet = await EmbeddedWallet.create(node, { ephemeral: true });
3939
```
40-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L1-L14" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L1-L14</a></sub></sup>
40+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L1-L14" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L1-L14</a></sub></sup>
4141
4242

4343
:::note About EmbeddedWallet
@@ -57,7 +57,7 @@ const nodeInfo = await node.getNodeInfo();
5757
console.log("Connected to local network version:", nodeInfo.nodeVersion);
5858
console.log("Chain ID:", nodeInfo.l1ChainId);
5959
```
60-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L16-L20" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L16-L20</a></sub></sup>
60+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L16-L20" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L16-L20</a></sub></sup>
6161
6262

6363
### Load pre-funded accounts
@@ -81,7 +81,7 @@ const [aliceAddress, bobAddress] = await Promise.all(
8181
console.log(`Alice's address: ${aliceAddress.toString()}`);
8282
console.log(`Bob's address: ${bobAddress.toString()}`);
8383
```
84-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L22-L38" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L22-L38</a></sub></sup>
84+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L22-L38" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L22-L38</a></sub></sup>
8585
8686

8787
These accounts are pre-funded with fee juice (the native gas token) at genesis, so you can immediately send transactions without needing to bridge funds from L1.
@@ -96,7 +96,7 @@ import { getFeeJuiceBalance } from "@aztec/aztec.js/utils";
9696
const aliceBalance = await getFeeJuiceBalance(aliceAddress, node);
9797
console.log(`Alice's fee juice balance: ${aliceBalance}`);
9898
```
99-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L40-L45" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L40-L45</a></sub></sup>
99+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L40-L45" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L40-L45</a></sub></sup>
100100
101101

102102
## Next steps

docs/developer_versioned_docs/version-v5.0.0-rc.2/docs/aztec-js/how_to_create_account.md renamed to docs/developer_versioned_docs/version-v5.0.0/docs/aztec-js/how_to_create_account.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,54 @@ This guide shows you how to create and deploy a new account on Aztec.
1515
## Install dependencies
1616

1717
```bash
18-
yarn add @aztec/aztec.js@5.0.0-rc.2 @aztec/wallets@5.0.0-rc.2 @aztec/noir-contracts.js@5.0.0-rc.2
18+
yarn add @aztec/aztec.js@5.0.0 @aztec/wallets@5.0.0 @aztec/noir-contracts.js@5.0.0
1919
```
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
```typescript title="create_account" showLineNumbers
26-
import { Fr } from "@aztec/aztec.js/fields";
26+
import { Fr, GrumpkinScalar } from "@aztec/aztec.js/fields";
2727

2828
const secret = Fr.random();
2929
const salt = Fr.random();
30-
const newAccount = await wallet.createSchnorrAccount(secret, salt);
30+
const signingKey = GrumpkinScalar.random();
31+
const newAccount = await wallet.createSchnorrAccount(secret, salt, signingKey);
3132
console.log("New account address:", newAccount.address.toString());
3233
```
33-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L47-L54" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L47-L54</a></sub></sup>
34+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L47-L55" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L47-L55</a></sub></sup>
3435
3536

36-
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.
37+
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.
3738

38-
:::warning Store your secret and salt
39-
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.
39+
:::warning Store your secret, salt, and signing key
40+
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.
4041
:::
4142

43+
## Create an initializerless account
44+
45+
Alternatively, create an [initializerless account](../foundational-topics/accounts/deployment.md), which needs no deployment transaction at all:
46+
47+
```typescript
48+
const secret = Fr.random();
49+
const salt = Fr.random();
50+
const account = await wallet.createSchnorrInitializerlessAccount(secret, salt);
51+
console.log("Account address:", account.address.toString());
52+
```
53+
54+
An initializerless account commits its signing public key into the address itself (through the instance's `immutables_hash`), so there is no onchain state to initialize. Creating the account registers it locally in the PXE, and it is ready to use immediately: skip the deployment section below entirely. Fees are only needed for the account's first real transaction, paid with any of the usual [payment methods](./how_to_pay_fees.md).
55+
56+
Two things to keep in mind:
57+
58+
- The signing key cannot be changed later. A new key means a new address.
59+
- Calling `getDeployMethod()` on an initializerless account throws, since there is nothing to deploy.
60+
61+
See [account deployment](../foundational-topics/accounts/deployment.md) for how this works and how to choose between the two account types.
62+
4263
## Deploy the account
4364

44-
New accounts must be deployed before they can send transactions. Deployment requires paying fees.
65+
Accounts created with `createSchnorrAccount` must be deployed before they can send transactions (initializerless accounts skip this step). Deployment requires paying fees.
4566

4667
### Using the Sponsored FPC
4768

@@ -74,7 +95,7 @@ await deployMethod.send({
7495
fee: { paymentMethod: sponsoredPaymentMethod },
7596
});
7697
```
77-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L56-L82" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L56-L82</a></sub></sup>
98+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L57-L83" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L57-L83</a></sub></sup>
7899
79100

80101
:::info
@@ -93,12 +114,14 @@ Create a new Schnorr account for this path:
93114
// can coexist in one example; in your own code, pick whichever name fits.
94115
const feeJuiceSecret = Fr.random();
95116
const feeJuiceSalt = Fr.random();
117+
const feeJuiceSigningKey = GrumpkinScalar.random();
96118
const feeJuiceAccount = await wallet.createSchnorrAccount(
97119
feeJuiceSecret,
98120
feeJuiceSalt,
121+
feeJuiceSigningKey,
99122
);
100123
```
101-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L84-L94" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L84-L94</a></sub></sup>
124+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L85-L97" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L85-L97</a></sub></sup>
102125
103126

104127
Claim the bridged Fee Juice and deploy in one step:
@@ -120,7 +143,7 @@ await deployMethodBridged.send({
120143
fee: { paymentMethod: bridgePaymentMethod },
121144
});
122145
```
123-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L163-L179" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L163-L179</a></sub></sup>
146+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L166-L182" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L166-L182</a></sub></sup>
124147
125148

126149
If the account already has Fee Juice on L2 (for example, from a faucet or a previously claimed bridge), no special payment method is needed — just call `send({ from: NO_FROM })` and Fee Juice is used automatically.
@@ -137,12 +160,12 @@ Confirm the account was deployed successfully. Substitute the account variable f
137160
const metadata = await wallet.getContractMetadata(newAccount.address);
138161
console.log("Account deployed:", metadata.initializationStatus);
139162
```
140-
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0-rc.2/docs/examples/ts/aztecjs_connection/index.ts#L181-L186" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L181-L186</a></sub></sup>
163+
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v5.0.0/docs/examples/ts/aztecjs_connection/index.ts#L184-L189" target="_blank" rel="noopener noreferrer">Source code: docs/examples/ts/aztecjs_connection/index.ts#L184-L189</a></sub></sup>
141164
142165

143166
## Next steps
144167

145168
- [Deploy contracts](./how_to_deploy_contract.md) with your new account
146169
- [Send transactions](./how_to_send_transaction.md) from an account
147-
- Learn about [account abstraction](../foundational-topics/accounts/index.md)
170+
- Learn about [account abstraction](../foundational-topics/accounts/index.md) and [account deployment](../foundational-topics/accounts/deployment.md)
148171
- Implement [authentication witnesses](./how_to_use_authwit.md)

0 commit comments

Comments
 (0)