Skip to content

feat(standard-contracts): prototype C++-driven address derivation in bb#23350

Draft
dbanks12 wants to merge 1 commit into
dbanks12/autogen-canonical-interfacesfrom
dbanks12/cpp-address-derivation
Draft

feat(standard-contracts): prototype C++-driven address derivation in bb#23350
dbanks12 wants to merge 1 commit into
dbanks12/autogen-canonical-interfacesfrom
dbanks12/cpp-address-derivation

Conversation

@dbanks12
Copy link
Copy Markdown
Contributor

Please read contributing guidelines and remove this line.

For audit-related pull requests, please use the audit PR template.

Adds a new `bb derive_standard_contract_addresses` subcommand that reads
freshly-built Noir artifacts and stamps the standard-contract addresses
into `standard_addresses.nr` (in both the aztec-nr/aztec crate and the
aztec_sublib twin) before the rest of noir-contracts compiles against
them. This breaks the build-order chicken-and-egg in the current TS-based
generator: the TS generator depends on the yarn-project build, but the
addresses need to be baked in before noir-contracts finishes.

For auth_registry and public_checks the derived address is byte-identical
to the TS-derived one (verified against the existing pinned values).

Known prototype limitations:
- `artifact_hash` and `private_functions_root` are READ from a sidecar
  manifest (`standard_contract_class_id_preimages.json`) instead of being
  derived from the artifact in C++. Porting their TS derivation
  (sha256-reduced-to-Fr merkle over selectors + metadata hashes, plus
  deterministic-JSON-stringify of contract outputs) is the natural
  follow-up.
- Bootstrap integration only handles auth_registry + public_checks;
  extending to multi_call_entrypoint is mechanical.
- The TS generator (`generate:data`) is left in place as a drift check —
  it still produces the same `standard_addresses.nr`, so any divergence
  fails the build loudly.
@dbanks12 dbanks12 force-pushed the dbanks12/cpp-address-derivation branch from e7d380e to d4b0653 Compare May 17, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant