Skip to content

SEP-0058: Contract build reproducibility#1933

Merged
leighmcculloch merged 9 commits into
masterfrom
contract-reproducibility
May 15, 2026
Merged

SEP-0058: Contract build reproducibility#1933
leighmcculloch merged 9 commits into
masterfrom
contract-reproducibility

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented May 15, 2026

Copy link
Copy Markdown
Member

What

Propose SEP-0058 (Draft), defining a vocabulary for the build environment information needed to reproduce a Soroban contract's wasm bytes from source.

The vocabulary is two groups of named meta fields:

  • Build environmentbldimg (digest-pinned container image) and repeating bldopt (shell-style flags deviating from the baseline stellar contract build invocation).
  • Source identificationsource_repo+source_rev, tarball_url, and tarball_sha256, in conformant combinations covering git, hosted tarballs, and content-addressed source.

The SEP is storage-agnostic (fields can live in contractmetav0 per SEP-46, in an on-chain registry, or off-chain). An appendix demonstrates a reproducible build with docker.io/stellar/stellar-cli.

Why

A contract deployed to mainnet is opaque bytes today. Anyone can rebuild from
source and compare hashes, but the build environment required to reproduce a
build (container image, toolchain, flags) isn't well defined or recorded
anywhere, so two independent verifiers have no shared way to reach the same
result.

This SEP is complementary to SEP-55 (attestation-based verification): SEP-55
asks "did a particular trusted CI compile this wasm?", while SEP-0058 provides
what's needed to actually rebuild and compare bytes. A contract can carry meta
supporting both, and verifiers pick whichever path fits their threat model.

Discussion: https://github.com/orgs/stellar/discussions/1923

Copilot AI review requested due to automatic review settings May 15, 2026 03:19

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3219ba0e5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ecosystem/sep-0058.md Outdated
Comment thread ecosystem/sep-0058.md Outdated

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 a new draft ecosystem proposal (SEP-0058) defining a storage-agnostic vocabulary for recording Soroban contract build-environment and source-identification metadata needed to reproduce and independently verify deployed WASM bytes.

Changes:

  • Introduces ecosystem/sep-0058.md specifying build environment fields (bldimg, repeating bldopt) and source identification fields (source_repo/source_rev, tarball_url, tarball_sha256), plus rationale/security/appendix.
  • Registers SEP-0058 in the Draft Proposals table in ecosystem/README.md.

Reviewed changes

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

File Description
ecosystem/sep-0058.md New draft SEP defining reproducible-build metadata vocabulary and an example workflow.
ecosystem/README.md Adds SEP-0058 entry to the list of draft proposals.

Comment thread ecosystem/sep-0058.md Outdated
Comment thread ecosystem/sep-0058.md Outdated
Comment thread ecosystem/sep-0058.md Outdated
Comment thread ecosystem/sep-0058.md Outdated

@tupui tupui 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.

Thanks for putting this together. I left some suggestions.

Comment thread ecosystem/sep-0058.md
Comment on lines +21 to +25
Complementary to
[SEP-55](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0055.md),
which uses signed CI attestations instead of independent rebuild. The two
address the same trust question with different trade-offs and can coexist on
the same contract.

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.

I would rephrase the bit about "same trust question". Rather it attests the provenance of the build. So right now both SEPs are really complementary and I suggest using a stronger wording that they be used in tandem.

Saw the bit in the rational and think it should read like this here as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This SEP isn't dependent on SEP-55, it doesn't require it, but verifiers can of course combine them. I don't think the proposal needs to create artificial dependence. The main point here is that this proposal does not attempt to replace or conflict with SEP-55.

Comment thread ecosystem/sep-0058.md
Comment on lines +124 to +125
- **CI provenance**: image attestations (e.g. SLSA-style) proving which CI run
produced the image, so the image can be traced back to a published pipeline.

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.

Only mention of SLSA here, I would add a ref at least.

Comment thread ecosystem/sep-0058.md
Comment on lines +165 to +167
registry instead of using the versions pinned in `Cargo.lock`. It is therefore
reasonable, when reproducing a build, to always include `--locked` even if it
was not present in `bldopt`.

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.

I would use a stronger wording. In this context not sure it would be good to leave any space. Pin all the way.

On bldopt the important component is the version of the CLI. I am specifically concerned about breaking APIs. Which is all good as the CLI's version is pinned.

Comment thread ecosystem/sep-0058.md

| key | description | format regex |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `source_repo` | HTTPS URL of the source repository (typically the origin remote). The `github:<user>/<repo>` shorthand defined by SEP-55 is also accepted so consumers can read values produced under SEP-55; the HTTPS URL form is preferred for new wasms. | `^(https?://\S+&#124;github:[^/\s]+/[^/\s]+)$` |

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.

Why restrict to HTTPS? At least we should allow IPFS in everything IMHO. Same on the forge side. I would rather see CIDs in general. I am afraid about specifying too much the regex and then we end up with platforms only supporting a single way with no incentive to do something else.

See some lighter wording below but that's in the rational part which implementations are not going to consider much.

Comment thread ecosystem/sep-0058.md
Comment on lines +287 to +288
**Source-repo format alignment with SEP-55.** SEP-55 defines `source_repo` as
`github:<user>/<repo>`; this SEP prefers an HTTPS URL because it generalizes

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.

Arguable, you have a URN vs URL. With naming you might need a mapping on your side with allowed values. HTTPS here is similarly restrictive as now you restrict to a given protocol. Linked to my other comment.

@leighmcculloch leighmcculloch merged commit a6efe1f into master May 15, 2026
7 checks passed
@leighmcculloch leighmcculloch deleted the contract-reproducibility branch May 15, 2026 10:00
@leighmcculloch

Copy link
Copy Markdown
Member Author

@tupui Thanks for the feedback. I'll open a change with the minor wording tweaks and links. The PR is a formality and temporary to get the document in the repo. Let's continue discussion at #1923 so that discussion doesn't become fragmented. Can you start sub-threads on the discussion about the scheme support (https, etc) and pinning (--locked) behaviour you are proposing?

@tupui

tupui commented May 15, 2026

Copy link
Copy Markdown
Contributor

ok no problem. The lock part is less my alley but will definitely open one for the scheme support part 👍

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.

4 participants