Ledger
Keep verifiable, tamper-evident cryptographic audit chains of decisions and executions.
When to use it
Validate exported audit trails and verify compliance integrity independently of live services.
Supported Operations & Data Contracts
Call this module with a key scoped to 'ledger'. Provide the operation name and matching input dictionary.
verify · Verify Cryptographic Audit ChainPOST /api/v1/modules/ledger
Validates parent-child SHA-256 hashes, timestamps, and sequence indices across an audit log snapshot.
Input Parameters
| Field | Type | Requirement | Description |
|---|---|---|---|
epoch | string (1-128 chars) | Required | Epoch identifier matching the entries. |
entries | array | Required | Sequential array of audit entries starting at index 0. |
Output Fields
| Field | Type | Description |
|---|---|---|
valid | boolean | Whether the chain is unbroken and cryptographically sound. |
count | number | Number of verified entries. |
headHash | string | Terminal entry SHA-256 hash. |
errorIndex | number (optional) | Index of entry that failed verification, if invalid. |
reason | string (optional) | Explanation of failure (e.g. prevHash mismatch). |
Example Request Payload
JSON Request BodyContent-Type: application/json
{
"operation": "verify",
"input": {
"epoch": "2026-10-q4",
"entries": []
}
}Example Response
JSON Response (HTTP 200)Cache-Control: no-store
{
"module": "ledger",
"output": {
"valid": true,
"count": 0,
"headHash": ""
}
}Configuration in Graph Builder
When adding Ledger into a visual component or graph workflow, configure its node runtime settings in the builder inspector:
Position Ledger at the end of a transaction workflow to record immutable checkpoint proofs of permitted actions.
Direct API Code Examples
Invoke this module directly from your backend services without passing through the visual builder:
TypeScript / Node.js (Fetch)index.ts
const response = await fetch("https://api.sherlock.dev/api/v1/modules/ledger", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.SHERLOCK_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
operation: "verify",
input: { epoch: "export-epoch", entries: myLedgerExport }
}),
});
const { output } = await response.json();
console.log("Audit Chain Valid:", output.valid, "Head Hash:", output.headHash);cURL / Bashterminal
curl -X POST "$SHERLOCK_BASE_URL/api/v1/modules/ledger" \
-H "Authorization: Bearer $SHERLOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"verify","input":{"epoch":"demo","entries":[]}}'Current Boundaries & Guarantees
Standalone verification checks an exported snapshot against hash-chain rules; it does not append arbitrary events. Raw voice audio never enters the ledger.