Skip to content

Commit 8b748b9

Browse files
authored
feat(docs): apply FPC docs to developer versioned docs (#22541)
## Summary - Ports changes from #22496 (Nethermind FPC docs) and #22497 (private FPC guide) to the `v4.2.0-aztecnr-rc.2` developer versioned docs - Updates `how_to_pay_fees.md` with new payment methods table, deprecation notice, third-party FPC section (Nethermind example), and private fee payment section - Updates `fees.md` (foundational topics) with expanded FPC payment methods description, new "How FPCs work" section, and teardown phase clarification - Updates `how_to_create_account.md` anchor links to match renamed heading - Adds new `how_to_use_private_fee_juice.md` guide (DeFi Wonderland's PrivateFPC) ## Test plan - [ ] `yarn start` in `docs/` — verify versioned pages render correctly - [ ] Confirm internal links resolve (anchors to `#sponsored-fpc-devnet-and-local-only`, `#third-party-fpcs-on-testnet-and-mainnet`, `#how-fpcs-work`, and the new private FPC guide) - [ ] Verify external links to Nethermind and Wonderland repos are valid
2 parents 22149e0 + 03e50ff commit 8b748b9

10 files changed

Lines changed: 188 additions & 84 deletions

File tree

docs/developer_versioned_docs/version-v4.2.0/docs/aztec-js/how_to_pay_fees.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const { receipt: feeJuiceReceipt } = await token.methods
109109
.mint_to_public(aliceAddress, 1n)
110110
.send({
111111
from: aliceAddress,
112-
// no fee payment method needed Fee Juice is used automatically
112+
// no fee payment method needed; Fee Juice is used automatically
113113
});
114114
console.log("Transaction fee:", feeJuiceReceipt.transactionFee);
115115
```
@@ -172,34 +172,34 @@ const { receipt: tx } = await bananaCoin.methods
172172
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v4.2.0/yarn-project/end-to-end/src/e2e_fees/sponsored_payments.test.ts#L57-L68" target="_blank" rel="noopener noreferrer">Source code: yarn-project/end-to-end/src/e2e_fees/sponsored_payments.test.ts#L57-L68</a></sub></sup>
173173
174174

175-
### Private Fee Payment
175+
### Private fee payment
176176

177-
For transactions where the fee payment itself should be private, you can use a fully private FPC one that holds Fee Juice claimed from L1 as an internal private balance, works on every network, and never needs an onchain deployment. See [Pay Fees Privately](./how_to_use_private_fee_juice.md) for how this pattern works and a walkthrough using a community-built example.
177+
For transactions where the fee payment itself should be private, you can use a fully private FPC, one that holds Fee Juice claimed from L1 as an internal private balance, works on every network, and never needs an onchain deployment. See [Pay Fees Privately](./how_to_use_private_fee_juice.md) for how this pattern works and a walkthrough using a community-built example.
178178

179179
:::tip Shared salt for privacy
180-
When multiple apps derive the same private FPC address (using the same artifact and salt), every private fee payment joins a single, larger privacy set. See [Recommended salt](./how_to_use_private_fee_juice.md#recommended-salt-0) for details.
180+
When multiple apps derive the same private FPC address (using the same artifact and salt), every private fee payment joins a single, larger privacy set. See [recommended salt](./how_to_use_private_fee_juice.md#recommended-salt-0) for details.
181181
:::
182182

183183
### Third-party FPCs on testnet and mainnet
184184

185-
On networks where the Sponsored FPC is unavailable, third-party FPCs deployed by ecosystem teams let you pay fees in tokens other than Fee Juice. Each FPC provider typically offers an SDK or API that handles payment method construction on the client side — this may include quote fetching and authwit creation, though the exact flow depends on the FPC design. For background on how FPCs work at the protocol level, see [How FPCs work](../foundational-topics/fees.md#how-fpcs-work).
185+
On networks where the Sponsored FPC is unavailable, third-party FPCs deployed by ecosystem teams let you pay fees in tokens other than Fee Juice. Each FPC provider typically offers an SDK or API that handles payment method construction on the client side. This may include quote fetching and authwit creation, though the exact flow depends on the FPC design. For background on how FPCs work at the protocol level, see [how FPCs work](../foundational-topics/fees.md#how-fpcs-work).
186186

187187
#### Example: Nethermind Private Multi Asset FPC
188188

189-
To illustrate how a third-party FPC integration works, the following walkthrough uses Nethermind's [Private Multi Asset FPC](https://github.com/NethermindEth/aztec-fpc) as a reference. This is one implementation other FPCs may differ in design and API.
189+
To illustrate how a third-party FPC integration works, the following walkthrough uses Nethermind's [Private Multi Asset FPC](https://github.com/NethermindEth/aztec-fpc) as a reference. This is one implementation, other FPCs may differ in design and API.
190190

191191
This FPC is quote-based and operates privately:
192192

193-
- A single deployment accepts many tokens — the asset is selected per quote rather than hard-coded at deploy time.
193+
- A single deployment accepts many tokens. The asset is selected per quote rather than hard-coded at deploy time.
194194
- Fee payments are transferred as private notes, so fee activity is not visible onchain.
195195
- An operator-run attestation service signs per-user quotes binding the FPC address, accepted asset, amounts, expiry, and user.
196-
- A cold-start entrypoint allows a brand-new account to bridge tokens from L1, claim on L2, and pay the fee in a single transaction. Note that the cold-start path calls `Token::mint_to_private`, which enqueues a public call to update the token's total supply so the minted amount is visible onchain even though the user's identity and balances remain private.
196+
- A cold-start entrypoint allows a brand-new account to bridge tokens from L1, claim on L2, and pay the fee in a single transaction. Note that the cold-start path calls `Token::mint_to_private`, which enqueues a public call to update the token's total supply, so the minted amount is visible onchain even though the user's identity and balances remain private.
197197

198198
:::warning Third-party software
199-
This FPC is developed and maintained by Nethermind, not by Aztec Labs. The SDK (`@nethermindeth/aztec-fpc-sdk`) may not yet be published to npm check the [repository README](https://github.com/NethermindEth/aztec-fpc/blob/main/sdk/README.md) for current install instructions. Review the [protocol spec](https://github.com/NethermindEth/aztec-fpc/blob/main/docs/spec/protocol-spec.md) and evaluate independently before integrating.
199+
This FPC is developed and maintained by Nethermind, not by Aztec Labs. The SDK (`@nethermindeth/aztec-fpc-sdk`) may not yet be published to npm; check the [repository README](https://github.com/NethermindEth/aztec-fpc/blob/main/sdk/README.md) for current install instructions. Review the [protocol spec](https://github.com/NethermindEth/aztec-fpc/blob/main/docs/spec/protocol-spec.md) and evaluate independently before integrating.
200200
:::
201201

202-
The SDK wraps the quote-and-pay flow into a single call. The snippet below shows the general shape of the integration (illustrative verify against the current SDK API before using):
202+
The SDK wraps the quote-and-pay flow into a single call. The snippet below shows the general shape of the integration (illustrative; verify against the current SDK API before using):
203203

204204
```ts
205205
import { FpcClient } from "@nethermindeth/aztec-fpc-sdk";
@@ -282,7 +282,7 @@ import { FeeJuicePaymentMethodWithClaim } from "@aztec/aztec.js/fee";
282282
// Create a payment method that claims the bridged Fee Juice and uses it to pay
283283
const bridgePaymentMethod = new FeeJuicePaymentMethodWithClaim(feeJuiceAccount.address, claim);
284284

285-
// Use it to pay for any transaction here we deploy the account in one step
285+
// Use it to pay for any transaction; here we deploy the account in one step
286286
const deployMethodBridged = await feeJuiceAccount.getDeployMethod();
287287
await deployMethodBridged.send({
288288
from: NO_FROM,
@@ -338,7 +338,7 @@ Note that `gasLimits` and `teardownGasLimits` use `daGas`/`l2Gas` field names, w
338338
### Use automatic gas estimation
339339

340340
:::note
341-
When using `EmbeddedWallet`, gas estimation happens automatically on every `send()` you don't need to pass `estimateGas`. This option is useful for custom wallet implementations or when you want to estimate gas during a `simulate()` call.
341+
When using `EmbeddedWallet`, gas estimation happens automatically on every `send()`; you don't need to pass `estimateGas`. This option is useful for custom wallet implementations or when you want to estimate gas during a `simulate()` call.
342342
:::
343343

344344
```typescript title="auto_gas_estimation" showLineNumbers

0 commit comments

Comments
 (0)