Skip to content

feat: ship the Solidity verifier in every circuit's release tarball - #10

Merged
xgreenx merged 2 commits into
mainfrom
feat/ship-solidity-verifiers
Sep 14, 2026
Merged

xgreenx merged 2 commits into
mainfrom
feat/ship-solidity-verifiers

Conversation

@xgreenx

@xgreenx xgreenx commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

bb should run in exactly one repo. The verifier derives from the vk alone, so it ships in the release that publishes the vk; consumers stop re-deriving it and drop their bb pin.

Changes

  • scripts/build.sh runs gen-verifier.sh per circuit into artifacts/<circuit>/, so release.yml packages and hashes the .sol with no packaging change and CI exercises it on every PR.
  • scripts/gen-verifier.sh derives the contract name from the circuit directory (bearer-linkBearerLinkHonkVerifier, oidc-googleOidcGoogleHonkVerifier), pins those two names and fails if a directory is renamed, gains --artifacts <dir>, defaults the output to <artifacts>/<circuit>/<Contract>.sol, and asserts exactly one concrete contract and no bare assembly { in the output.
  • Docs (release.yml/ci.yml headers, README.md, toolchain.env) no longer say libid-contracts regenerates verifiers; README "Consuming a release" states the new flow: download, check sha256, forge fmt, compile.

Verified

  • Local scripts/build.sh under nargo 1.0.0-beta.25 + bb 5.2.0 (arm64 macOS): BearerLinkHonkVerifier.sol 104011 B, OidcGoogleHonkVerifier.sol 104013 B; one concrete contract each; 5/5 assembly blocks memory-safe; vk hashes unchanged from the README table.
  • --out <dir> (the CI path) and default output byte-identical; gen-verifier.sh --artifacts <unpacked> regenerates a byte-identical .sol from the vk alone.
  • Rename guard exits 1 when circuits/bearer-link is moved; shellcheck clean.
  • Manifest loop from release.yml run locally over the new layout: <Contract>.sol appears in each tarball's files map.

Not verified / known issues

  • release.yml end to end: it only runs on a published release; its packaging logic is untouched. The GNU-tar step could not be simulated on macOS.
  • forge fmt / forge build of the shipped .sol: no Foundry toolchain here by design; the consumer's CI covers it.

The verifier derives from the vk alone, so it belongs in the release that
publishes the vk. Until now every consumer re-ran bb to derive it, which put
a bb pin in repos that have no other reason to know bb exists.

build.sh now runs gen-verifier.sh per circuit into artifacts/<circuit>/, so
release.yml packages and hashes it with no change. The contract name is
derived from the directory and pinned for the two known circuits, so a
rename fails the build instead of silently renaming what consumers compile.

Assisted-by: Claude Fable 5.1
Signed-off-by: xgreenx <xgreenx9999@gmail.com>
The release.yml header, README and toolchain.env described a downstream
`verifiers` job re-running bb over the vks. That is no longer the contract:
the .sol ships in the tarball and the manifest, and a consumer downloads,
checks sha256, runs forge fmt under its own foundry.toml, and compiles.

Assisted-by: Claude Fable 5.1
Signed-off-by: xgreenx <xgreenx9999@gmail.com>
@xgreenx
xgreenx merged commit b618e41 into main Sep 14, 2026
3 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