Proposal: This page presents the draft API and profile model. Send feedback on GitHub.
Construct and verify a response proof
A separately authenticated response protects the recipient against a substituted result, status, outcome or request association. The guide profile requires a distinct verifier challenge and a separate resource proof attestation for its committed response.
Noncircular construction
- Freeze the exact application result bytes and durable signed outcome. Compute
resultHash = rawHash(resultBytes). - Create
response-context, including the original signed request reference, operation, recipient key, resource key, status, policy, result hash, signed outcome reference, fresh record and deadline. - Obtain and authenticate a
response-proofchallenge whosecontextRefisH("response-context", context), and whose actor is the resource key. The resource's circuit answers the challenge under its own configured credentials. The verifier validates the response and consumes the challenge. - Set
proof = {challenge, result}and have the resource sign aresponsepayload containingcontextRefandH("proof", proof). - Transmit the
responsePacket: context, exact result bytes encoded as hex, proof, signed outcome and signed response. Its archival packet digest can be computed after assembly. It is not included in the context that the proof signs.
async function makeResponse(packet, permit, observation, outcome) {
const context = freeze({v: "http6-guide-01", kind: "response-context",
op: packet.attempt.op, record: freshResponseRecord(), requestRef: ref(packet.request),
recipientKeyId: packet.attempt.keyId, resourceKeyId: resourceSigner.keyId(),
policyRef: packet.attempt.policyRef, status: 200, contentType: "application/json",
resultHash: rawHash(observation.resultBytes), outcomeRef: ref(outcome),
iat: clock.now(), exp: responseDeadline()});
const challenge = await verifier.issue({purpose: "response-proof",
contextRef: H("response-context", context), actorKeyId: context.resourceKeyId,
recipient: "client"});
const nativeResponse = await resourceCircuit.answer(challenge, context);
const result = await verifier.validateAndConsume(challenge, nativeResponse);
const proof = {challenge, result};
const response = await resourceSigner.sign({v: "http6-guide-01", kind: "response",
contextRef: H("response-context", context), proofRef: H("proof", proof)});
return {context, result: hex(observation.resultBytes), proof, outcome, response};
}
A response proof can fail or be unavailable after a real effect has committed. The caller must retain an uncertain delivery state and use separately authorized inquiry; failure to deliver or verify the response does not undo the effect or authorize another one.
Receiver checklist
- Authenticate the TLS endpoint and reject malformed, noncanonical, oversized or unexpected packet types. Independently identify the resource and the pending operation.
- Verify the resource's response signature, configured role and its
contextRefandproofRef. Checkstatus, content type, current response interval and actual recipient key. - Recompute the exact result-byte hash. Compare operation, policy, original request reference, target context and intended recipient to the retained verified request. A response for a different attempt is not interchangeable even if the operation is the same.
- Verify the signed response challenge and designated verifier result, including challenge freshness and one-use handling, response direction, resource actor, context, policy and verifier's authorized role. The verifier's attestation is trusted only under the client's configured proof policy.
- Verify the resource-signed outcome and its request, permit, intent, audience, result digest, units, epoch and row. Match the outcome to trusted resource evidence as required by the application. Independently evaluate evidence freshness and disclosure authorization.
- Return
Committedand release the result only if all required checks succeed. Report a verified signature, verified proof attestation and resource-observation status as separate fields in the result.
If the request was sent before revocation but the response arrives later, verify what occurred at the actual commit time and separately authorize disclosure to the reader. A later acknowledgment timestamp is not the commit time.