measurement

voynich measurement reads, publishes, deprecates and verifies on-chain Measurement PDAs that bind a 48-byte SHA-384 enclave runtime measurement to its source repository, commit SHA, version and reproducible build recipe hash. How the enclave bundle is built reproducibly is in Reproducible build and recipe; the program account layout is in Program: Accounts.

Shell
voynich measurement list --status active
voynich measurement show <96-hex digest>
voynich measurement publish --repo <source_repo> --commit <commit_sha>
voynich measurement verify <96-hex digest> --rebuild --source backend
voynich measurement deprecate <96-hex digest>

voynich measurement list#

Lists published on-chain measurement records. Needs no wallet.

Shell
voynich measurement list [--status active|deprecated]
FieldMeaning
--status'active' | 'deprecated'

Optional filter. When omitted, returns both active and deprecated records.

Prints a paginated { items, page, asOf } object whose items are MeasurementRecord objects.

voynich measurement show#

Reads one published measurement record by its 96-character hex SHA-384 digest. Needs no wallet.

Shell
voynich measurement show <digest>

Prints the MeasurementRecord JSON, or exits 1 with MEASUREMENT_NOT_FOUND if none exists on chain.

voynich measurement publish#

Publishes a 366-byte Measurement PDA on chain via publish_measurement. Signs with the wallet (--keypair, VOYNICH_KEYPAIR, or the Solana CLI keypair) and pays the PDA rent and transaction fee.

Shell
voynich measurement publish \
  --repo https://github.com/org/repo \
  --commit <7 to 64 hex commit SHA> \
  [--recipe enclave/dist/recipe.json] \
  [--digest <96-hex SHA-384>] \
  [--recipe-hash <64-hex SHA-256>] \
  [--version <semver>]

When --digest, --recipe-hash or --version is omitted, the command reads recipe.json automatically from --recipe <path> or the first existing default path (enclave/dist/recipe.json, backend/enclave/dist/recipe.json, dist/recipe.json). Explicit flags override values from recipe.json.

FieldMeaning
--repostring (1 to 128 bytes)required

Source repository URL or identifier (no whitespace or control characters).

--commitstring (7 to 64 hex chars)required

Source commit SHA that produced the measurement.

--recipefile path

Path to recipe.json generated by enclave/build.mjs.

--digest96-hex SHA-384

Non-zero 48-byte enclave runtime measurement. Defaults to measurement in recipe.json.

--recipe-hash64-hex SHA-256

Non-zero 32-byte voynich/enclave-recipe/v1 hash. Defaults to recipeHash in recipe.json.

--versionstring (1 to 32 bytes)

Release version string (no whitespace or control characters). Defaults to version in recipe.json.

Prints:

JSON
{
  "measurement": "<Measurement PDA address>",
  "digest": "<96-hex SHA-384>",
  "transaction": "<transaction signature>",
  "status": "active"
}

voynich measurement deprecate#

Marks an active Measurement PDA as deprecated via deprecate_measurement. The signing wallet must be either measurement.publisher or Config.admin (otherwise UNAUTHORIZED).

Shell
voynich measurement deprecate <digest>

Prints the updated MeasurementRecord with status: "deprecated".

voynich measurement verify#

Checks a published measurement against the chain and against either a local recipe.json or a fresh clean rebuild from source. Needs no wallet.

Shell
voynich measurement verify <digest> [--recipe <path>] [--source <dir>] [--rebuild]
FieldMeaning
digest96-hex SHA-384, first argumentrequired

The measurement digest to verify.

--recipefile path

Path to a local recipe.json to compare against (default search: enclave/dist/recipe.json, backend/enclave/dist/recipe.json, dist/recipe.json under --source or cwd). Ignored when --rebuild is set.

--sourcedirectory path

Directory containing the checkout (enclave/build.mjs, backend/enclave/build.mjs, or build.mjs) for --rebuild, or the base directory for default recipe.json lookup.

--rebuildflag

Imports enclave/build.mjs and runs a clean build into a temporary directory, computing fresh measurement (SHA-384) and recipeHash (SHA-256) directly from source and removing the temporary directory afterward.

The command:

  1. Reads the MeasurementRecord from GET /v1/measurements/{digest}.
  2. Against a cluster (!config.fixture), fetches the on-chain Measurement PDA (measurementPda(digest, config.programId)), decodes it with decodeMeasurementAccount, and confirms every field matches (onChainMatch).
  3. Compares the local or rebuilt SHA-384 against record.digest (digestMatch) and the local or rebuilt SHA-256 against record.recipeHash (recipeMatch).
  4. Sets verified = (status === "active" && onChainMatch && digestMatch && recipeMatch).

Prints JSON on stdout and exits 0 when verified is true, or 1 when verified is false (for example, if the measurement is deprecated or either hash differs):

JSON
{
  "verified": true,
  "digest": "<96-hex SHA-384>",
  "recipeHash": "<64-hex SHA-256>",
  "status": "active",
  "onChainMatch": true,
  "digestMatch": true,
  "recipeMatch": true,
  "sourceRepo": "https://github.com/org/repo",
  "commitSha": "<commit SHA>",
  "version": "0.1.3"
}