Skip to content
Tollgate Docs

Test vectors

Use these to verify a non-TypeScript implementation produces the same EIP-712 digest and signature shape. The canonical vectors live in packages/core/test/eip712/vectors.json (see docs/TASK-03.md).

Canonicalization

[
  { "in": "/api/users",                "out": "/api/users" },
  { "in": "/api/users/42",             "out": "/api/users/[id]" },
  { "in": "/api/users/0xaBcDef",       "out": "/api/users/[id]" },
  { "in": "/api/users/a5f3e1b2-7c9d-4e8f-b0a1-c2d3e4f5a6b7",
    "out": "/api/users/[id]" },
  { "in": "/API/Users/",               "out": "/api/users" }
]

HMAC apiKeyHash

{
  "apiKey":       "aw_live_1234567890abcdef1234567890abcdef",
  "developerSalt":"0x22ba3e4c00000000000000000000000000000000000000000000000000000000",
  "apiKeyHash":   "0x<HMAC-SHA256(apiKey, salt) — 32 bytes, 0x-prefixed>"
}

IOU digest

Given the typed-data domain + message below, the keccak256 digest (_hashTypedDataV4) is fixed and cross-language verifiable.

{
  "domain": {
    "name": "Tollgate", "version": "1", "chainId": 8453,
    "verifyingContract": "0x0000000000000000000000000000000000000001",
    "salt": "0x00ac861f14334a526298960efd2ac9e7dab60185c18dd201edac1dd47af3a638"
  },
  "message": {
    "developer": "0x0000000000000000000000000000000000000002",
    "amountMicros": "50000",
    "chainId": "8453",
    "nonce": "1",
    "apiKeyHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "path": "/api/premium",
    "deadline": "1744999999"
  }
}

See packages/core/test/eip712/digest.test.ts for the expected 32-byte digest value.

Signature round-trip

Sign with a deterministic private key (e.g. 0x0101…01). Expected signer address: 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf. The signature (r,s,v) is 65 bytes. Canonical form: low-s.