Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

247 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FPC: Fee Payment Contracts for Aztec

License

Tip

Scoping this repo with an AI agent? Give it full context in one shot:

curl -sL https://raw.githubusercontent.com/NethermindEth/aztec-fpc/main/docs/public/llms.txt

This returns a structured project summary, source code map with line numbers, function index, error codes, and config reference. For the complete docs (~5k lines), replace llms.txt with llms-full.txt.

Users pay fees in the token they already hold. The operator covers the Fee Juice.

FPC is a smart contract on Aztec that pays transaction fees in Fee Juice on the user's behalf. Instead of acquiring Fee Juice themselves, users pay the FPC operator in any accepted token (USDC, ETH, app tokens) at a rate locked by a signed quote. One contract instance handles any number of tokens with no redeployment.

Read the docs  |  Testnet addresses  |  SDK reference

How it works

Component Role
FPC contract Verifies operator-signed Schnorr quotes, transfers tokens from user to operator, pays Fee Juice to the protocol
Attestation service Signs per-user fee quotes, serves wallet discovery at /.well-known/fpc.json
Top-up service Watches FPC balance on L2, bridges Fee Juice from L1 when it drops below threshold
SDK createPaymentMethod() for existing users, executeColdStart() for L1 onboarding

Usage

import { FpcClient } from "@nethermindeth/aztec-fpc-sdk";

const fpcClient = new FpcClient({ fpcAddress, operator, node, attestationBaseUrl });

// User already has L2 tokens
const { fee } = await fpcClient.createPaymentMethod({
  wallet, user: userAddress, tokenAddress, estimatedGas,
});
await contract.methods.transfer(recipient, amount).send({ fee });

// User just bridged from L1, no account, no Fee Juice
const result = await fpcClient.executeColdStart({
  wallet, userAddress, tokenAddress, bridgeAddress, bridgeClaim,
});

Two methods. That's the entire SDK surface.

Quick start

Run the full stack locally in one command:

git clone --recurse-submodules https://github.com/NethermindEth/aztec-fpc.git
cd aztec-fpc && bun install
docker buildx bake
docker compose --profile full up wait --wait

Verify:

curl http://localhost:3000/health          # attestation
curl http://localhost:3001/ready           # topup
curl http://localhost:3000/accepted-assets # registered tokens

For testnet deployment, manual bring-up, or SDK-only integration: Quick Start guide.

Documentation

docs/README.md is the entry point. It routes you by role:

Start here

You are... Go to
dApp developer SDK Getting Started
Wallet team Integrate Wallet
Operator Run an Operator
Auditor Security Model

Full docs

Section Pages
Core Architecture · Quotes · Security
SDK Getting Started
Contracts All contracts
Services Attestation + Top-up · Config
How-to Operator · Wallet · Assets · Cold-start
Ops Deploy · Docker · Test
Reference Metrics · Testnet · Discovery
Specs Protocol · E2E · ADR-0001

Repository layout

aztec-fpc/
├── contracts/
│   ├── fpc/                   ← FPCMultiAsset (Noir)
│   ├── faucet/                ← Test token dispenser
│   ├── token_bridge/          ← L1-L2 bridge
│   └── noop/                  ← Profiling baseline
├── services/
│   ├── attestation/           ← Quote-signing REST service
│   └── topup/                 ← Fee Juice bridge daemon
├── sdk/                       ← TypeScript SDK
├── scripts/
│   ├── contract/              ← Deploy + smoke wrappers
│   ├── services/              ← Service bootstrap scripts
│   └── tests/                 ← Integration and E2E suites
├── vendor/
│   └── aztec-standards/       ← Git submodule (token contract)
└── docs/                      ← Documentation (start with README.md)

Development

Note

Prerequisites: Bun 1.3.11, Aztec CLI 4.2.0-aztecnr-rc.2

aztec compile --workspace --force   # compile all Noir contracts
bun run test:contracts              # Noir contract tests
bun run test:ts                     # service + SDK unit tests
bun run ci                          # full pipeline: format, lint, typecheck, build, test

Docker integration tests (same flow as CI):

docker buildx bake
docker compose --profile full up wait --wait
docker compose --profile full down -v --remove-orphans

Security

  • Operator key: single Schnorr keypair signs all quotes and receives all revenue. Use KMS/HSM in production. Compromise requires contract redeployment (no on-chain key rotation).
  • L1 key: used only by the top-up service for bridging. Keep minimal ETH balance.
  • Production mode: runtime_profile=production rejects plaintext secrets and requires auth on quote endpoints.

Full threat matrix and production checklist: Security Model.

Support

Questions, bugs, or feedback:

License

Apache-2.0


Built by Nethermind

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages