{
  "tool_id": "art-592-x402-domain-nonce-window-checker",
  "note": "golden_hash filled by `node golden-parity.test.mjs --update`. This kernel does no crypto (no keccak/ECDSA) -- it only compares caller-supplied fields against each other and a caller-supplied now_unix, per SPEC-X402-CRYPTO-CORE-1-2026-08-09.md section 6. Vectors below cover each hard-fail path named in the row: domain chain mismatch, domain contract mismatch, expired window, not-yet-valid window, malformed (zero) nonce, caller-flagged replay, plus a clean pass and a missing-input indeterminate.",
  "vectors": [
    {
      "name": "clean-pass",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "chainId": 1,
        "verifyingContract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "validAfter": 0,
        "validBefore": 2000000000,
        "now_unix": 1000000000,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_already_used": false
      },
      "output_payload": {
        "verdict": "PASS",
        "reasons": [],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
        },
        "signed_domain": {
          "chain_id": "1",
          "verifying_contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
        },
        "domain_chain_match": true,
        "domain_contract_match": true,
        "window": {
          "valid_after": "0",
          "valid_before": "2000000000",
          "now_unix": "1000000000"
        },
        "authorization_within_window": true,
        "authorization_expired": false,
        "authorization_not_yet_valid": false,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_well_formed": true,
        "nonce_already_used": false,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "b153b4e7e82899d50aad4c9e430062ef50d837e9f462dfee604861d5892df68b"
    },
    {
      "name": "domain-chain-mismatch-refuse",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "chainId": 8453,
        "verifyingContract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "validAfter": 0,
        "validBefore": 2000000000,
        "now_unix": 1000000000,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "output_payload": {
        "verdict": "REFUSE",
        "reasons": [],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
        },
        "signed_domain": {
          "chain_id": "8453",
          "verifying_contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
        },
        "domain_chain_match": false,
        "domain_contract_match": true,
        "window": {
          "valid_after": "0",
          "valid_before": "2000000000",
          "now_unix": "1000000000"
        },
        "authorization_within_window": true,
        "authorization_expired": false,
        "authorization_not_yet_valid": false,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_well_formed": true,
        "nonce_already_used": null,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "d2f00c3a679e39a274cdb3415ab9afe6278f6769d3efcee476c35d1f268b0614"
    },
    {
      "name": "domain-contract-mismatch-refuse",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0x1111111111111111111111111111111111111111",
        "chainId": 1,
        "verifyingContract": "0x2222222222222222222222222222222222222222",
        "validAfter": 0,
        "validBefore": 2000000000,
        "now_unix": 1000000000,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "output_payload": {
        "verdict": "REFUSE",
        "reasons": [],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "signed_domain": {
          "chain_id": "1",
          "verifying_contract": "0x2222222222222222222222222222222222222222"
        },
        "domain_chain_match": true,
        "domain_contract_match": false,
        "window": {
          "valid_after": "0",
          "valid_before": "2000000000",
          "now_unix": "1000000000"
        },
        "authorization_within_window": true,
        "authorization_expired": false,
        "authorization_not_yet_valid": false,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_well_formed": true,
        "nonce_already_used": null,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "32f316de3f191073c96db152914668e3c8241747eb8731d4dfd9294f55b2cec7"
    },
    {
      "name": "expired-window-refuse",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0x1111111111111111111111111111111111111111",
        "chainId": 1,
        "verifyingContract": "0x1111111111111111111111111111111111111111",
        "validAfter": 0,
        "validBefore": 1000,
        "now_unix": 5000,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "output_payload": {
        "verdict": "REFUSE",
        "reasons": [],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "signed_domain": {
          "chain_id": "1",
          "verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "domain_chain_match": true,
        "domain_contract_match": true,
        "window": {
          "valid_after": "0",
          "valid_before": "1000",
          "now_unix": "5000"
        },
        "authorization_within_window": false,
        "authorization_expired": true,
        "authorization_not_yet_valid": false,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_well_formed": true,
        "nonce_already_used": null,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "c7d978b5fb309df052b67d1cf15fbae57fbb5a6d875e80aeb992b3bca725cbce"
    },
    {
      "name": "not-yet-valid-refuse",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0x1111111111111111111111111111111111111111",
        "chainId": 1,
        "verifyingContract": "0x1111111111111111111111111111111111111111",
        "validAfter": 5000,
        "validBefore": 10000,
        "now_unix": 100,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "output_payload": {
        "verdict": "REFUSE",
        "reasons": [],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "signed_domain": {
          "chain_id": "1",
          "verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "domain_chain_match": true,
        "domain_contract_match": true,
        "window": {
          "valid_after": "5000",
          "valid_before": "10000",
          "now_unix": "100"
        },
        "authorization_within_window": false,
        "authorization_expired": false,
        "authorization_not_yet_valid": true,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_well_formed": true,
        "nonce_already_used": null,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "287e739059f52889de2b04b4c65d4f2c2b1d114286af7c28fb0c975b2794bfd3"
    },
    {
      "name": "malformed-zero-nonce-refuse",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0x1111111111111111111111111111111111111111",
        "chainId": 1,
        "verifyingContract": "0x1111111111111111111111111111111111111111",
        "validAfter": 0,
        "validBefore": 2000000000,
        "now_unix": 1000000000,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      "output_payload": {
        "verdict": "REFUSE",
        "reasons": [
          "nonce failed format check: bytes32 value must be non-zero"
        ],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "signed_domain": {
          "chain_id": "1",
          "verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "domain_chain_match": true,
        "domain_contract_match": true,
        "window": {
          "valid_after": "0",
          "valid_before": "2000000000",
          "now_unix": "1000000000"
        },
        "authorization_within_window": true,
        "authorization_expired": false,
        "authorization_not_yet_valid": false,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce_well_formed": false,
        "nonce_already_used": null,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "28aca8c227a969d2f874e5b0fbe7562af7d2a80b5f33169b76ea9e2dee685ceb"
    },
    {
      "name": "caller-flagged-replay-refuse",
      "policy_parameters": {
        "expected_chain_id": 1,
        "expected_verifying_contract": "0x1111111111111111111111111111111111111111",
        "chainId": 1,
        "verifyingContract": "0x1111111111111111111111111111111111111111",
        "validAfter": 0,
        "validBefore": 2000000000,
        "now_unix": 1000000000,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_already_used": true
      },
      "output_payload": {
        "verdict": "REFUSE",
        "reasons": [],
        "expected": {
          "expected_chain_id": "1",
          "expected_verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "signed_domain": {
          "chain_id": "1",
          "verifying_contract": "0x1111111111111111111111111111111111111111"
        },
        "domain_chain_match": true,
        "domain_contract_match": true,
        "window": {
          "valid_after": "0",
          "valid_before": "2000000000",
          "now_unix": "1000000000"
        },
        "authorization_within_window": true,
        "authorization_expired": false,
        "authorization_not_yet_valid": false,
        "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "nonce_well_formed": true,
        "nonce_already_used": true,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "c0ea9c1816832954cd4047042cb88421e4ccccb8c672cef3977805b88f6e7ec3"
    },
    {
      "name": "missing-fields-indeterminate",
      "policy_parameters": {},
      "output_payload": {
        "verdict": "INDETERMINATE",
        "reasons": [
          "expected_chain_id is required and must be a non-negative uint256 (mandatory policy_parameter, never defaulted or inferred from the signed domain)",
          "expected_verifying_contract is required and must be a 20-byte hex address (mandatory policy_parameter, never defaulted or inferred from the signed domain)",
          "chainId is required and must be a non-negative uint256 (the domain field actually baked into the signature)",
          "verifyingContract is required and must be a 20-byte hex address (the domain field actually baked into the signature)",
          "validAfter is required and must be a non-negative uint256",
          "validBefore is required and must be a non-negative uint256",
          "now_unix is required and must be a non-negative uint256 (caller-supplied reference time -- this kernel never reads the system clock, which would make execution_hash non-reproducible)",
          "nonce is required and must be a 32-byte hex value (bytes32)"
        ],
        "expected": {
          "expected_chain_id": null,
          "expected_verifying_contract": null
        },
        "signed_domain": {
          "chain_id": null,
          "verifying_contract": null
        },
        "domain_chain_match": null,
        "domain_contract_match": null,
        "window": {
          "valid_after": null,
          "valid_before": null,
          "now_unix": null
        },
        "authorization_within_window": null,
        "authorization_expired": null,
        "authorization_not_yet_valid": null,
        "nonce": null,
        "nonce_well_formed": null,
        "nonce_already_used": null,
        "disclosure": "On-chain nonce uniqueness is enforced by the token contract at settlement time, not by this verifier. This tool confirms the authorization is well-formed, correctly signed, and not self-reported as already used -- it cannot confirm the nonce has never been spent on-chain."
      },
      "golden_hash": "cb961bf1e752d7d852c5675be3cb63c73b166e1480f8cad018c19ebdd573c879"
    }
  ]
}
