Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/docs/developers/guides/getting_started_on_testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Aztec uses account abstraction, which means:

```bash
export NODE_URL=https://aztec-alpha-testnet-fullnode.zkv.xyz
export SPONSORED_FPC_ADDRESS=0x0b27e30667202907fc700d50e9bc816be42f8141fae8b9f2281873dbdb9fc2e5
export SPONSORED_FPC_ADDRESS=0x1260a43ecf03e985727affbbe3e483e60b836ea821b6305bea1c53398b986047
```

1. Create a new account:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ To connect to the testnet, pass the `AZTEC_NODE_URL` to the wallet with the `--n

```bash
export AZTEC_NODE_URL=<testnet-ip-address>
export SPONSORED_FPC_ADDRESS=0x0b27e30667202907fc700d50e9bc816be42f8141fae8b9f2281873dbdb9fc2e5
export SPONSORED_FPC_ADDRESS=0x1260a43ecf03e985727affbbe3e483e60b836ea821b6305bea1c53398b986047
# Register a new account
aztec-wallet create-account --register-only -a main -n $AZTEC_NODE_URL
aztec-wallet register-contract $SPONSORED_FPC_ADDRESS SponsoredFPC --from main -n $AZTEC_NODE_URL --salt 0 -a sponsoredfpc
Expand Down
14 changes: 9 additions & 5 deletions docs/docs/developers/tutorials/codealong/first_fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ Start the sandbox (L1, L2, but not the PXE) via: `NO_PXE=true aztec start --sand

:::note Sandbox + aztec.js?
If you are specifically wanting to test aztec.js with the sandbox, then you will need to use the default command which includes the PXE:

- `aztec start --sandbox`
:::
:::

### Specifying the network URL for your PXE

Expand Down Expand Up @@ -181,7 +182,7 @@ To bootstrap first use, a sponsored fee paying contract (the canonical sponsored
In the case of the canonical sponsored FPC, the only criteria is an upper bound on how much it sponsors an account's transactions. This will be enough to at least deploy an account.

The PXE can be queried for the canonical sponsored FPC address, and then specified as the payment method.
For testnet this is `0x0b27e30667202907fc700d50e9bc816be42f8141fae8b9f2281873dbdb9fc2e5`, which can be verified with the command: `aztec get-canonical-sponsored-fpc-address`
For testnet this is `0x1260a43ecf03e985727affbbe3e483e60b836ea821b6305bea1c53398b986047`, which can be verified with the command: `aztec get-canonical-sponsored-fpc-address`

Via the CLI:

Expand Down Expand Up @@ -278,7 +279,9 @@ import { FeeJuicePaymentMethod } from "@aztec/aztec.js";
// Below we'll deploy the new account (eg schnorrAccount2) with fee juice from test wallet

const useFeeJuice = new FeeJuicePaymentMethod(testWallets[0].getAddress());
await schnorrAccount2.deploy({ fee: { deployWallet: testWallets[0], paymentMethod: useFeeJuice } }).wait();
await schnorrAccount2
.deploy({ fee: { deployWallet: testWallets[0], paymentMethod: useFeeJuice } })
.wait();
```

:::note Payment: Fee Juice
Expand Down Expand Up @@ -345,11 +348,12 @@ import { L1FeeJuicePortalManager } from "@aztec/aztec.js/ethereum";
// Below we'll deploy the new account (eg schnorrAccount3) via a claim to bridged fee juice

const { l1ChainId } = await pxe.getNodeInfo(); // foundry chainid 31337 for sandbox use
const l1RpcUrls = ['http://localhost:8545]'] // for sandbox use, or see https://chainlist.org/chain/11155111> eg ['https://rpc.sepolia.ethpandaops.io']
const l1RpcUrls = ["http://localhost:8545]"]; // for sandbox use, or see https://chainlist.org/chain/11155111> eg ['https://rpc.sepolia.ethpandaops.io']
const chain = createEthereumChain(l1RpcUrls, l1ChainId);

// eg l1 private key, or for sandbox...
const mnemonicOrPrivateKey = 'test test test test test test test test test test test junk';
const mnemonicOrPrivateKey =
"test test test test test test test test test test test junk";

const { publicClient, walletClient } = createL1Clients(
chain.rpcUrls,
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/try_testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ id: try_testnet

## Chain Information

**Version**: `alpha-testnet`
**Version**: `alpha-testnet`, `0.87.2`

**Node URL**: `https://aztec-alpha-testnet-fullnode.zkv.xyz`

**L1 Chain ID**: `11155111`

**Rollup Version**: `150103439`
**Rollup Version**: `4189337207`

**Node ENR**: `enr:-MK4QGMeY-XZOb8V-1f6rDbm_E3SGk8JqvlveqFtQ80WLUbnOapCMv3fh4UAh1SeYw5KfcqPFfk_F99cnO8jDIfS_AwGhWF6dGVjsDAwLTExMTU1MTExLThkMWNjNzAyLTE1MDEwMzQzOS0wYjZiNWY2Yy0wZWE1MWRhNIJpZIJ2NIJpcIQia0KqiXNlY3AyNTZrMaEDmQTk2B2UCjSyvQfvs1SSSYE3namSE7IzmWU_vFrHP5KDdGNwgp3Qg3VkcIKd0A`

Expand All @@ -40,13 +40,13 @@ id: try_testnet

| Contract Name | Address |
| --------------------- | -------------------------------------------- |
| Rollup | `0x8d1cc702453fa889f137dbd5734cdb7ee96b6ba0` |
| Rollup | `0xee6d4e937f0493fb461f28a75cf591f1dba8704e` |
| Registry | `0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e` |
| L1 → L2 Inbox | `0x812bdd3aa323fe28db926b55d7f0273b3efadf06` |
| L2 → L1 Outbox | `0x4345f34cc1a4be57156f1d0c669f9f5cbfb15d0a` |
| L1 → L2 Inbox | `0xf8e143bf3333ecdeaeaa29744bfe226b94f124a8` |
| L2 → L1 Outbox | `0x572725ffb3af63745098576152d8756c333d4525` |
| Fee Juice | `0x487ff89a8bdaefea2ad10d3e23727ccda8f845b9` |
| Staking Asset | `0x5c30c66847866a184ccb5197cbe31fce7a92eb26` |
| Fee Juice Portal | `0xcddb813623c83369250aec0a65cd02ab3e577865` |
| Fee Juice Portal | `0xa07a3be3f0b17594b394effb4ce579f54e76aba2` |
| Coin Issuer | `0xf8d7d601759cbcfb78044ba7ca9b0c0d6301a54f` |
| Reward Distributor | `0x169aa723de66698d6cfa97ae576ab2546e8465a2` |
| Governance Proposer | `0xf4bf5df1c3b2dd67a0525fc600e98ca51143a67d` |
Expand All @@ -63,4 +63,4 @@ id: try_testnet
| Fee Juice | `0x0000000000000000000000000000000000000000000000000000000000000005` |
| Instance Deployer | `0x0000000000000000000000000000000000000000000000000000000000000002` |
| MultiCall | `0x0000000000000000000000000000000000000000000000000000000000000004` |
| Sponsored FPC | `0x0b27e30667202907fc700d50e9bc816be42f8141fae8b9f2281873dbdb9fc2e5` |
| Sponsored FPC | `0x1260a43ecf03e985727affbbe3e483e60b836ea821b6305bea1c53398b986047` |
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ However if one wants to implement authorization logic containing signatures (e.g

This is a snippet of our Schnorr Account contract implementation, which uses Schnorr signatures for authentication:

```rust title="is_valid_impl" showLineNumbers
```rust title="is_valid_impl" showLineNumbers
// Load public key from storage
let storage = Storage::init(context);
let public_key = storage.signing_public_key.get_note();
Expand All @@ -102,8 +102,8 @@ let pub_key = std::embedded_curve_ops::EmbeddedCurvePoint {
// Verify signature of the payload bytes
schnorr::verify_signature(pub_key, signature, outer_hash.to_be_bytes::<32>())
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.87.2/noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L65-L86" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L65-L86</a></sub></sup>

> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/alpha-testnet/noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L65-L86" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L65-L86</a></sub></sup>

### Storing signing keys

Expand All @@ -117,11 +117,11 @@ Storing the signing public key in a private note makes it accessible from the `e

Using an immutable private note removes the need to nullify the note on every read. This generates no nullifiers or new commitments per transaction. However, it does not allow the user to rotate their key.

```rust title="public_key" showLineNumbers
```rust title="public_key" showLineNumbers
signing_public_key: PrivateImmutable<PublicKeyNote, Context>,
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.87.2/noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L28-L30" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L28-L30</a></sub></sup>

> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/alpha-testnet/noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L28-L30" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L28-L30</a></sub></sup>

:::note
When it comes to storing the signing key in a private note, there are several details that rely on the wallets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ We also need to create a point for the owner of the FPC (whom we call Bob) to re
So in the contract we compute $\text{rand}_b := h(\text{rand}_a, \text{msg sender})$.

:::warning
We need to use different randomness for Bob's note here to avoid potential privacy leak (see [description](https://github.com/AztecProtocol/aztec-packages/blob/alpha-testnet/noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr#L491) of `setup_refund` function)
We need to use different randomness for Bob's note here to avoid potential privacy leak (see [description](https://github.com/AztecProtocol/aztec-packages/blob/v0.87.2/noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr#L491) of `setup_refund` function)
:::

$$
Expand Down Expand Up @@ -144,7 +144,7 @@ We can see the complete implementation of creating and completing partial notes

#### `fee_entrypoint_private`

```rust title="fee_entrypoint_private" showLineNumbers
```rust title="fee_entrypoint_private" showLineNumbers
#[private]
fn fee_entrypoint_private(max_fee: u128, nonce: Field) {
let accepted_asset = storage.config.read().accepted_asset;
Expand All @@ -170,15 +170,15 @@ fn fee_entrypoint_private(max_fee: u128, nonce: Field) {
context.set_as_fee_payer();
}
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.87.2/noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L78-L103" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L78-L103</a></sub></sup>

> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/alpha-testnet/noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L78-L103" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L78-L103</a></sub></sup>

The `fee_entrypoint_private` function sets the `complete_refund` function to be called at the end of the public function execution (`set_public_teardown_function`).
This ensures that the refund partial note will be completed for the user.

#### `complete_refund`

```rust title="complete_refund" showLineNumbers
```rust title="complete_refund" showLineNumbers
#[public]
#[internal]
fn _complete_refund(
Expand All @@ -201,8 +201,8 @@ fn _complete_refund(
);
}
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v0.87.2/noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L107-L129" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L107-L129</a></sub></sup>

> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/alpha-testnet/noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L107-L129" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L107-L129</a></sub></sup>

## Note discovery

Expand Down
Loading