✅Verify an Off-Chain Tool Result
An off-chain Tool returns a result through the leader. This guide configures the complete RegisteredKey path: active Tool and Leader keys, Toolkit JSON, ToolRegistry verifier support, the per-vertex DAG field, inspection, and negative evidence. It ends with the separate External verifier boundary.
Prerequisites
A registered off-chain Tool that you can run and redeploy; see Build an off-chain Tool.
The Tool's saved
OwnerCap<OverTool>record, or its object ID for--owner-cap.A configured Nexus CLI, signer SUI address balance, and target-network object bundle.
A public Leader capability identifier and active-key readback from the selected integration environment; this guide does not publish Leader process setup.
jq,curl, and a non-production environment for negative verification tests.
The verifier modes
Each off-chain DAG vertex chooses exactly one ToolVerifierMode:
None— ordinary submission without verifier proof.RegisteredKey— active Leader and Tool Ed25519 keys authenticate the schema-ordered canonical input commitment and canonical response BCS through the existing v3 signatures; v3.1 adds separate request-context authentication.External— workflow calls the Tool's registered on-chain verifier and consumes itsAcceptorRejectverdict.
RegisteredKey proves provenance and integrity of the canonical evidence, not the semantic truth of a correctly signed answer. External proves that the configured verifier ran, not that its governance or logic is universally trustworthy.
RegisteredKey data flow
The v3.1 context signature is separate from on-chain RegisteredKey evidence: it binds the receiving Tool FQN, invocation nonce, and Unix-millisecond timestamp, which the Toolkit checks against the allowlisted Leader key and an inclusive freshness window (30,000 ms by default) before replay-cache access. The existing Leader signature still covers only the 32-byte schema-ordered input hash. The Tool result signature remains "nexus.direct.v3.tool-response" || leader_signature || nonce || SHA-256("nexus.direct.v3.raw-output" || canonical_response_bcs), and the on-chain verifier still checks that existing input/result evidence. Method, path, query, raw body bytes, status, and arbitrary headers are not signed, so authenticated HTTPS remains required. The API stays under signed_http::v3, the version header remains X-Nexus-Sig-V: 3, and there is no Tool KID header.
Step 1 — Generate and register the Tool key
Set the exact FQN and generate a keypair file. Capture the runtime secret directory before any later cd, protect the file before it contains any private material, avoid putting the key in command arguments or history, and delete or migrate temporary copies through a controlled backup lifecycle:
keygen --out writes JSON, while register-key --signing-key accepts a raw encoded key or a file containing only that encoded key. Extract the private_key_hex value rather than passing the JSON file itself.
Register the key and read it back:
The CLI resolves OwnerCap<OverTool> from the saved Tool record. If that record is unavailable, add --owner-cap <OWNER_CAP_OBJECT_ID>. Retain the registration transaction digest, Tool ID, binding object ID, active Tool key binding key_id, and the corresponding public-key evidence. Keep the private key in a secret manager; the shell variable is a local tutorial convenience.
Step 2 — Configure RegisteredKey support on the Tool
Registering a message key does not configure Tool verifier support. The Tool owner must perform the separate ToolRegistry mutation:
This command also resolves the owner capability from saved CLI config, with --owner-cap <OWNER_CAP_OBJECT_ID> as the explicit override. Read the canonical Tool record back:
The configuration result and inspection output are different evidence: retain the mutation digest and the later Tool state projection.
Step 3 — Export or synchronize allowed Leaders
Capture one absolute allowlist path, then export every Leader identity with an active Ed25519 key:
For a restricted Tool, replace --all with one or more --leader <LEADER_CAP_ID> arguments. For a long-running refresh process:
Add --once to refresh atomically and exit. The exported file's schema version is 1, but it is the active AllowedLeadersFileV1 schema under the signed-HTTP v3 wire module. The Toolkit endpoint authenticates against the local file contents without an RPC lookup; refresh or restart that local file after NetworkAuth key rotation rather than assuming the endpoint discovers the new binding on its own.
Step 4 — Create and load the Toolkit config
These examples use the exact SDK revision prepared in Step 7. Toolkit JSON rejects an obsolete top-level version field and uses optional per-Tool response_signing_key. This RegisteredKey path requires that key for the exact served FQN so successful canonical result BCS carries a Tool signature.
Build the temporary toolkit-config.json with the exact FQN and private Tool key inside the runtime secret directory:
The equivalent literal schema is:
The zero key is test material only. In this demo, toolkit-config.json is temporary secret-bearing state: umask 077 creates it mode 0600, and the trap from Step 1 removes it with the key files when the shell exits or the Toolkit stops. If a persistent protected service config is required, move it to the operator's mode-0600 secret store, remove the demo copy, and rotate/delete it during service stop or key rotation; do not leave both copies. Never pass a private key on a command line, commit it, print it, or assume shell environment variables are absent from same-user process inspection. invoke_max_body_bytes defaults to 12 MiB. signed_http.mode is disabled or required; omission defaults that section to required, while omitting the section disables signed HTTP. Use either allowed_leaders_path or an inline allowed_leaders object with { "version": 1, "leaders": [...] }. tools must be nonempty in required mode; a Tool entry may omit a response key for request-verification-only service, but this RegisteredKey result path requires a valid response_signing_key. replay_cache_ttl_ms is optional, must be positive, and controls completed entries.
There is no Tool KID field and no external replay-store field. Replay state is an internal process-local memory cache. In-flight nonce reuse returns 409; an exact completed retry returns cached canonical bytes; the completed entry expires after the configured TTL.
Launch or restart the Tool with the config:
If the Toolkit terminates TLS directly, set both NEXUS_TOOL_TLS_CERT_PATH and NEXUS_TOOL_TLS_KEY_PATH. Otherwise, the gateway must forward the request headers X-Nexus-Sig-V, X-Nexus-Leader-Id, X-Nexus-Leader-Key-Id, X-Nexus-Input-Hash, X-Nexus-Leader-Signature, and X-Nexus-Nonce, plus response headers X-Nexus-Sig-V and X-Nexus-Tool-Signature. It must provide authenticated HTTPS to the Tool; signed HTTP does not make a plaintext hop safe.
Forward nexus-context-sig and nexus-context-timestamp with the other request headers. context_timestamp_window_ms defaults to an inclusive 30,000 ms window and is checked before replay-cache access. require_client_certificate defaults to false; when enabled, the TLS peer key must match the allowlisted Leader key, so terminate TLS in the Toolkit or pass the certificate through to it. Toolkit /meta advertises HTTPS and ignores X-Forwarded-Proto.
Step 5 — Resolve the public Leader boundary
Public Nexus Docs do not publish Leader process configuration, bootstrap, private-key entry, or readiness commands. A RegisteredKey integration needs a public Leader capability identifier and active-key readback supplied by the selected hosted or test environment; retain those public identifiers with the Tool allowlist and verification evidence.
The selected build must prove that the Leader key binding is active before a RegisteredKey vertex can run. If the build does not expose the combined runtime and key-binding read surface, stop at the public Tool, Task, Occurrence, Execution, and transaction-effect evidence and record the capability as unavailable. Do not infer a working signature path from a successful local request or a screenshot.
Step 6 — Select RegisteredKey on the DAG vertex
Set verifier beside the off-chain vertex's name and kind:
Accepted spellings are none, registered_key, and external. The parser rejects a verifier field on an on-chain vertex. Validate the complete DAG before publishing:
Tool support and DAG mode are separate: the CLI/parser can accept the JSON while publication still fails if the registered Tool does not support the selected mode.
Step 7 — Prove unsigned and tampered evidence fails
With Toolkit Required running locally, an unsigned request must fail before Tool input decoding:
Run the pinned v3 tamper test to prove missing, malformed, and wrong Tool signatures do not verify against altered evidence:
This SDK test is reproducible cryptographic evidence, not a live on-chain verdict. Before production, perform a staging Execution whose Tool uses an intentionally unregistered signing key, retain the Reject verification event/result, restore the registered key, rerun the same canonical input, and retain the accepted workflow result. Never conduct the negative key test against production traffic.
Step 8 — Inspect the accepted path
Retain Tool, key, Task, Occurrence, and Execution readbacks:
For an accepted RegisteredKey result, record the on-chain verification event/state with the Tool/Leader active bindings, Tool FQN/ID, DAG hash, input hash, Execution ID, walk index, runtime vertex/iteration, transaction digest, and result. The production leader parses and carries the Tool signature; do not claim that its local logs are the verifier decision.
Step 9 — Use an External verifier when required
External is a separate Tool support configuration. The Tool owner registers one public verifier method, immutable witness, and shared-object list. Workflow then calls that method with the worksheet, TaggedOutput, auxiliary bytes, and registered objects, and consumes VerificationVerdict atomically.
This fragment shows the call shape, not a deployment recipe. Configure the exact package/module/function and witness objects through the Tool verifier command, inspect the Tool’s External support record, and use "verifier":"external" on the off-chain vertex.
Verification checklist
Tool key registration returns and readback agree on Tool ID, binding object ID, active key ID, and public key.
nexus tool inspect --jsonreports.verifier_support.kind == "registered_key".The allowlist contains the intended Leader capability ID and active key ID and has a recorded SHA-256.
The Toolkit config parses, has no top-level version, uses Toolkit
required, maps the exact FQN toresponse_signing_key, and contains no Tool KID or external replay-store field.The Tool launches through
NEXUS_TOOLKIT_CONFIG_PATH, and the proxy/TLS path preserves the v3 signature and v3.1 context headers.The complete DAG validates with
"verifier":"registered_key"on an off-chain vertex.Unsigned input, missing or tampered context evidence, out-of-window timestamps, tampered on-chain signature evidence, and an unregistered Tool key all produce retained negative evidence.
The restored key and identical canonical input produce an accepted on-chain workflow result.
Common failure modes
No OwnerCap<OverTool>
Restore the saved Tool record or pass the exact --owner-cap object ID.
Toolkit config fails at startup
Remove any obsolete top-level version or unknown field; check a positive body/replay limit, one allowlist source, a nonempty Tools map, the exact FQN, and a valid 32-byte response_signing_key when Tool signatures are required.
Unsigned request is accepted
The config path was not loaded, the signed_http section is absent, or mode is disabled. Stop before publishing the DAG.
Leader fails before invocation
A RegisteredKey vertex selected a Leader whose capability/key-ID binding is missing, inactive, or absent from the local allowlist.
Tool returns 401 auth_failed
The Leader capability/key ID is absent from the allowlist, the active key rotated, a v3 header is malformed, or the canonical input hash does not verify.
Tool returns 409 request_in_flight
The same deterministic nonce is still executing; let the leader retry after the in-flight request completes.
Leader reports missing Tool signature
Toolkit is disabled, the FQN has no signing key, a gateway stripped response headers, or the response was a local JSON error rather than canonical result BCS. The missing/malformed stamp aborts before a verification result; repair the transport/signing path and resubmit rather than searching for a Reject verdict.
On-chain RegisteredKey rejects
A valid stamped verdict carried an invalid active-key signature, input commitment, nonce context, Tool signature, or canonical response BCS. Inspect durable VerifierDecision::Reject/failure evidence; do not trust a local parse.
Accepted result remains pending
Verification passed, but payment/ToolCashier/Occurrence settlement is a separate lifecycle. Inspect locks and settlement.
Next guides
Build an off-chain Tool — implement and deploy the Tool runtime.
Execute and settle an Agent — run and settle the verified vertex.
DAG execution diagnosis — diagnose leader readiness and transport failures.
Last updated

