diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index 5154c17b055..9a152b5f4d7 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -366,6 +366,10 @@ export const SIDEBAR: Partial> = { title: "Updating Deployed Workflows", url: "cre/guides/operations/updating-deployed-workflows", }, + { + title: "Verifying Workflows", + url: "cre/guides/operations/verifying-workflows", + }, { title: "Deleting Workflows", url: "cre/guides/operations/deleting-workflows", diff --git a/src/content/cre/guides/operations/verifying-workflows.mdx b/src/content/cre/guides/operations/verifying-workflows.mdx new file mode 100644 index 00000000000..755f540e407 --- /dev/null +++ b/src/content/cre/guides/operations/verifying-workflows.mdx @@ -0,0 +1,115 @@ +--- +section: cre +date: Last Modified +title: "Verifying Workflows" +metadata: + description: "Learn how to verify workflow identity, validate workflows onchain in consumer contracts, and enable third-party verification using reproducible builds." + datePublished: "2026-03-19" + lastModified: "2026-03-19" +--- + +import { Aside } from "@components" + +Workflow verification ensures the integrity and authenticity of your workflows across deployment, onchain execution, and third-party auditing. This guide explains how workflow IDs are computed, how to verify workflows in consumer contracts, and how to enable independent verification by third parties. + +## Workflow ID + +The workflow ID is a unique hash that serves as the primary identifier for your workflow throughout its lifecycle. It is computed locally during [`cre workflow deploy`](/cre/reference/cli/workflow#cre-workflow-deploy) from the following inputs: + +- **workflowOwner**: The deployer's address +- **workflowName**: The name specified in your workflow +- **Compiled workflow binary**: The WASM binary produced from your workflow code +- **Config file contents**: The contents of your workflow's config file +- **Secrets hash**: An empty string placeholder for secrets + +Because the workflow ID is derived from these inputs, it deterministically represents a specific version of your workflow code and configuration. + + + +Use [`cre workflow hash`](/cre/reference/cli/workflow#cre-workflow-hash) to inspect the workflow ID before deploying. This lets you preview the ID without submitting an onchain transaction. + +For more details on deployment and updates, see [Deploying Workflows](/cre/guides/operations/deploying-workflows) and [Updating Deployed Workflows](/cre/guides/operations/updating-deployed-workflows). + +## Verifying workflows onchain + +When a workflow writes onchain, the consumer contract receives both the report data and metadata through the `onReport` callback. The metadata contains information you can use to verify the source of the report: + +- **`workflowId`** (`bytes32`): The unique workflow hash +- **`workflowName`** (`bytes10`): The workflow name, hash-encoded +- **`workflowOwner`** (`address`): The address that deployed the workflow + +See [Building Consumer Contracts](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts) for the full `IReceiver` interface and metadata structure. + +### Workflow name encoding + +The `workflowName` in metadata is not stored as a plain string. It is a SHA256 hash of the workflow name, truncated to `bytes10`. See [how workflow names are encoded](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts#how-workflow-names-are-encoded) for the full encoding process. + +### Security best practices + +Follow these practices to ensure only authorized workflows can interact with your consumer contract: + +- **Verify `msg.sender`**: Always check that `msg.sender` is the expected forwarder address. See the [Forwarder Directory](/cre/guides/workflow/using-evm-client/forwarder-directory) for addresses by network. +- **Permission on workflow ID**: Use `setExpectedWorkflowId` from `ReceiverTemplate` to restrict which workflow can call your contract. + + + +## Third-party verification + + + +Third-party verification allows customers or auditors to independently confirm that a deployed workflow matches its source code. The deployer shares the workflow source, and the verifier uses the CRE CLI to compute the workflow hash and compare it against the onchain workflow ID. + +### Steps for the workflow developer + +1. **Add a `.env.public` file** to your workflow folder with the Go toolchain version pinned: + + ``` + GOTOOLCHAIN=go1.23.0 + ``` + + This ensures reproducible builds across different platforms and environments. Add this file _before_ running `cre workflow deploy`. + +2. **Share your workflow source** with the customer. Provide a zip archive or repository link that includes all workflow files, including `.env.public`. Exclude `.env` files that contain private keys or secrets. + +### Steps for the verifier + +1. [**Install the CRE CLI**](/cre/getting-started/cli-installation). No login or deploy access is required for hash verification. + +2. **Unzip or clone** the shared workflow repository. + +3. **Run `cre workflow hash`** to compute the workflow hash: + + ```bash + cre workflow hash ./workflow-folder --public_key=0xYourDeployerAddress + ``` + + Replace `./workflow-folder` with the path to the workflow source and `0xYourDeployerAddress` with the deployer's public address. + +4. **Compare the output** with the workflow ID observed onchain. The `Workflow hash` value in the output corresponds to the onchain workflow ID: + + ``` + Binary hash: 0dcbb19de3c22edfe61605a970eb6d42199df91ac3e992cd3f2e33cb13efbb4c + Config hash: 3bdaebcc2f639d77cb248242c1d01c8651f540cdbf423d26fe3128516fd225b6 + Workflow hash: 004fff5bb1ae05cc16e453f8ad564f5e8b0eae1945ec22f3d0adfc0339954d56 + ``` + + If the workflow hash matches the onchain workflow ID, the deployed workflow matches the shared source code. + + + +## Learn more + +- [Deploying Workflows](/cre/guides/operations/deploying-workflows) +- [Updating Deployed Workflows](/cre/guides/operations/updating-deployed-workflows) +- [Building Consumer Contracts](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts) +- [CRE CLI Workflow Reference](/cre/reference/cli/workflow) diff --git a/src/content/cre/llms-full-go.txt b/src/content/cre/llms-full-go.txt index 1b80e60a5e7..7f0fe89589c 100644 --- a/src/content/cre/llms-full-go.txt +++ b/src/content/cre/llms-full-go.txt @@ -5738,6 +5738,116 @@ For complete setup instructions, configuration requirements, and step-by-step gu --- +# Verifying Workflows +Source: https://docs.chain.link/cre/guides/operations/verifying-workflows +Last Updated: 2026-03-19 + +Workflow verification ensures the integrity and authenticity of your workflows across deployment, onchain execution, and third-party auditing. This guide explains how workflow IDs are computed, how to verify workflows in consumer contracts, and how to enable independent verification by third parties. + +## Workflow ID + +The workflow ID is a unique hash that serves as the primary identifier for your workflow throughout its lifecycle. It is computed locally during [`cre workflow deploy`](/cre/reference/cli/workflow#cre-workflow-deploy) from the following inputs: + +- **workflowOwner**: The deployer's address +- **workflowName**: The name specified in your workflow +- **Compiled workflow binary**: The WASM binary produced from your workflow code +- **Config file contents**: The contents of your workflow's config file +- **Secrets hash**: An empty string placeholder for secrets + +Because the workflow ID is derived from these inputs, it deterministically represents a specific version of your workflow code and configuration. + + + +Use [`cre workflow hash`](/cre/reference/cli/workflow#cre-workflow-hash) to inspect the workflow ID before deploying. This lets you preview the ID without submitting an onchain transaction. + +For more details on deployment and updates, see [Deploying Workflows](/cre/guides/operations/deploying-workflows) and [Updating Deployed Workflows](/cre/guides/operations/updating-deployed-workflows). + +## Verifying workflows onchain + +When a workflow writes onchain, the consumer contract receives both the report data and metadata through the `onReport` callback. The metadata contains information you can use to verify the source of the report: + +- **`workflowId`** (`bytes32`): The unique workflow hash +- **`workflowName`** (`bytes10`): The workflow name, hash-encoded +- **`workflowOwner`** (`address`): The address that deployed the workflow + +See [Building Consumer Contracts](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts) for the full `IReceiver` interface and metadata structure. + +### Workflow name encoding + +The `workflowName` in metadata is not stored as a plain string. It is a SHA256 hash of the workflow name, truncated to `bytes10`. See [how workflow names are encoded](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts#how-workflow-names-are-encoded) for the full encoding process. + +### Security best practices + +Follow these practices to ensure only authorized workflows can interact with your consumer contract: + +- **Verify `msg.sender`**: Always check that `msg.sender` is the expected forwarder address. See the [Forwarder Directory](/cre/guides/workflow/using-evm-client/forwarder-directory) for addresses by network. +- **Permission on workflow ID**: Use `setExpectedWorkflowId` from `ReceiverTemplate` to restrict which workflow can call your contract. + + + +## Third-party verification + + + +Third-party verification allows customers or auditors to independently confirm that a deployed workflow matches its source code. The deployer shares the workflow source, and the verifier uses the CRE CLI to compute the workflow hash and compare it against the onchain workflow ID. + +### Steps for the workflow developer + +1. **Add a `.env.public` file** to your workflow folder with the Go toolchain version pinned: + + ``` + GOTOOLCHAIN=go1.23.0 + ``` + + This ensures reproducible builds across different platforms and environments. Add this file *before* running `cre workflow deploy`. + +2. **Share your workflow source** with the customer. Provide a zip archive or repository link that includes all workflow files, including `.env.public`. Exclude `.env` files that contain private keys or secrets. + +### Steps for the verifier + +1. [**Install the CRE CLI**](/cre/getting-started/cli-installation). No login or deploy access is required for hash verification. + +2. **Unzip or clone** the shared workflow repository. + +3. **Run `cre workflow hash`** to compute the workflow hash: + + ```bash + cre workflow hash ./workflow-folder --public_key=0xYourDeployerAddress + ``` + + Replace `./workflow-folder` with the path to the workflow source and `0xYourDeployerAddress` with the deployer's public address. + +4. **Compare the output** with the workflow ID observed onchain. The `Workflow hash` value in the output corresponds to the onchain workflow ID: + + ``` + Binary hash: 0dcbb19de3c22edfe61605a970eb6d42199df91ac3e992cd3f2e33cb13efbb4c + Config hash: 3bdaebcc2f639d77cb248242c1d01c8651f540cdbf423d26fe3128516fd225b6 + Workflow hash: 004fff5bb1ae05cc16e453f8ad564f5e8b0eae1945ec22f3d0adfc0339954d56 + ``` + + If the workflow hash matches the onchain workflow ID, the deployed workflow matches the shared source code. + + + +## Learn more + +- [Deploying Workflows](/cre/guides/operations/deploying-workflows) +- [Updating Deployed Workflows](/cre/guides/operations/updating-deployed-workflows) +- [Building Consumer Contracts](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts) +- [CRE CLI Workflow Reference](/cre/reference/cli/workflow) + +--- + # Deleting Workflows Source: https://docs.chain.link/cre/guides/operations/deleting-workflows Last Updated: 2025-11-04 diff --git a/src/content/cre/llms-full-ts.txt b/src/content/cre/llms-full-ts.txt index 8e194113777..cad7ef0a141 100644 --- a/src/content/cre/llms-full-ts.txt +++ b/src/content/cre/llms-full-ts.txt @@ -4853,6 +4853,116 @@ For complete setup instructions, configuration requirements, and step-by-step gu --- +# Verifying Workflows +Source: https://docs.chain.link/cre/guides/operations/verifying-workflows +Last Updated: 2026-03-19 + +Workflow verification ensures the integrity and authenticity of your workflows across deployment, onchain execution, and third-party auditing. This guide explains how workflow IDs are computed, how to verify workflows in consumer contracts, and how to enable independent verification by third parties. + +## Workflow ID + +The workflow ID is a unique hash that serves as the primary identifier for your workflow throughout its lifecycle. It is computed locally during [`cre workflow deploy`](/cre/reference/cli/workflow#cre-workflow-deploy) from the following inputs: + +- **workflowOwner**: The deployer's address +- **workflowName**: The name specified in your workflow +- **Compiled workflow binary**: The WASM binary produced from your workflow code +- **Config file contents**: The contents of your workflow's config file +- **Secrets hash**: An empty string placeholder for secrets + +Because the workflow ID is derived from these inputs, it deterministically represents a specific version of your workflow code and configuration. + + + +Use [`cre workflow hash`](/cre/reference/cli/workflow#cre-workflow-hash) to inspect the workflow ID before deploying. This lets you preview the ID without submitting an onchain transaction. + +For more details on deployment and updates, see [Deploying Workflows](/cre/guides/operations/deploying-workflows) and [Updating Deployed Workflows](/cre/guides/operations/updating-deployed-workflows). + +## Verifying workflows onchain + +When a workflow writes onchain, the consumer contract receives both the report data and metadata through the `onReport` callback. The metadata contains information you can use to verify the source of the report: + +- **`workflowId`** (`bytes32`): The unique workflow hash +- **`workflowName`** (`bytes10`): The workflow name, hash-encoded +- **`workflowOwner`** (`address`): The address that deployed the workflow + +See [Building Consumer Contracts](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts) for the full `IReceiver` interface and metadata structure. + +### Workflow name encoding + +The `workflowName` in metadata is not stored as a plain string. It is a SHA256 hash of the workflow name, truncated to `bytes10`. See [how workflow names are encoded](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts#how-workflow-names-are-encoded) for the full encoding process. + +### Security best practices + +Follow these practices to ensure only authorized workflows can interact with your consumer contract: + +- **Verify `msg.sender`**: Always check that `msg.sender` is the expected forwarder address. See the [Forwarder Directory](/cre/guides/workflow/using-evm-client/forwarder-directory) for addresses by network. +- **Permission on workflow ID**: Use `setExpectedWorkflowId` from `ReceiverTemplate` to restrict which workflow can call your contract. + + + +## Third-party verification + + + +Third-party verification allows customers or auditors to independently confirm that a deployed workflow matches its source code. The deployer shares the workflow source, and the verifier uses the CRE CLI to compute the workflow hash and compare it against the onchain workflow ID. + +### Steps for the workflow developer + +1. **Add a `.env.public` file** to your workflow folder with the Go toolchain version pinned: + + ``` + GOTOOLCHAIN=go1.23.0 + ``` + + This ensures reproducible builds across different platforms and environments. Add this file *before* running `cre workflow deploy`. + +2. **Share your workflow source** with the customer. Provide a zip archive or repository link that includes all workflow files, including `.env.public`. Exclude `.env` files that contain private keys or secrets. + +### Steps for the verifier + +1. [**Install the CRE CLI**](/cre/getting-started/cli-installation). No login or deploy access is required for hash verification. + +2. **Unzip or clone** the shared workflow repository. + +3. **Run `cre workflow hash`** to compute the workflow hash: + + ```bash + cre workflow hash ./workflow-folder --public_key=0xYourDeployerAddress + ``` + + Replace `./workflow-folder` with the path to the workflow source and `0xYourDeployerAddress` with the deployer's public address. + +4. **Compare the output** with the workflow ID observed onchain. The `Workflow hash` value in the output corresponds to the onchain workflow ID: + + ``` + Binary hash: 0dcbb19de3c22edfe61605a970eb6d42199df91ac3e992cd3f2e33cb13efbb4c + Config hash: 3bdaebcc2f639d77cb248242c1d01c8651f540cdbf423d26fe3128516fd225b6 + Workflow hash: 004fff5bb1ae05cc16e453f8ad564f5e8b0eae1945ec22f3d0adfc0339954d56 + ``` + + If the workflow hash matches the onchain workflow ID, the deployed workflow matches the shared source code. + + + +## Learn more + +- [Deploying Workflows](/cre/guides/operations/deploying-workflows) +- [Updating Deployed Workflows](/cre/guides/operations/updating-deployed-workflows) +- [Building Consumer Contracts](/cre/guides/workflow/using-evm-client/onchain-write/building-consumer-contracts) +- [CRE CLI Workflow Reference](/cre/reference/cli/workflow) + +--- + # Deleting Workflows Source: https://docs.chain.link/cre/guides/operations/deleting-workflows Last Updated: 2025-11-04