{
 "service": "AgentDNA - sync by DNA",
 "idea": "Download a catalog once. After that, receive only what changed. The catalog travels as its DNA: a code that weighs exactly the differences between your copy and the truth, holds none of the data, and calls back exactly the products you lack.",
 "ways": {
  "1_since (easiest, no math)": {
   "how": "Every catalog JSON carries dna.version. Next time: GET /c/{domain}.json?since=<version>",
   "returns": "agentdna-delta-v1: changed products, removed skus, and the company block if it changed. up_to_date=true means nothing to do. If too much changed, you get the full catalog with delta.full=true."
  },
  "2_check (8 to 512 bytes)": {
   "how": "GET /c/{domain}.dna?c=8 and compare with the DNA of your copy (or just with the version you hold).",
   "returns": "agentdna-dna-v1: version and the catalog's DNA (c values of 64 bits)."
  },
  "3_repair (any copy, even damaged, no version needed)": {
   "how": "POST /c/{domain}/sync with {\"dna\": [16 hex digits, ...]} = the DNA of your own copy (1 to 64 values; c values call up to c differences). Reference client: GET /dna/client.py",
   "returns": "agentdna-sync-v1: changed products, and drop = elements of your copy that are wrong or gone. too_different=true means: send a larger DNA or read the full catalog once."
  }
 },
 "math": {
  "field": "GF(2^64), modulus x^64 + x^4 + x^3 + x + 1",
  "element": "product: first 8 bytes big-endian of sha256(sku + '\\n' + canonical_json(product)), 0 -> 1; company: same with sku '@company' over {\"company\": <company block>, \"verified\": <bool>}",
  "canonical_json": "json.dumps(obj, sort_keys=True, separators=(',', ':'), ensure_ascii=False)",
  "dna": "odd power sums s1, s3, ..., s(2c-1) of all elements (a BCH syndrome, the family of the perfect Golay/Hamming codes)",
  "decode": "XOR two DNAs; Berlekamp-Massey and root finding give exactly the differing elements, verified, or a clear too_different",
  "cost": "64 bits per difference, whatever the catalog size: 3 changed products in a 10,000-product catalog cost 24 bytes of DNA"
 },
 "price": "Included in AgentDNA. Free for agents."
}