Skip to content

feat(circuits): release 0.15.0 with memo-bound transfer/unshield v2 beside v1, and multi-version build tooling - #21

Merged
nol4lej merged 4 commits into
mainfrom
feat/memo-bound-circuits-v2
Sep 28, 2026
Merged

nol4lej merged 4 commits into
mainfrom
feat/memo-bound-circuits-v2

Conversation

@nol4lej

@nol4lej nol4lej commented Sep 28, 2026

Copy link
Copy Markdown
Member

Description

Releases @orbinum/circuits 0.15.0. It ships memo-bound v2 of transfer and unshield alongside the published v1, with v2 active, and removes the unused value_proof circuit. The chain activates v2 and retires v1 in the runtime spec 16 upgrade, using keys embedded in the runtime.

Ceremony (v2):

  • Single contributor on pot16_final.ptau, with fresh random entropy for each circuit.
  • Final beacon: hash of Orbinum testnet finalized block #1045242, 0x39c0d3042e4de951d72540b487175894ae4e3092237c4d71833e2884acb1f6ec, with 2^10 iterations.
Circuit v1 vk_hash (unchanged) v2 vk_hash
transfer 0x4f93eaab…4f21 0x8eb9dbb295ce10498fbe7088a4b0f327a675094d657170725d02770711634525
unshield 0x9928482f…945e 0x729c4cced3306e89d0dd977448768cc9c39cc806a393dea8cd8fe2946eb19bab

v1 artifacts and their manifest entries are byte-identical to 0.14.0.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issue

None. This is part of the runtime spec 16 release (memo binding and public relay fee claims).

Changes Made

Circuits

  • memo_hash = blake2_256(SCALE(memos)) mod r is the new last public input of transfer and unshield (v2). Until now a copier could swap the encrypted memos of a pending spend and make its notes unrecoverable. Transfer hashes both output memos, in order; unshield hashes its change memo, which is empty for a total unshield.
  • value_proof removed. Relay fees are claimed publicly since spec 16 (no note, no proof), so circuit id 6 has no caller; no node or client ever proved it. Its source, tests, fixture, manifest entry and docs are gone. Packages up to 0.14.0 keep its artifacts.

Multi-version tooling

The build assumed one version per circuit, so a rotation broke the tree:

  • Compile / setup / pack / fixtures now build the manifest's active version, or ROTATE_VERSION for circuits listed in ROTATE_CIRCUIT, under _v{n} names. Before, compiling overwrote the v1 wasm and r1cs and deleted <circuit>_js/.
  • pnpm run manifest without rotation keeps every version. It used to rebuild each circuit as a single v1 entry, so the CI regeneration check would have dropped v2.
  • ROTATE_CIRCUIT accepts a comma-separated list. Circuits not being rotated keep their published entry.
  • transfer / unshield tests compile into build/test-circuits/, so they no longer corrupt the published artifacts.
  • Tests read the source version's artifacts, and rotation.test rotates to the version after the highest one in the manifest.

npm package

  • getCircuitPaths(circuit, version?) returns the active version by default, together with its version. Before, it always returned the v1 paths.
  • The accepted circuits are now "transfer" | "unshield".

Docs

  • docs/RELEASE.md: how to build and publish a rotation.
  • README, guides, architecture, and circuit docs: updated for v2, with value_proof removed.
  • CHANGELOG.md: new 0.15.0 section.

Testing

  • All existing tests pass: test:strict 243 passing, 0 failing, 0 pending
  • New tests added for new functionality: rotation with several circuits, and regeneration keeping every version
  • Manual testing performed:
    • release:restore → v1 canonical; release:verify passes before and after the test suite
    • pnpm run check: lint, typecheck, format, circom lint
    • CI flow simulated (build-all --compile-only → release:verify): v2 compiles deterministically
    • v2 keys embedded in node spec 16 (embed-v2.sh): hashes match the manifest
    • Node e2e against these artifacts: spec 15 → setCode → spec 16 upgrade 35/35, relay suite 114/114, memo clients 32/32

Circuit Changes

Affected Circuits:

  • Transfer
  • Unshield
  • Core components

Constraint Count Impact:

  • Transfer: 33,687 → 33,688 (+1, +0.003%)
  • Unshield: 16,903 → 16,904 (+1, +0.006%)
  • The new constraint is memo_hash_sq <== memo_hash * memo_hash, which keeps the input from being optimized away.

Performance Impact

Benchmarks: not measured. The change is one constraint per circuit, so no measurable change in proving or verification time is expected.

Breaking Changes

  • v2 public signals: 8 instead of 7.
    • Provers need @orbinum/proof-generator ^7.2.0.
    • @orbinum/wallet-sdk must bump CIRCUITS_PACKAGE_VERSION to 0.15.0.
  • value_proof is no longer in the package. getCircuitPaths("value_proof") throws.
  • getCircuitPaths defaults to the active version (v2). Callers that need v1 pass 1.

Checklist

  • Code follows the project's style guidelines
  • Self-review of code performed
  • Comments added for complex logic
  • Documentation updated
  • No new warnings generated
  • Tests added/updated and passing
  • Commit messages follow Conventional Commits
  • CHANGELOG.md updated

Additional Notes

  • Expected CI failures on this PR: Build & Test and Canonical vk_hash fail with a 404 for the v2 keys. CI restores keys from npm latest, and v2 only exists on the release machine until it is published.
  • Plan (see docs/RELEASE.md): publish 0.15.0 from this branch, re-run CI, then merge without squashing so the tag v0.15.0 stays on main.
  • Clients (proof-generator, protocol, wallet-sdk, app) must be published before the spec 16 setCode.

@nol4lej
nol4lej merged commit f2c544f into main Sep 28, 2026
5 checks passed
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