Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ Fee Payment Contracts (FPC) pay fees on your behalf, typically accepting a diffe
### Sponsored Fee Payment Contracts

:::note
The Sponsored FPC is **not** deployed on mainnet or testnet. It is only available on devnet and local network. To pay fees on mainnet, you must either [bridge Fee Juice from L1](#bridge-fee-juice-from-l1) or deploy your own fee-paying contract.
The Sponsored FPC is **not** deployed on mainnet. It is available on testnet and local network.
:::

The Sponsored FPC pays for fees unconditionally without requiring payment in return. It is available on the local network and devnet (deployed by Aztec Labs), but **not on mainnet or testnet**.
The Sponsored FPC pays for fees unconditionally without requiring payment in return. It is available on testnet and local network.

You can derive the Sponsored FPC address from its deployment parameters, register it with your wallet, and use it to pay for transactions:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags: [local_network, testnet]
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Get started on your local environment using a local network.
Get started on your local environment using a local network. If you'd rather deploy to a live network, read the [getting started on testnet guide](./getting_started_on_testnet.md).

The local network is a local development Aztec network running fully on your machine, and interacting with a development Ethereum node. You can develop and deploy on it just like on a testnet or mainnet (when the time comes). The local network makes it faster and easier to develop and test your Aztec applications.

Expand Down Expand Up @@ -252,4 +252,5 @@ Simulation result: 25n
Want to build something cool on Aztec?

- Check out the [Token Contract Tutorial](./docs/tutorials/contract_tutorials/token_contract.md) for a beginner tutorial, or jump into more advanced ones
- Ready for a live network? Try [deploying on testnet](./getting_started_on_testnet.md)
- Start on your own thing and check out the How To Guides to help you!
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
---
title: Getting Started on Testnet
sidebar_position: 1
tags: [testnet]
description: Deploy contracts and send transactions on the Aztec testnet using the CLI wallet and the Sponsored FPC for fee payment.
---

import { General } from '@site/src/components/Snippets/general_snippets';

This guide walks you through deploying your first contract on the Aztec testnet. You will install the CLI tools, create an account using the Sponsored FPC (so you don't need to bridge Fee Juice yourself), and deploy and interact with a contract.

## Testnet vs Local Network

| Feature | Local Network | Testnet |
|---------|-------------|---------|
| **Environment** | Local machine | Decentralized network on Sepolia |
| **Fees** | Free (test accounts prefunded) | Sponsored FPC available |
| **Block times** | Instant | ~36 seconds |
| **Proving** | Optional | Required |
| **Accounts** | Test accounts pre-deployed | Must create and deploy your own |

:::info
If you want to develop and iterate quickly, start with the [local network guide](./getting_started_on_local_network.md). The local network has instant blocks and no proving, making it faster for development.
:::

## Prerequisites

- <General.node_ver />

## Install the Aztec toolchain

Install the testnet version of the Aztec CLI:

```bash
VERSION=4.2.0-aztecnr-rc.2 bash -i <(curl -sL https://install.aztec.network/4.2.0-aztecnr-rc.2)
```

:::warning
Testnet is version-dependent. It is currently running version `4.2.0-aztecnr-rc.2`. Maintain version consistency when interacting with the testnet to avoid errors.
:::

This installs:

- **aztec** - Compiles and tests Aztec contracts, launches infrastructure, and provides utility commands
- **aztec-up** - Version manager for the Aztec toolchain (`aztec-up install`, `aztec-up use`, `aztec-up list`)
- **aztec-wallet** - CLI tool for interacting with the Aztec network

## Getting started on testnet

### Step 1: Set up your environment

Set the required environment variables:

```bash
export NODE_URL=https://rpc.testnet.aztec-labs.com
export SPONSORED_FPC_ADDRESS=0x2ae02a54fd254586fd628ff46b71071bd8db32b63dc5d083f844f2c208a3923c
```

### Step 2: Register the Sponsored FPC

The Sponsored FPC (Fee Payment Contract) pays transaction fees on your behalf, so you don't need to bridge Fee Juice from L1. Register it in your wallet:

```bash
aztec-wallet register-contract \
--node-url $NODE_URL \
--alias sponsoredfpc \
$SPONSORED_FPC_ADDRESS SponsoredFPC \
--salt 0
```

### Step 3: Create and deploy an account

Unlike the local network, testnet has no pre-deployed accounts. Create and deploy your own:

```bash
aztec-wallet create-account \
--node-url $NODE_URL \
--alias my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS
```

:::note
The first transaction will take longer as it downloads proving keys. If you see `Timeout awaiting isMined`, the transaction is still processing — this is normal on testnet.
:::

### Step 4: Deploy a contract

Deploy a token contract as an example:

```bash
aztec-wallet deploy \
--node-url $NODE_URL \
--from accounts:my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
--alias token \
TokenContract \
--args accounts:my-wallet Token TOK 18
```

This deploys the `TokenContract` with:
- `admin`: your wallet address
- `name`: Token
- `symbol`: TOK
- `decimals`: 18

You can check the transaction status on [Aztecscan](https://testnet.aztecscan.xyz).

### Step 5: Interact with your contract

Mint some tokens:

```bash
aztec-wallet send mint_to_public \
--node-url $NODE_URL \
--from accounts:my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
--contract-address token \
--args accounts:my-wallet 100
```

Check your balance:

```bash
aztec-wallet simulate balance_of_public \
--node-url $NODE_URL \
--from accounts:my-wallet \
--contract-address token \
--args accounts:my-wallet
```

This should print:

```
Simulation result: 100n
```

Move tokens to private state:

```bash
aztec-wallet send transfer_to_private \
--node-url $NODE_URL \
--from accounts:my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
--contract-address token \
--args accounts:my-wallet 25
```

Check your private balance:

```bash
aztec-wallet simulate balance_of_private \
--node-url $NODE_URL \
--from accounts:my-wallet \
--contract-address token \
--args accounts:my-wallet
```

This should print:

```
Simulation result: 25n
```

## Viewing transactions on the block explorer

You can view your transactions, contracts, and account on the testnet block explorers:

- [Aztecscan](https://testnet.aztecscan.xyz)
- [Aztec Explorer](https://aztecexplorer.xyz/?network=testnet)

Search by transaction hash, contract address, or account address to see details and status.

## Registering existing contracts

To interact with a contract deployed by someone else, you need to register it in your local PXE first:

```bash
aztec-wallet register-contract \
--node-url $NODE_URL \
--alias mycontract \
<CONTRACT_ADDRESS> <ArtifactName>
```

For example, to register a `TokenContract` deployed by someone else:

```bash
aztec-wallet register-contract \
--node-url $NODE_URL \
--alias external-token \
0x1234...abcd TokenContract
```

After registration, you can interact with it using `aztec-wallet send` and `aztec-wallet simulate` as shown above.

## Paying fees without the Sponsored FPC

The Sponsored FPC is convenient for getting started, but you can also pay fees directly by bridging Fee Juice from Ethereum Sepolia. See [Paying Fees](./docs/aztec-js/how_to_pay_fees.md#bridge-fee-juice-from-l1) for details on bridging and other fee payment methods.

## Testnet information

For complete testnet technical details including contract addresses and network configuration, see the [Networks page](/networks#testnet).

## Next steps

- Check out the [Tutorials](./docs/tutorials/contract_tutorials/counter_contract.md) for building more complex contracts
- Learn about [paying fees](./docs/aztec-js/how_to_pay_fees.md) with different methods
- Explore [Aztec Playground](https://play.aztec.network/) for an interactive development experience
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"type": "doc",
"id": "getting_started_on_local_network"
},
{
"type": "doc",
"id": "getting_started_on_testnet"
},
{
"type": "doc",
"id": "ai_tooling"
Expand Down
14 changes: 3 additions & 11 deletions docs/docs-developers/docs/aztec-js/how_to_pay_fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ This guide walks you through paying transaction fees on Aztec using various paym
| Method | Use Case | Privacy | Requirements |
| ------------------- | ----------------------------- | ------- | -------------------------- |
| Fee Juice (default) | Account already has Fee Juice | Public | Funded account |
#if(devnet)
| Sponsored FPC | Testing, free transactions | Public | None |
#else
| Sponsored FPC | Testing, free transactions | Public | None (devnet and local only) |
#endif
| Bridge + Claim | Bootstrap from L1 | Public | L1 ETH for gas |

## Mana and Fee Juice
Expand Down Expand Up @@ -85,17 +81,13 @@ Fee Payment Contracts (FPCs) pay Fee Juice on your behalf. FPCs must use Fee Jui

### Sponsored Fee Payment Contracts

#if(testnet)
:::note
The Sponsored FPC is not available on testnet or mainnet. It is only available on devnet and local network.
:::
#elif(mainnet)
#if(mainnet)
:::note
The Sponsored FPC is not available on mainnet. It is only available on devnet and local network.
The Sponsored FPC is not available on mainnet. It is available on testnet and local network.
:::
#endif

The Sponsored FPC pays fees unconditionally. It is only available on devnet and local network.
The Sponsored FPC pays fees unconditionally. It is available on testnet and local network.

You can derive the Sponsored FPC address from its deployment parameters, register it with your wallet, and use it to pay for transactions:

Expand Down
3 changes: 2 additions & 1 deletion docs/docs-developers/getting_started_on_local_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags: [local_network, testnet]
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Get started on your local environment using a local network.
Get started on your local environment using a local network. If you'd rather deploy to a live network, read the [getting started on testnet guide](./getting_started_on_testnet.md).

The local network is a local development Aztec network running fully on your machine, and interacting with a development Ethereum node. You can develop and deploy on it just like on a testnet or mainnet (when the time comes). The local network makes it faster and easier to develop and test your Aztec applications.

Expand Down Expand Up @@ -252,4 +252,5 @@ Simulation result: 25n
Want to build something cool on Aztec?

- Check out the [Token Contract Tutorial](./docs/tutorials/contract_tutorials/token_contract.md) for a beginner tutorial, or jump into more advanced ones
- Ready for a live network? Try [deploying on testnet](./getting_started_on_testnet.md)
- Start on your own thing and check out the How To Guides to help you!
Loading
Loading