Skip to content

Add SEP-55 build verification guidance for mainnet contracts - #95

Open
kaankacar wants to merge 9 commits into
mainfrom
issue-agent/6-build-verification
Open

Add SEP-55 build verification guidance for mainnet contracts#95
kaankacar wants to merge 9 commits into
mainfrom
issue-agent/6-build-verification

Conversation

@kaankacar

@kaankacar kaankacar commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🤖 Automated message from Kaan's Automated Triage Bot.

Closes #6

Adds the build-verification material @aolieman proposed, in the two landing spots Kaan named. skills/smart-contracts/SKILL.md gets a "Verify your build" section after the build/deploy flow: what SEP-0055 actually does (source_repo / home_domain entries in the WASM's contractmetav0 section plus a GitHub build attestation over the binary), a release.yml example built on the soroban-build-workflow reusable workflow, and the two things that trip people up — which step needs each of the three permissions, and deploying the WASM from the release artifact rather than a local rebuild whose hash matches no attestation. skills/standards/SKILL.md routes to the new section from ## Related skills, which is where that file does cross-skill routing. The pre-mainnet pointer in SKILL.md and the security.md contract checklist reference it too, and there is an eval scenario covering the flow.

Framed as a standard step for every mainnet deploy rather than something conditional on how user-facing a contract is, per the discussion on the issue. It also states the limit explicitly, matching the SEP's own wording: an attestation proves which workflow run and commit produced the binary, not that the code is safe or was reviewed.

The example pins no version. It tells the agent to resolve the current release itself, read that release's release.yml, and pin the full commit SHA — because the newest tag in that repo is not always a published release.

Everything is checked against primary sources: SEP-0055 v0.4.1 (Draft) for the metadata formats and the attestation URL, the v25.1.0 release of soroban-build-workflow (its current latest) for the input names, the release_token secret, the --meta source_repo=... stamp, the attest step and the stellar.expert registration, and the stellar-cli help for --meta and contract info meta. The chain was walked end to end on a real contract: the WASM attached to a soroban-build-workflow release hashes to f60d33e…, and api.github.com/repos/reflector-network/reflector-dao-contract/attestations/sha256:f60d33e… returns that attestation with no token.

Nothing on-chain links a deployed WASM to its source, and the SEP-55
route to fixing that was missing from the skills entirely. Adds a
"Verify your build" section to the smart-contracts skill covering the
source_repo/home_domain metadata and the soroban-build-workflow reusable
workflow, points the pre-mainnet checklists at it, and expands the
one-line SEP-0055 entry in the standards skill.

Framed as a standard step for every mainnet deploy rather than something
reserved for user-facing contracts.
Copilot AI balanced review requested due to automatic review settings August 13, 2026 18:58
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://stellar.github.io/stellar-dev-skill/pr/pr-95/

Built to branch gh-pages at 2026-08-31 15:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds SEP-0055 guidance for traceable mainnet contract builds.

Changes:

  • Documents metadata, attestations, and release-artifact deployment.
  • Adds standards/security references.
  • Adds a build-verification evaluation scenario.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
skills/standards/SKILL.md Expands the SEP-0055 reference.
skills/smart-contracts/SKILL.md Adds build-verification workflow guidance.
skills/smart-contracts/security.md Adds verification to the contract checklist.
evals/scenarios/smart-contracts/04-build-verification.json Evaluates verification recommendations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread skills/smart-contracts/SKILL.md Outdated

jobs:
release:
uses: stellar-expert/soroban-build-workflow/.github/workflows/release.yml@v27.0.0 # pin a tag, not @main

Two metadata entries carry it (`stellar contract build --meta key=value`, read back with `stellar contract info meta --wasm <file>`):

- `source_repo=github:<owner>/<repo>` — where the source lives
Comment thread skills/smart-contracts/SKILL.md Outdated
push:
tags: ["v*"]

permissions: # all three are required to attest
@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Picked this up for review — re-checking my own claims here against the primary sources, and the CI, before this goes anywhere.

@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Reviewed this end to end and it holds up. Every claim checks against primary sources: SEP-0055 (Draft, v0.4.1) for the contractmetav0 entries, the source_repo / bare-domain home_domain formats and the three required permissions; soroban-build-workflow at the pinned v27.0.0 for the input names, the release_token secret, and that it really does stamp --meta source_repo=…, attest, attach the WASM to the release and register with stellar.expert; the CLI cookbook for stellar contract info meta --wasm <file>; and Lab's Build Info section, whose own caveat matches the limit stated in the text. CI is green on 452b954 — the preview job runs the full pnpm install --frozen-lockfile && pnpm lint && pnpm lint:ts && pnpm build, so the site check the PR body left open is covered.

I'm not merging it myself, though. We told @aolieman on #6 to say the word here if they'd rather own this, and merging twenty minutes later would make that offer hollow — the "every mainnet contract, not just user-facing ones" framing is theirs. Separately, the payload is a CI workflow granting contents / id-token / attestations: write and calling a third-party reusable workflow, which is a class of change I'm not allowed to auto-merge, however well verified.

@kaankacar @ElliotFriend — merge-ready from my side whenever you're happy with the wait, and I'll press the button myself if you'd rather I did. Worth knowing the Copilot review request didn't attach, so I'm the only reviewer so far. I'll keep tracking this and pick it up when someone replies.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (3)

skills/smart-contracts/SKILL.md:214

  • Pinning this build workflow to a mutable tag still allows that tag to be retargeted, so future “verified” builds could run different workflow code without any change in the contract repository. This is especially risky in provenance guidance; use the immutable commit for v27.0.0 instead.
    uses: stellar-expert/soroban-build-workflow/.github/workflows/release.yml@v27.0.0  # pin a tag, not @main

skills/smart-contracts/SKILL.md:207

  • contents: write is needed here to publish the GitHub release, not to create the attestation; attestation itself uses id-token: write and attestations: write (with repository read access). Labeling all three as attestation requirements teaches broader permissions than necessary when readers adapt this example.
permissions:        # all three are required to attest

evals/scenarios/smart-contracts/04-build-verification.json:9

  • This assertion rejects valid least-privilege attestation workflows that use contents: read; contents: write is specific to the reusable workflow's release-publishing step. Scope the expectation to the shown reusable release workflow so the eval does not penalize a correct custom SEP-55 workflow.
    "Any workflow it writes sets id-token: write, contents: write, and attestations: write permissions",

@aolieman aolieman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bot activity gives us an interesting question to discuss: should the workflow example pin a concrete version at all?

I'll argue that it should not. The LLM agent acting on these instructions needs to do a couple of things:

  1. Retrieve the latest build workflow release.
  2. Review release.yml to check if it does a clean build; if any concerns: abort, and warn the user.
  3. Pin the full commit SHA in the locally written workflow.

Any concrete pinning in the example will quickly go stale. And there's no point in pinning a version that is blindly relied on.

If you agree, I can make a PR where this is fixed.

Comment thread skills/smart-contracts/SKILL.md Outdated

jobs:
release:
uses: stellar-expert/soroban-build-workflow/.github/workflows/release.yml@v27.0.0 # pin a tag, not @main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v27.0.0 has not been released yet. These Action releases are mutable, so pinning a version tag is bad practice.

Comment thread skills/standards/SKILL.md Outdated
- [SEP-0049](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0049.md): Upgradeable-contract guidance
- [SEP-0050](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0050.md): NFT standard work
- [SEP-0055](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0055.md): Contract build verification
- [SEP-0055](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0055.md): Contract build verification — a `source_repo` metadata entry in the WASM plus a GitHub build attestation let anyone trace a deployed contract hash back to the commit and workflow run that built it. Automate it with [soroban-build-workflow](https://github.com/stellar-expert/soroban-build-workflow); setup in [`../smart-contracts/SKILL.md`](../smart-contracts/SKILL.md#verify-your-build)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format of the standards skill is SEP link + short name only. This addition would stand out and violates expectations.

Pinning v27.0.0 in the example was wrong twice over: that tag has no
published release (v25.1.0 is the latest), and a version tag is mutable,
so a retarget would silently change a workflow that runs with the
repository token, OIDC, and attestation permissions. Document resolving
the current release, reading its release.yml, and pinning that commit
SHA instead, matching how this repo pins pr-preview-action.

Also attribute each permission to the step that needs it, note that the
trust chain only works on a public repo since attestations are read
unauthenticated, and restore the standards list to its one-line format
with the routing pointer moved to Related skills.
@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Agreed on all of it, @aolieman — pushed in a592187.

On the pin: your instinct was right and it was worse than a style problem. v27.0.0 isn't just an unreleased tag, stellar-expert/soroban-build-workflow has no release for it at all — the tag exists and points at 88068ec, but the latest published release is still v25.1.0 from March. So the example was sending people at a tag that never shipped. The workflow example now tells the agent to resolve the current release itself (gh release view, then resolve the tag to its commit), read that release's release.yml before wiring it in, warn and stop if it isn't a clean build, and pin the full SHA with the version left in a comment. No concrete version survives in the file. That also matches what this repo already does to rossjrw/pr-preview-action, so the guidance and the practice now agree.

Standards format: you're right, every other entry in that list is link + short name. The entry is a bare one-liner again, and the routing pointer moved up to ## Related skills, which is where that file does cross-skill routing anyway — that keeps the pointer Kaan asked for in #6 without the list entry standing out.

Copilot's other two also landed: each permission is now attributed to the step that needs it (contents: write publishes the release, id-token/attestations do the attesting), and the section says the source repo has to be public, since SEP-55's verification flow reads the attestation from api.github.com/.../attestations/sha256:<hash> unauthenticated. I left out its claim about which GitHub plan private-repo attestations need — I couldn't check that against a primary source, and the public-repo requirement stands on the SEP's own flow without it. The eval scenario moved with the guidance: it now expects a self-resolved SHA pin and no longer asserts contents: write as an attestation requirement.

CI is green on a592187 (the preview job runs the full pnpm install --frozen-lockfile && pnpm lint && pnpm lint:ts && pnpm build).

I'm not merging. You've requested changes, so it's yours to clear — and the payload is CI-workflow guidance with write-scoped permissions calling a third-party reusable workflow, which is a class I don't auto-merge regardless. If you'd still rather own this as your own PR, say so and I'll close this one; the offer hasn't expired.

@kaankacar @ElliotFriend — the merge decision is yours once @aolieman is happy.

@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

@aolieman Thanks again for the review. All requested changes landed in a592187 on Aug 14. Can you take another look? If it reads well now, we will merge.

@aolieman

Copy link
Copy Markdown

If you want to go, go. I can't make that decision for you. Since I provided all input for this PR, I shouldn't be the one to review it.

Copilot AI review requested due to automatic review settings August 31, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread skills/smart-contracts/SKILL.md Outdated
gh api repos/stellar-expert/soroban-build-workflow/commits/<tag> --jq .sha # its commit
```

Read that release's `release.yml` before wiring it in — it should check out the tagged commit, build from source, and attest the same file it uploads. If it doesn't, stop and tell the user rather than pinning it anyway. Then pin the full commit SHA, not the tag: tags are mutable, and this workflow runs with your repository token, OIDC, and attestation permissions.
Copilot AI review requested due to automatic review settings August 31, 2026 14:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

skills/smart-contracts/SKILL.md:191

  • This overstates private-repository support. GitHub artifact attestations are available for private/internal repositories only on Enterprise Cloud; Free, Pro, and Team support them only for public repositories. Qualify this so users on other plans do not configure a workflow that cannot publish an attestation.
Nothing on-chain ties a deployed WASM to its source. [SEP-0055](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0055.md) (Draft) closes that gap: build in GitHub Actions, stamp the source repository into the WASM's `contractmetav0` section, and publish a [GitHub build attestation](https://docs.github.com/en/actions/how-tos/secure-your-work/use-artifact-attestations/use-artifact-attestations) over the binary — anyone can then walk from the on-chain WASM hash back to the commit and the workflow run that produced it. Verifiers read the attestation from `api.github.com/repos/<owner>/<repo>/attestations/sha256:<wasm-hash>` unauthenticated, so the source repository has to be public for that "anyone" to hold. A private repo still gets an attestation, but only accounts with repository access can read it, so no user of your contract can. Make it a standard step before **any** mainnet deploy; it costs one workflow file, so there's no reason to reserve it for user-facing contracts.

skills/smart-contracts/SKILL.md:208

  • Pinning only the reusable workflow does not make the reviewed build executable immutable. The current v25.1.0 release.yml still invokes mutable refs such as actions/checkout@v4, stellar/stellar-cli@v25.1.0, and actions/attest-build-provenance@v1; those can change after review while receiving this job's write/OIDC permissions. Require full-SHA auditing of nested actions too, or direct users to a vetted fork that pins them.
Read that release's `release.yml` before wiring it in — it should check out the tagged commit, build from source, and attest the same file it uploads. If it doesn't, stop and tell the user rather than pinning it anyway. Then pin the full commit SHA, not the tag: tags are mutable, and this workflow runs with your repository token, OIDC, and attestation permissions.

Copilot AI review requested due to automatic review settings August 31, 2026 14:58
@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Thanks @aolieman. Understood, and I will not put the decision back on you.

Re-reviewed at head c78e37b. Four things changed since your review:

  • Main added two CI steps after Aug 14. This branch had neither script, so its green CI was stale. Main is merged in and preview passes again, pnpm build included.
  • commits/<tag> sat inside a bash fence, where < is a redirect, not a placeholder. The version lookup is now copy-pastable and was run as written.
  • The private-repo caveat was too strong. It now says only accounts with repository access can read the attestation.
  • Copilot found that the commit pin freezes release.yml only, not the actions release.yml calls. That is correct, so the section now states the limit. I did not adopt its "require transitive SHA pins" fix, because a caller cannot pin actions inside someone else's workflow.

No concrete version survives in the file, per your point. The effective diff is still the same four files.

One Copilot review is still running against an older head. I will adjudicate it when it lands.

@kaankacar — the merge is yours. This teaches a CI workflow with three write-scoped permissions, calling a third-party reusable workflow. I do not auto-merge that class, however well verified. Nothing else blocks it: every requested change landed and no reviewer objects. Say the word and I will merge.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

skills/smart-contracts/SKILL.md:191

  • This overstates private-repository support. GitHub only allows artifact attestations for private/internal repositories on Enterprise Cloud; on Free, Pro, or Team the attestation step cannot publish one at all. Please qualify the private-repo case so users on unsupported plans do not expect this workflow to succeed.
Nothing on-chain ties a deployed WASM to its source. [SEP-0055](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0055.md) (Draft) closes that gap: build in GitHub Actions, stamp the source repository into the WASM's `contractmetav0` section, and publish a [GitHub build attestation](https://docs.github.com/en/actions/how-tos/secure-your-work/use-artifact-attestations/use-artifact-attestations) over the binary — anyone can then walk from the on-chain WASM hash back to the commit and the workflow run that produced it. Verifiers read the attestation from `api.github.com/repos/<owner>/<repo>/attestations/sha256:<wasm-hash>` unauthenticated, so the source repository has to be public for that "anyone" to hold. A private repo still gets an attestation, but only accounts with repository access can read it, so no user of your contract can. Make it a standard step before **any** mainnet deploy; it costs one workflow file, so there's no reason to reserve it for user-facing contracts.

Copilot AI review requested due to automatic review settings August 31, 2026 15:05
@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Copilot's review landed on head c78e37b. Its one point was correct.

I rejected the same claim on Aug 14 for lack of a primary source. I have the source now. GitHub's docs gate the feature by plan:

  • Free, Pro, and Team: public repositories only.
  • Private and internal repositories: Enterprise Cloud.

So "a private repo still gets an attestation" was wrong. On most plans it gets none. Fixed in a6eb6aa, which names the plans. Nothing else changed.

Copilot will re-review this push. I will adjudicate that round too.

@kaankacar — the merge is still yours. The section teaches a CI workflow with three write-scoped permissions, calling a third-party reusable workflow. I do not auto-merge that class. Every review point is now answered and no reviewer objects.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

skills/smart-contracts/SKILL.md:205

  • Resolve and review the workflow at the same immutable SHA. As written, the SHA is resolved once, but “that release's release.yml” may still be opened through the mutable tag; if the tag moves, the reviewed workflow can differ from the commit ultimately pinned, defeating this supply-chain check.
REPO=stellar-expert/soroban-build-workflow
TAG=$(gh release view --repo "$REPO" --json tagName --jq .tagName)  # latest release
gh api "repos/$REPO/commits/$TAG" --jq .sha                         # its commit

Copilot AI review requested due to automatic review settings August 31, 2026 15:13
@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Copilot reviewed head a6eb6aa. Its one point was correct.

The version-resolution block resolved the release commit, then told the reader to review release.yml at the tag. A tag can move between those two steps. You then review one commit and pin another.

Fixed in e6cfe91:

  • The block now reads the file at the resolved SHA. I ran the commands as written.
  • The eval scenario expects the same order.

Rechecked at the current release v25.1.0 (commit e43b241): that release.yml still calls actions/checkout@v4, stellar/stellar-cli@v25.1.0 and actions/attest-build-provenance@v1. The paragraph on what the pin does not cover stands.

Copilot will re-review this push. I will adjudicate that round too.

@kaankacar — the merge is still yours. This section teaches a CI workflow with three write-scoped permissions, calling a third-party reusable workflow. I do not auto-merge that class. Every review point is answered and no reviewer objects.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Copilot re-reviewed head e6cfe91. It found nothing: no active comments and no suppressed block.

That closes every review round on this PR:

  • @aolieman's two points: fixed on Aug 14.
  • Every Copilot point: answered. Fixes pushed for all but one. I declined its "pin the nested actions too" rule, because a caller cannot pin actions inside someone else's workflow. The section states that limit instead.
  • All checks pass at e6cfe91, preview included. That job runs the full lint and build.

@kaankacar — the merge is yours. This section teaches a CI workflow with three write-scoped permissions, calling a third-party reusable workflow. I do not auto-merge that class, however well verified. Nothing else blocks it. Say the word and I will press the button.

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.

Build verification for prod contracts

3 participants