Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e0963f2
Add --verifiable flag to stellar contract build.
fnando May 21, 2026
b04676d
Record every build-affecting flag as bldopt.
fnando May 21, 2026
1a118d1
Remove duplicate 'contract build' in container error hint.
fnando May 21, 2026
196405d
Probe container cli version for --optimize syntax.
fnando May 21, 2026
c81c6d5
Add SEP-58 source-id flags to --verifiable.
fnando May 21, 2026
e000d84
Move --locked info banner after validation.
fnando May 21, 2026
5f59fb8
Group --docker-host under Verifiable on contract build.
fnando May 22, 2026
17c2fc8
Plumb verbose flag through run_in_container.
fnando May 22, 2026
9c3b31f
Capitalize info and warn messages on verifiable build.
fnando May 22, 2026
c20a1d5
Rewrite docker pull status lines for clarity.
fnando May 22, 2026
4d7fcd6
Anchor verifiable build bind-mount to git root or cwd.
fnando May 22, 2026
d5a7209
Pull bldimg when --image is set.
fnando May 22, 2026
38d09ee
Avoid duplicate Image prefix in pull status.
fnando May 22, 2026
ae73bcc
Factor enforce_hardened_tree out of fix_config_permissions.
fnando May 22, 2026
7014661
Generate source archive for verifiable builds.
fnando Jun 17, 2026
5653489
Record each contract's package in verifiable builds.
fnando Jun 17, 2026
4518c1a
Document reproducible source archive guarantees.
fnando Jun 17, 2026
36552c9
Add stellar contract archive command.
fnando Jun 17, 2026
9892d6e
Add --env to set build environment variables.
fnando Jun 17, 2026
3af186c
Pin the rust toolchain in verifiable builds.
fnando Jun 18, 2026
bf7cf3a
Build source archives from the working directory.
fnando Jun 19, 2026
1833606
Skip --locked on build images that lack it.
fnando Jul 8, 2026
ef4993c
Run verifiable builds through the docker CLI.
fnando Jul 16, 2026
b556382
Support other container engines in verifiable builds.
fnando Jul 17, 2026
6018142
Stop the build container when the build is interrupted.
fnando Jul 17, 2026
e182c7e
Scaffold stellar contract verify with metadata extraction.
fnando May 21, 2026
2df7217
Add trust gates to stellar contract verify.
fnando May 22, 2026
8ad2ff8
Materialize source for stellar contract verify.
fnando May 22, 2026
5164cf2
Rebuild and byte-compare in stellar contract verify.
fnando May 22, 2026
63d0d33
Use direct --docker-host field on contract verify.
fnando May 22, 2026
cb21dc9
Use question and warn emojis on trust prompt.
fnando May 22, 2026
ee11961
Respect --verbose and --quiet on contract verify.
fnando May 22, 2026
c0fd99e
Force trust prompts visible even under --quiet.
fnando May 22, 2026
525724a
Capitalize Verified result line.
fnando May 22, 2026
519f4aa
Capitalize info, warn, and check messages on contract verify.
fnando May 22, 2026
4894a02
Expand github:user/repo source_repo before git clone.
fnando May 22, 2026
3f012ee
Validate retrieval channel before trust prompts.
fnando May 22, 2026
f8e3960
Anchor verify rebuilt-wasm search at manifest-path parent.
fnando May 22, 2026
df0ad61
Add stellar contract verify integration tests.
fnando May 22, 2026
872e1c4
Add tarball-sha256 + local --tarball-url verify test.
fnando May 22, 2026
1d3902e
Move verify integration tests into integration tier.
fnando May 22, 2026
4e21de4
Restrict permissions on materialized verify source.
fnando May 22, 2026
de2fc15
Share build logic and fix contract verify rebuild.
fnando Jun 17, 2026
eb6ddd0
Add --wasm-hash to stellar contract verify.
fnando Jun 17, 2026
5ffd7ac
Stop requiring source hash when setting source URI.
fnando Jun 19, 2026
54291d5
Skip --locked when verifying against older images.
fnando Jul 8, 2026
1c8d8f7
Find rebuilt contract in workspace target folders.
fnando Jul 8, 2026
8a11c08
Strip shell quotes from build options when rebuilding.
fnando Jul 8, 2026
557918a
Add --keep to save build files for debugging.
fnando Jul 8, 2026
4d82b0a
Show the source file actually used when overriding.
fnando Jul 8, 2026
a65557a
Reject unknown source formats.
fnando Jul 9, 2026
0c23e77
Support zip files as verifiable build sources.
fnando Jul 9, 2026
d702bc0
Reject duplicate build metadata when verifying.
fnando Jul 9, 2026
d72a039
Replay recorded metadata in order when verifying.
fnando Jul 9, 2026
e71431f
Skip source metadata when verifying a contract.
fnando Jul 9, 2026
da0b601
Fall back to the last metadata block when verifying.
fnando Jul 9, 2026
7027bd9
Run contract verify through the docker CLI.
fnando Jul 16, 2026
3f94258
Support other container engines in contract verify.
fnando Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 75 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ escape-bytes = "0.1.1"
hex = "0.4.3"
itertools = "0.10.0"
async-trait = "0.1.76"
tar = "0.4.46"
flate2 = "1.0.30"
zip = { version = "8.6.0", default-features = false, features = ["deflate"] }
serde-aux = "4.1.2"
serde_json = "1.0.82"
serde = "1.0.82"
Expand Down
74 changes: 74 additions & 0 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Tools for smart contract developers
- `asset` — Utilities to deploy a Stellar Asset Contract or get its id
- `alias` — Utilities to manage contract aliases
- `bindings` — Generate code client bindings for a contract
- `archive` — Generate the reproducible source archive used by verifiable builds
- `build` — Build a contract from source
- `extend` — Extend the time to live ledger of a contract-data ledger entry
- `deploy` — Deploy a wasm contract
Expand All @@ -98,6 +99,7 @@ Tools for smart contract developers
- `optimize` — ⚠️ Deprecated, use `build --optimize`. Optimize a WASM file
- `read` — Print the current value of a contract-data ledger entry
- `restore` — Restore an evicted value for a contract-data legder entry
- `verify` — Verify that a contract's WASM reproduces from the build metadata it records, per SEP-58. Either pass a contract id/alias via `--id` (the WASM is fetched from the network) or a local file via `--wasm`

## `stellar contract asset`

Expand Down Expand Up @@ -344,6 +346,17 @@ Generate PHP bindings

**Usage:** `stellar contract bindings php`

## `stellar contract archive`

Generate the reproducible source archive used by verifiable builds

**Usage:** `stellar contract archive [OPTIONS]`

###### **Options:**

- `-o`, `--out-file <OUT_FILE>` — Where to write the gzipped tarball. Required unless `--dry-run` is used
- `--dry-run` — List the entries that would be archived and the computed source_sha256, without writing any file

## `stellar contract build`

Build a contract from source
Expand All @@ -356,6 +369,18 @@ To view the commands that will be executed, without executing them, use the --pr

**Usage:** `stellar contract build [OPTIONS]`

###### **Container Options:**

- `-d`, `--docker-host <DOCKER_HOST>` — Optional argument to override the default docker host. This is useful when you are using a non-standard docker host path for your Docker-compatible container runtime, e.g. Docker Desktop defaults to $HOME/.docker/run/docker.sock instead of /var/run/docker.sock
- `--engine <ENGINE>` — Container engine to use [default: docker]

Possible values:
- `docker`: Docker, or any Docker-compatible CLI
- `apple-container`: Apple's `container` CLI (macOS 26+, Apple silicon)

- `--cpus <CPUS>` — Limit the number of CPUs available to the container, e.g. `2`. A whole number: Apple's `container` engine does not accept fractional CPUs
- `--memory <MEMORY>` — Limit the memory available to the container, e.g. `2g` or `512m`

###### **Features:**

- `--features <FEATURES>` — Build with the list of features activated, space or comma separated
Expand Down Expand Up @@ -384,6 +409,7 @@ To view the commands that will be executed, without executing them, use the --pr
If ommitted, wasm files are written only to the cargo target directory.

- `--locked` — Assert that `Cargo.lock` will remain unchanged
- `--env <ENV>` — Set an environment variable for the build (repeatable), e.g. `--env NAME=VALUE`. It's set on the build process; for a verifiable build it's passed to the container and recorded as a `bldopt`, so avoid secrets there
- `--optimize <OPTIMIZE>` — Optimize the generated wasm. Enabled by default; pass `--optimize=false` to disable. Requires the `additional-libs` feature

Default value: `true`
Expand All @@ -394,6 +420,13 @@ To view the commands that will be executed, without executing them, use the --pr

- `--print-commands-only` — Print commands to build without executing them

###### **Verifiable Options:**

- `--verifiable` — Build inside a trusted Docker container and record SEP-58 metadata (`bldimg`, `source_uri`, `source_sha256`, `bldopt`) so the resulting WASM can be reproduced and verified by third parties. Implies `--locked`. Requires a clean git working tree
- `--image <IMAGE>` — Override the auto-selected container image used by `--verifiable`. Must be digest-pinned, e.g. `docker.io/stellar/stellar-cli@sha256:...`. Tag-only refs are rejected because SEP-58 requires content addressing
- `--source-sha256 <SOURCE_SHA256>` — SEP-58 source identification: SHA-256 of the source archive (recorded as the `source_sha256` meta entry). Optional with `--verifiable`: the archive is always generated and its SHA-256 computed for you. When supplied it's treated as a pin — the build fails if it doesn't match the generated archive
- `--source-uri <SOURCE_URI>` — entry). Optional with `--verifiable`; the recorded `source_sha256` is computed from the generated archive, unless `--source-sha256` is explicitly set

## `stellar contract extend`

Extend the time to live ledger of a contract-data ledger entry.
Expand Down Expand Up @@ -481,6 +514,7 @@ Deploy a wasm contract
Default value: `false`

- `--alias <ALIAS>` — The alias that will be used to save the contract's id. Whenever used, `--alias` will always overwrite the existing contract id configuration without asking for confirmation
- `--env <ENV>` — Set an environment variable for the build (repeatable), e.g. `--env NAME=VALUE`. It's set on the build process; for a verifiable build it's passed to the container and recorded as a `bldopt`, so avoid secrets there
- `--optimize <OPTIMIZE>` — Optimize the generated wasm. Enabled by default; pass `--optimize=false` to disable. Requires the `additional-libs` feature

Default value: `true`
Expand Down Expand Up @@ -855,6 +889,7 @@ Install a WASM file to the ledger without creating a contract instance

Default value: `false`

- `--env <ENV>` — Set an environment variable for the build (repeatable), e.g. `--env NAME=VALUE`. It's set on the build process; for a verifiable build it's passed to the container and recorded as a `bldopt`, so avoid secrets there
- `--optimize <OPTIMIZE>` — Optimize the generated wasm. Enabled by default; pass `--optimize=false` to disable. Requires the `additional-libs` feature

Default value: `true`
Expand Down Expand Up @@ -918,6 +953,7 @@ Install a WASM file to the ledger without creating a contract instance

Default value: `false`

- `--env <ENV>` — Set an environment variable for the build (repeatable), e.g. `--env NAME=VALUE`. It's set on the build process; for a verifiable build it's passed to the container and recorded as a `bldopt`, so avoid secrets there
- `--optimize <OPTIMIZE>` — Optimize the generated wasm. Enabled by default; pass `--optimize=false` to disable. Requires the `additional-libs` feature

Default value: `true`
Expand Down Expand Up @@ -1127,6 +1163,44 @@ If no keys are specificed the contract itself is restored.
- `--inclusion-fee <INCLUSION_FEE>` — Maximum fee amount for transaction inclusion, in stroops. 1 stroop = 0.0000001 xlm. Defaults to 100 if no arg, env, or config value is provided
- `--build-only` — Build the transaction and only write the base64 xdr to stdout

## `stellar contract verify`

Verify that a contract's WASM reproduces from the build metadata it records, per SEP-58. Either pass a contract id/alias via `--id` (the WASM is fetched from the network) or a local file via `--wasm`

**Usage:** `stellar contract verify [OPTIONS]`

###### **Container Options:**

- `-d`, `--docker-host <DOCKER_HOST>` — Optional argument to override the default docker host. This is useful when you are using a non-standard docker host path for your Docker-compatible container runtime, e.g. Docker Desktop defaults to $HOME/.docker/run/docker.sock instead of /var/run/docker.sock
- `--engine <ENGINE>` — Container engine to use [default: docker]

Possible values:
- `docker`: Docker, or any Docker-compatible CLI
- `apple-container`: Apple's `container` CLI (macOS 26+, Apple silicon)

- `--cpus <CPUS>` — Limit the number of CPUs available to the container, e.g. `2`. A whole number: Apple's `container` engine does not accept fractional CPUs
- `--memory <MEMORY>` — Limit the memory available to the container, e.g. `2g` or `512m`

###### **Global Options:**

- `--config-dir <CONFIG_DIR>` — Location of config directory. By default, it uses `$XDG_CONFIG_HOME/stellar` if set, falling back to `~/.config/stellar` otherwise. Contains configuration files, aliases, and other persistent settings

###### **Options:**

- `--id <CONTRACT_ID>` — Contract id or alias to fetch the WASM from the network
- `--wasm <WASM>` — Local WASM file to verify, instead of fetching from the network
- `--wasm-hash <WASM_HASH>` — WASM hash (hex) to fetch the WASM from the network
- `--source-uri <SOURCE_URI>` — Local source code file or http(s) URL to use as the source when the WASM's recorded SEP-58 metadata has only `source_sha256` (no `source_uri`). Accepts http(s) URLs or local file paths
- `--trust` — Bypass interactive confirmation when the WASM's bldimg is not in the default trust list, or when the source is provided as an archive (source archives are never default-trusted)
- `--keep` — Keep the materialized source and rebuild output instead of deleting them on exit, and print the path. Useful for debugging a byte mismatch (e.g. diffing the rebuilt WASM's metadata against the original)

###### **RPC Options:**

- `--rpc-url <RPC_URL>` — RPC server endpoint
- `--rpc-header <RPC_HEADERS>` — RPC Header(s) to include in requests to the RPC provider, example: "X-API-Key: abc123". Multiple headers can be added by passing the option multiple times
- `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
- `-n`, `--network <NETWORK>` — Name of network to use from config

## `stellar doctor`

Diagnose and troubleshoot CLI and network issues
Expand Down
Loading
Loading