Skip to content
Merged
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,8 @@ function makeFlowReceiptId() {
}

function makeReceipt({ execution, result, status = "success", error = null, traceId, receiptId }) {
// CommandLayer receipt generation
// Wraps an agent verb execution into a signed, verifiable receipt.
let receipt = {
status,
entry: execution.entry,
Expand Down Expand Up @@ -1797,6 +1799,8 @@ app.post("/verify", async (req, res) => {
let ensExpect = null;

if (wantEns) {
// ENS signer resolution (VerifyAgent.eth integration)
// Resolves cl.sig.pub / cl.sig.kid from the signer ENS name so receipts can be verified without hardcoded keys.
const signerForEns = String(proof?.signer_id || runtimeConfig.signerId || "").trim();
const ensOut = await fetchEnsSignerBundle({ signerName: signerForEns, refresh });

Expand Down Expand Up @@ -1866,7 +1870,8 @@ app.post("/verify", async (req, res) => {
});
}

// 2) verify signature/hash via runtime-core
// CommandLayer receipt verification
// Rebuilds the canonical receipt hash and verifies the Ed25519 signature.
let v;
try {
v = verifyReceiptEd25519Sha256(runtimeCoreReceipt, {
Expand Down Expand Up @@ -1899,6 +1904,8 @@ app.post("/verify", async (req, res) => {

const sigErr = signatureValid ? null : v?.reason || "verify failed";

// Schema validation for verifiable agent receipts
// Confirms receipt structure matches the declared CommandLayer schema.
// 3) schema validation (optional + edge-safe)
let schemaOk = null;
let schemaErrors = null;
Expand Down
Loading