@aztec-foundation/aztec-standards

中文文档
6.0.0发布于 2026/10/23MITES Module零依赖构建来源已验证近 30 天下载 3025

npm version

原始使用文档
文档目录13 节
  1. ⚠️ Security Status: Unaudited
  2. Development
  3. Table of Contents
  4. Standards & Naming (AIP vs ARC)
  5. Dripper Contract
  6. Token Contract
  7. MultiToken Contract
  8. Vault Contract
  9. Vault Deployer Contract
  10. NFT Contract
  11. Escrow Standard Contract & Library
  12. Scope & Maintenance
  13. License

Aztec Standards

npm version

Aztec Standards is a comprehensive collection of reusable, standardized contracts for the Aztec Network. It provides a robust foundation of token primitives and utilities that support both private and public operations, empowering developers to build innovative privacy-preserving applications with ease.

The npm package ships compiled contract artifacts and TypeScript wrappers but declares no dependencies: the wrappers import @aztec-labs/aztec.js (Aztec 6 renamed the SDK scope from @aztec/*), so install it at the version in the package's config.aztecVersion.

⚠️ Security Status: Unaudited

[!WARNING] This code has not been audited. Do not use it in production or to secure assets of value.

The contracts in this repository are experimental, unaudited software under active development. They have not undergone any external security review, audit, or formal verification, and they may contain bugs, security vulnerabilities, or economic flaws that could result in the irrecoverable loss of funds.

The software is provided on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied (see LICENSE). Anyone deploying or interacting with these contracts does so entirely at their own risk, and is responsible for obtaining their own independent security review. No representation is made that the code is free of defects, and nothing here should be relied upon as security, legal, or financial advice.

This notice will be updated if and when an audit is completed.

Development

Prerequisite: Start an Aztec local network in a separate terminal:

aztec start --local-network

Tests: yarn test runs Noir and JS tests. JS tests expect the network to be running at http://localhost:8080 (or NODE_URL).

Benchmarks: yarn bench connects to the same running network.

Set NODE_URL to override the default (e.g. http://localhost:9000).

Table of Contents

Standards & Naming (AIP vs ARC)

Two proposal-numbering tracks appear in this repository, and they are not interchangeable:

  • AIP-x — Aztec Improvement Proposals published as RFCs on the Aztec forum. This repository implements AIP-20 (Token) and AIP-4626 (Vault). Both are drafts under discussion, not ratified standards.
  • ARC-x — Aztec Request for Comments, a separate track. The Token and MultiToken contracts implement ARC-403, an optional authorization-hook extension (compliance checks on transfers via an external authorization contract). The ARC-403 spec is still under active discussion; the implementation here tracks the draft. The canonical hook interface lives in src/arc403_interface.

[!CAUTION] The Arc403Authorizer and Arc403MultiTokenAuthorizer artifacts shipped with this package are interface stubs with empty bodies. They exist to define the ABI. Never deploy them or wire them as a token's auth_contract — an empty hook approves every operation. Deploy your own implementation of the interface instead.

There is no "AIP-403" — if you have seen that name, it refers to ARC-403.

Dripper Contract

The Dripper contract provides a convenient faucet mechanism for minting tokens into private or public balances. Anyone can easily invoke the functions to request tokens for testing or development purposes.

📖 View detailed Dripper documentation

Token Contract

The Token contract implements an ERC-20-like token with Aztec-specific privacy extensions. It supports transfers and interactions explicitly through private balances and public balances, offering full coverage of Aztec's confidentiality features.

We published the AIP-20 Aztec Token Standard to the forum. Feel free to review and discuss the specification there. The token optionally implements the ARC-403 authorization hook (draft).

📖 View detailed Token documentation

MultiToken Contract

The MultiToken contract implements an ERC-1155-like multi-token (many token ids under one contract) with Aztec-specific privacy extensions: per-id private and public balances, partial-note commitments for public→private transfers, and the ARC-403 authorization hook (draft).

📖 View detailed MultiToken documentation

Vault Contract

The Vault contract is a standalone yield-bearing vault that holds an underlying AIP-20 asset and issues AIP-20 share tokens to depositors. The vault and shares token are separate contracts — the vault manages deposit/withdraw/redeem logic while delegating share token operations (mint, burn, transfer) to an external AIP-20 Token contract configured with the vault as its minter.

We published the AIP-4626: Tokenized Vault Standard to the forum. Feel free to review and discuss the specification there.

[!WARNING] The Vault is not production-ready, even by this repository's unaudited standards. It is exposed to reentrancy when the underlying asset token has an ARC-403 authorization hook configured (its ordering-based protection does not hold, because the hook runs during a transfer, before balances move), its conversions stop working near a u128 capacity ceiling that a large vault_offset brings within reach, and it has known privacy limitations. No fix is currently scheduled — see its README before wrapping any hooked token or choosing an offset.

📖 View detailed Vault documentation

Vault Deployer Contract

The VaultDeployer contract deploys and links a Vault and its shares Token in a single transaction. It exists as a workaround until public contract-instance registration lands upstream; without it, a vault and its shares token cannot be deployed and wired together atomically.

📖 View detailed Vault Deployer documentation

NFT Contract

The NFT contract implements an ERC-721-like non-fungible token with Aztec-specific privacy extensions. It supports transfers and interactions through both private and public ownership, offering full coverage of Aztec's confidentiality features for unique digital assets.

📖 View detailed NFT documentation

Escrow Standard Contract & Library

The Escrow Standard contains two elements:

  • Escrow Contract: a minimal private contract designed to have keys with which authorized callers can spend private balances of AIP-20 tokens and of the NFT contract in this repository.
  • Logic Library: a set of contract library methods that standardizes and facilitates the management of Escrow contracts from another contract, a.k.a. the Logic contract.

📖 View detailed Escrow documentation

For examples of Logic contract implementations, such as a linear vesting contract or a clawback escrow contract, see the archived aztec-escrow-extensions repository, last built against Aztec 5.0.0-rc.1.

Scope & Maintenance

The contracts above are the complete, intended scope of this repository. The Aztec Foundation maintains them (dependency bumps, bug fixes, spec alignment), but no new standards are planned unless there is clear ecosystem demand. If you need a standard that isn't here — or want one of the draft specs (AIP-20, AIP-4626, ARC-403) pushed toward finalization — say so on the Aztec forum or open a GitHub issue on this repository. Demand is what gets things built.

License

Released under the MIT License. Wonderland originally developed the project and assigned its copyright to the Aztec Foundation in 2026.

版本与发布记录

@aztec-foundation/aztec-standards 共发布 11 个版本,首次发布于 2026/07/16;过去 12 个月发布了 11 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.0.0latest2026/10/2316 天前
6.0.0-rc.7rc2026/10/2216 天前
6.0.0-rc.42026/10/2216 天前
6.0.0-rc.32026/10/1425 天前
6.0.0-rc.12026/09/301 个月前
5.2.02026/08/262 个月前

关于 @aztec-foundation/aztec-standards 的常见问题

如何安装 @aztec-foundation/aztec-standards?

在项目目录运行 npm install @aztec-foundation/aztec-standards,或使用 pnpm add / yarn add / bun add。

@aztec-foundation/aztec-standards 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aztec-foundation__aztec-standards 是否存在。

@aztec-foundation/aztec-standards 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aztec-foundation/aztec-standards 可以商用吗?

@aztec-foundation/aztec-standards 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aztec-foundation/aztec-standards 的下载量有多少?

根据 npm 官方下载统计,@aztec-foundation/aztec-standards 在 2026/10/08 – 2026/11/06 这 30 天内被下载 3,025 次,日均约 101 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aztec-foundation/aztec-standards 还在维护吗?

最新版本 6.0.0 发布于 2026/10/23(16 天前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/07/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。